• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Should dependency work with inherence from an abstract class

 
Ranch Hand
Posts: 893
Tomcat Server Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Tomcat Server Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic