-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: EJB 3, GlassFish, NetBeans, JPA error!!!!! Help me please!!!
PostPosted: Wed Apr 09, 2008 7:21 pm 
Newbie

Joined: Wed Apr 09, 2008 7:11 pm
Posts: 1
I'm developing a app in NetBeans 6, using GlassFish and EJB 3 but when I call the method createEntityManagerFactory, passing as parameter the name of my persistence.xml, I receive an Exception (HibernateException: Could not find datasource.). I looked the hibernate's source and the line is when the hibernate try to lookup my datasource, however I looked the Glassfish configuration and the register of the JNDI is there.

In my EJB project, I have a session bean stateless as a facade, and I have a generic dao in BMT, and in my persistenceutil I try to get the entitymanagerfactory, and I get this error.

Someone can help me??


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 10, 2008 3:48 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
I usually forget to add "java:/" before the JNDI name in the persistence.xml.
The datasource name is absolute, the persistence.xml is going to lookup from a relative JNDI path, unless you specify the root.
So if my datasource is bound to "myds" I will have to look it up as "java:/myds".

I'm just guessing, as you didn't post the configuration..

regards,
Sanne


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.