-->
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.  [ 1 post ] 
Author Message
 Post subject: Tomcat and Hibernate
PostPosted: Tue Feb 28, 2006 4:28 pm 
Newbie

Joined: Thu Jun 09, 2005 4:13 pm
Posts: 7
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,


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

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.