*
The moose likes JBoss/WildFly and the fly likes Injecting EntityManager in a servlet 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 » Products » JBoss/WildFly
Bookmark "Injecting EntityManager in a servlet" Watch "Injecting EntityManager in a servlet" New topic
Author

Injecting EntityManager in a servlet

Ganesha Kumar
Ranch Hand

Joined: May 04, 2006
Posts: 56
As the Sun's JEE tutorial, you can inject EntityManager/EntityManagerFactory in servlet or a class implementing ServletContextListener. I have a sample application that injects EntityManagerFactory in a class implementing ServletContextListener. It is working fine with the application server GlassFish. I tried to the same thing with JBoss. The EntityManager was never injected. It was always null. Can someone help me out.
Thanks
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Injecting EntityManager in a servlet
 
Similar Threads
spring wont inject the entitymanager
Appropiate place for creating and closing EntityManagerFactory in Application Managed EntityManager
JPA with JSF and Concurrency
EntityManager managed by application
How to write a bootstrap code