This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

@EJB and @ PersistenceContext not working in JBOSS.5.1.0.GA?

 
Ryan Jimmy
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am implementing a Rest Webservice Using RESTEasy and JPA for persistance and deploying in JBOSS.5.1.0.GA. JPA is working fine when we are getting EMF and EM programatically




But when I tried to inject EntityManager using @PersistenceContext . I am getting null value.

Now we tried it using @Stateless EJB but that too failed in our service class.

Our Service class is as follows:-



--------------------------------------------------------

PersistanceService.java
------------------------


I have persistence.xml configured in this way.



Can you please tell me where I went wrong.I have been spending several days trying to resolve it....Is it that @PersistenceContext is not supported by JBOSS 5.1.0GA???

Any help will be appreciated.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic