This week's book giveaway is in the Android forum.
We're giving away four copies of Android Programming: The Big Nerd Ranch Guide and have Bill Phillips & Chris Stewart on-line!
See this thread for details.
Win a copy of Android Programming: The Big Nerd Ranch Guide this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Should dependency work with inherence from an abstract class  RSS feed

 
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
Sheriff
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
Boost this thread!