Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) 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
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!