Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC driver not loaded...class loader problem?

 
manoj r patil
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I initialise my Connection Pool in PoolInit.jsp. It was working fine. But now I have redeployed the application on tomcat again and now it gives me "no suitable driver found" exception.
But then I wrote a jsp in which I created a JDBC connection without using Connection Pool. It worked. Then I called PoolInit.jsp and to my great surprise, my Connection Pool got initialized! I restarted the Tomcat and again it made me use this rude process to initialise the Pool.
Can anybody tell me the cause and remedy? Is it the problem of Class Loader?
 
Vasudevan Gopalan
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am facing similar type of problem.I am using oracle 9i jdbc driver.Please do help me ASAP.
Regards,
Vasu
[ May 11, 2004: Message edited by: Vasudevan Gopalan ]
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sun has this error listed in their FAQ. It is probably a problem with your URL string.
Also, note that the original post was over a year ago, so the poster might not be around anymore.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think I see what's going on. It looks like the JSP can see the Database Driver, but the Pooling code cannot. There is a complicated reason why loading in one causes it to be visible in the other, but I'm going to leave that for now.
Question: where are your jars located? I tend to put all web-app jars in the web-inf/lib and all classes in web-inf/classes, but that's just me. They could also be on the classpath, in jre/lib/ext, server/common or elsewhere in the application server classpath (for J2EE apps).
Dave
 
Vasudevan Gopalan
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am using Tomcat 4.1.29,Oracle 8.1.7 and Oracle 9i JDBC Driver. I am using DBPool for Connection Pooling I have put the DBPool.jar file in Shared/lib directory of Tomcat. I have also set the classpath for the JAR File pointing to this lib folder.When i restart the Tomcat my application(With Connection Pooling) is not running.After restarting the Tomcat i change by code without connection pooling it works.Now if i revert back the code again (with connection pooling) it works.Problem arises again after restarting the Tomcat.It also gives me "Driver Not found" error .
Help me on this.

Regards,
Vasu
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, but where is the jar for your database driver?
 
Vasudevan Gopalan
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is there in Shared/lib folder of tomcat and also in classpath
 
Christopher Zinn
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure if this helps at all (I use DBCP for connection pooling in Tomcat 4.1.29).
I have to put the classes12.jar (I use the Oracle 9i Thin Driver) in the TOMCAT_HOME\common\lib folder. DBCP does not find the drivers in SHARED\LIB (I can't remember why, but it made sense when I read the ClassLoader howto in the Tomcat documentation).
- Chris
 
Vasudevan Gopalan
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is DBCP Connection Pooling works fine. If so i can use that.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic