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
|