-->
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: Using Webloging JNDI with Hibernate
PostPosted: Fri Jul 21, 2006 8:43 am 
Newbie

Joined: Fri Jul 21, 2006 6:48 am
Posts: 2
Hi All,

I am developing my application in Eclipse using Hibernate and trying to use Hibernate JNDi datasource to access the database.

But I m gettin error:

"org.hibernate.HibernateException: Could not find datasource
[hibernatetool] javax.naming.NoInitialContextException: Need to specify class name in environment or system property....."


Below is the snippet from "hibernate.cfg.xml" file, where "mysqllocalhostbase" is JNDI in Weblogic.

<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.datasource">t3://localhost:7001/mysqllocalhostbase</property>
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
<property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.WeblogicTransactionManagerLookup</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="show_sql">true</property>
</session-factory>
</hibernate-configuration>

Any help/pointers regarding the same would be appreciated.

Regards,
Mohit


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 21, 2006 11:17 am 
Newbie

Joined: Fri Jul 21, 2006 6:27 am
Posts: 10
hi,

i believe you forgot to set some properties. like

"hibernate.jndi.class" with a value like
"com.sun.jndi.fscontext.RefFSContextFactory"

for example. you should take a look at the property file examples.

chris


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.