Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Should dependency work with inherence from an abstract class

 
Remko Strating
Ranch Hand
Posts: 893
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For a project I have created a general abstract class in which I try to inject a entitymanager with @PersistenceContext annotation.

The concrete class which is a child of the abstract class is annoteted with @Stateless and is so a stateless session bean.

Now I tried to use an entitymanager but the injection didn't work. I got the famous NullPointerException.

Should this work. I used JBoss Enterprise Application 4.3.
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That version of JBoss was not fully EJB3 spec compliant. So i am not sure whether it was working there. The recent community version of JBoss AS 5.1.0 should have this working.
 
Remko Strating
Ranch Hand
Posts: 893
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reaction. So it should work following the specification

I will give the newest JBoSS a try on this behaviour. Is it advisable to upgrade to JBoss 5.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic