Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JBoss/JPA/Spring Question - What is the JNDI Name for the EntityManager

 
Sanjeev Verma
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gurus:

This is a very newbie question I guess - I am trying to use Spring to get reference to my JPA EntityManager in a application deployed on JBoss. My question is, what JNDI name do I use? Below is some configuration:

My persistence.xml looks like this:



My spring configuration looks like this:



Whenever I try to access the injected entityManager reference from inside dealPersistor bean, I get the following error from JBoss:



Obviously I am not doing some configuration correct...Can someone please help!

Thanks for looking.
 
Jaikiran Pai
Marshal
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The EntityManager is not bound to JNDI by default. You will have to configure your persistence.xml to bind it to JNDI. See this (persistence unit jndi binding section) for details.
 
Sanjeev Verma
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Awesome, this might be exactly what I need ! I will try this out later today and let you know. Thanks Jaikiran !
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic