File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes @EJB and @ PersistenceContext not working in JBOSS.5.1.0.GA? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "@EJB and @ PersistenceContext not working in JBOSS.5.1.0.GA?" Watch "@EJB and @ PersistenceContext not working in JBOSS.5.1.0.GA?" New topic
Author

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

Ryan Jimmy
Greenhorn

Joined: Mar 18, 2012
Posts: 4
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.

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: @EJB and @ PersistenceContext not working in JBOSS.5.1.0.GA?
 
Similar Threads
MZs Notes - Pg 159
Problem in generating the Primary Key using a Sequence
Serious error in JPA with @Version
Exception got in deployment of EJB3 .ear