aspose file tools*
The moose likes JBoss/WildFly and the fly likes JBoss/JPA/Spring Question - What is the JNDI Name for the EntityManager Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "JBoss/JPA/Spring Question - What is the JNDI Name for the EntityManager" Watch "JBoss/JPA/Spring Question - What is the JNDI Name for the EntityManager" New topic
Author

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

Sanjeev Verma
Ranch Hand

Joined: Aug 24, 2000
Posts: 87
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

Joined: Jul 20, 2005
Posts: 9343
    
111

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.

[My Blog] [JavaRanch Journal]
Sanjeev Verma
Ranch Hand

Joined: Aug 24, 2000
Posts: 87
Awesome, this might be exactly what I need ! I will try this out later today and let you know. Thanks Jaikiran !
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JBoss/JPA/Spring Question - What is the JNDI Name for the EntityManager
 
Similar Threads
Hibernate: Mysql Auto Reconnect is not happening.
EJB3 entity bean
Problem javax.persistence.NoResultException: No entity found for query
javax.naming.NameNotFoundException: TransactionManager not bound
Jboss 5 database connection issues.