Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Injecting EntityManager in a servlet

 
Ganesha Kumar
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic