-->
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: DB2 + Tomcat + 2 Webapps
PostPosted: Wed Feb 15, 2006 2:45 pm 
Newbie

Joined: Wed Feb 15, 2006 2:25 pm
Posts: 2
Hi

i'm using a tomcat 5.0.27 installation an have deployed 2 webapps. Both webapps have their own db2java.jar (renamed) as DB2Driver.

The problem is that only one webapp could load/use the DB2Driver class to establish a connection to the database a the same time. This means after a cleanly startup of the tomcat, i visite the first webapp A and all is fine. After that, i visit the second one. This second webapp B causes the following exceptions:

Code:
19788 ERROR [Thread-34] net.sf.hibernate.util.JDBCExceptionReporter     - No suitable driver
net.sf.hibernate.exception.JDBCConnectionException: Cannot open connection
        at net.sf.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:66)
        at net.sf.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:30)
        at net.sf.hibernate.impl.BatcherImpl.convert(BatcherImpl.java:325)
        at net.sf.hibernate.impl.BatcherImpl.openConnection(BatcherImpl.java:292)
        at net.sf.hibernate.impl.SessionImpl.connect(SessionImpl.java:3361)
        at net.sf.hibernate.impl.SessionImpl.connection(SessionImpl.java:3321)
        at de.pantarhei.dap.server.hibernate.HibernateGenericDAO.pingDB(HibernateGenericDAO.java:3380)
        at de.pantarhei.dap.server.hibernate.HibernateGenericDAO.init(HibernateGenericDAO.java:106)
        at de.pantarhei.dap.server.hibernate.HibernateGenericDAO.<init>(HibernateGenericDAO.java:94)
        at de.pantarhei.dap.server.hibernate.HibernateDAOService.getGenericDAO(HibernateDAOService.java:47)
        at de.pantarhei.dap.server.logic.Wizard$1.run(Wizard.java:75)
        at java.lang.Thread.run(Thread.java:534)
Caused by: java.sql.SQLException: No suitable driver
        at java.sql.DriverManager.getConnection(DriverManager.java:532)
        at java.sql.DriverManager.getConnection(DriverManager.java:140)
        at org.apache.commons.dbcp.DriverManagerConnectionFactory.createConnection(DriverManagerConnectionFactory.java:51)
        at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:290)
        at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:771)
        at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:95)
        at net.sf.hibernate.connection.DBCPConnectionProvider.getConnection(DBCPConnectionProvider.java:41)
        at net.sf.hibernate.impl.BatcherImpl.openConnection(BatcherImpl.java:289)
        ... 8 more


The other way around, it's the same problem.

Has anyone an idea or a hint how i could solve this problem?


Top
 Profile  
 
 Post subject: classloading perjaps
PostPosted: Thu Feb 16, 2006 7:26 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
try to move db2java.jar into shared/lib directory of the tomcat and do not have it in WEB-INF/lib of those applications.

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


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.