Win a copy of TensorFlow 2.0 in Action this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

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

 
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.
 
Sheriff
Posts: 10445
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 !
 
Our first order of business must be this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic