artemb
artemb

Reputation: 9381

JBoss: @Resource not injected when classloader isolation enabled

JBoss 4.2.3, an application deployed as a ear. Works. 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

Upvotes: 1

Views: 915

Answers (1)

adam
adam

Reputation: 11

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!

Upvotes: 1

Related Questions