Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 2.1.8
Full stack trace of any exception that occurs:
root cause
java.lang.NullPointerException
edu.uc.cohorts.hibernate.HibernateSessionFactory.currentSession(HibernateSessionFactory.java:56)
Name and version of the database you are using: MYSQL 4.1
Hello All,
Configuration
Tomcat 5.0.28
I am using Tomcat's DBCP and JNDI datasource to have my web apps connect to a MySQL database while using hibernate.
However when I try to redeploy an app by uploading my new .war file I have to restart Tomcat in order to get a connection to the database.
I think the reason for this is in my Server.xml file; I am using the following Context settings : It's like these setting have to be refreshed some way. Please help.
<Context path="/quickAdvising" docBase="quickAdvising">
<Resource name="jdbc/qadbus" scope="Shareable" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/qadbus">
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<!-- DBCP database connection settings -->
<parameter>
<name>url</name>
<value>jdbc:mysql://server/us?autoReconnect=true</value>
</parameter>
<parameter>
.......
.....
</ResourceParams>
</Context>
My Hibernate.cfg.xml file has these 2 lines:
<property name="connection.datasource">java:comp/env/jdbc/qadbus</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
Does anybody know of any settings to use so I can successfully redeploy my applications from Tomcat manager using this Context?
Thanks,