• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

SessionFactory: javax.naming.NameNotFoundException: hibernate not bound

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I'm facing following problem with hibernate and jboss. I have postgresql-ds.xml in ${JBOSS}/server/default/deploy:


Then, I have jboss-service.xml in META-INF dir of the har:


In my EJB I try to get access to database via:


The har is deployed in jboss-app.xml:


Application deploys with no errors.
Unfortunately jboss throws an Exception when trying to lookup:



What am I doing wrong? I see that the session factory is not bound to JNDI. How to fix it? Anyone can help to fix it?
 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where are you trying to access SessionFactory from?

I had the same problem when I was trying to access SessionFactory from my unit tests (in eclipse) .

if that's the case,
this is what i did (not sure if the best way to solve it or not):

include the jbossall-client.jar, your client.jar and ejb.jar as well as jboss-ejb3.jar, jboss-aop-jdk50-client.jar and jboss-aspect-jdk50-client.jar in the classpath of your unit tests/client and give it another try.

If you came up with a better solution please let me know.
 
Mateusz Moroz
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I try to access the SessionFactory directly from SessionBean.
MySessionFactory is visible in jboss jmx console and shows no errors.
 
On top of spaghetti all covered in cheese, there was this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic