• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Moving an app to a different server, getting No suitable driver / Cannot create JDBC driver of class

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi folks,

I'm looking for help with a topic that I've seen on this forum a number of times, but have yet to find a solution that fixes the issue. So if this sounds like deja-vu, it probably is just a bit.

We're moving one of our Tomcat deployed appliation from a Solaris server running Tomcat 5.0.25 (Java 1.4 I think) to an AIX server running Tomcat 6.0.35 (Java 1.5). I had not anticipated any major problems and expected the move to be pretty straightforward (just redeploy the jar...). I'm a bit new at this and apparently things were more complicated than I expected.

The war file deploys fine, however when I run the app and try to connect to the database, I get the following error:

INFO: Server startup in 863 ms
Other Exception
java.sql.SQLException: No suitable driver
Other Exception
class org.apache.tomcat.dbcp.dbcp.SQLNestedException
Other Exception
Cannot create JDBC driver of class '' for connect URL 'null'
java.lang.NullPointerException
at com.xwave.agentdt.database.DatabaseManager.select(DatabaseManager.jav
a:92)
at com.xwave.agentdt.beans.Offering.retrieveOfferingByProvince(Offering.
java:143)

Again, an error I've seen here before.



I've checked my web.xml file and it looks fine (this app uses two seperate schemas):





agentdt.xml (conf/Catalina/localhost) looks fine too:




classes12.jar is in the apache-tomcat-6.0.35/lib folder.


The code:




Any suggestions of some things I could try? Permissions should be fine too...
 
Bartender
Posts: 1952
7
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmmm, you may want to take a look at this page, especially since you're migrating from Tomcat 5.0.x to Tomcat 6.
I've glossed over your configuraion and it seems to be in order, except for the FQN of the thin driver, which for a recent version should be oracle.jdbc.OracleDriver instead of oracle.jdbc.driver.OracleDriver.
That could explain the error message. Altough, unless you've also upgraded the JDBC driver when moving to Tomcat 6, I can't really explain why that would suddenly fail.
 
Saloon Keeper
Posts: 28661
211
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Those Resource definitions are off. I don't recall using ResourceParams for Datasource definitions, since the datasource parameters are normally attributes of the Resource element itself. Or if I ever did, it was long ago and far away.
 
Gregory Grondin
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Some good places to start at least. I've inherited this guy, so I can't be sure of the hows and whys. Will be trying your suggestions over the next couple of days and I'll update if it I hit any success or if it continues to fail out.

Appreciate the help!
 
Gregory Grondin
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I updated the resource definitions and updated the referenced driver to oracle.jdbc.OracleDriver. Have yet to find anything else out of place looking at the migration guide and how-to.

Everything else so far looks to be in order. No luck yet.
 
Tim Holloway
Saloon Keeper
Posts: 28661
211
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm trying to read more carefully, but it's always a struggle for me.

I noticed a mention of classes12.jar. You should probably replace it with a newer Oracle driver if for no other reason than because Oracle may not be supporting it anymore.

The "Cannot create JDBC driver of class '' for connect URL 'null' " message is pretty much invariably a "you goofed up the connection parameters in the resource definition" error, but unfortunately, it doesn't give you much guidance. I got so fed up with the utter uselessness of that message that I actually dug into the source code and discovered to my despair that the reason it can't report anything better is because at the level where the message comes from, there's nothing better to report.

Check the driverClassName and URL parameters very, very carefully, since it's probably one of them. Pay special attention to upper/lower case. And good luck - you'll need it!
 
Gregory Grondin
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:I'm trying to read more carefully, but it's always a struggle for me.

I noticed a mention of classes12.jar. You should probably replace it with a newer Oracle driver if for no other reason than because Oracle may not be supporting it anymore.

The "Cannot create JDBC driver of class '' for connect URL 'null' " message is pretty much invariably a "you goofed up the connection parameters in the resource definition" error, but unfortunately, it doesn't give you much guidance. I got so fed up with the utter uselessness of that message that I actually dug into the source code and discovered to my despair that the reason it can't report anything better is because at the level where the message comes from, there's nothing better to report.

Check the driverClassName and URL parameters very, very carefully, since it's probably one of them. Pay special attention to upper/lower case. And good luck - you'll need it!



Thanks!

What's frustrating is the knowledge that this thing worked fine under the previous version - so it's likely some difference in the configuration requirements between the two. I'll take a closer look though. I wouldn't expect the URL parms to be incorrect as they were the ones used in the working 5.xx version we had -- but that's not to say it isn't the problem.
 
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I am experiencing the same exact problem for hours and hours and can't get anywhere. Was there any resolution to this? Thank you very much for any help.

Thinking it might be some Tomcat version thing, I began reviewing the folders and noticed on the older "working" Tomcat that there is no "default" context.xml in the CATALINA_HOME/conf directory...just the webappname.xml in the conf/catalina/localhost directory.

So I renamed context.xml in the newer Tomcat to context2.xml just in case it might be interfering with conf/catalina/localhost/webappname.xml but no dice, the same error as above.

It does seem like it is some sort of implementation thing. I checked and rechecked the url and datasource in webappname.xml.

I'm going bonkers over this.

Thank you.
 
Tim Holloway
Saloon Keeper
Posts: 28661
211
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You really should have started a new thread, here. Aside from the zombie issues, if you started out with the same problem, once you started mucking around with context files, it escalated to something else.
 
reply
    Bookmark Topic Watch Topic
  • New Topic