开发者

JBoss: @Resource not injected when classloader isolation enabled

开发者 https://www.devze.com 2022-12-11 03:02 出处:网络
JBoss 4.2.3, an application deployed as a ear. Wo开发者_如何学Pythonrks. Then I enable classloader isolation by adding a loader-repository tag into jboss-app.xml. In multiple beans @Resource TimerServ

JBoss 4.2.3, an application deployed as a ear. Wo开发者_如何学Pythonrks. Then I enable classloader isolation by adding a loader-repository tag into jboss-app.xml. In multiple beans @Resource TimerService stops being injected and the code throws NullPointerException.

What could possibly be the reason of such behavior? I have no clue.

Thanks,

Artem B


Well, I don't have an answer but thanks to you I found the solution. I had this same problem occur in 5.1.0.GA. In my SLSB containing :

@PersistenceContext
EntityManager entityManager;

@Resource
TimerService timerService;

my entityManager would be injected just fine but timerService was yielding an NPE. Once I commented out the <loader-repository>...</loader-repository> element in my jboss-app.xml voila, timerService was valid. Thanks for the tip!

0

精彩评论

暂无评论...
验证码 换一张
取 消