This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
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
Sheriff
Posts: 10447
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
Boost this thread!