JBoss: @Resource not injected when classloader isolation enabled
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 BWell, 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!
精彩评论