aspose file tools*
The moose likes Tomcat and the fly likes Moving an app to a different server, getting No suitable driver / Cannot create JDBC driver of class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Moving an app to a different server, getting No suitable driver / Cannot create JDBC driver of class" Watch "Moving an app to a different server, getting No suitable driver / Cannot create JDBC driver of class" New topic
Author

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

Gregory Grondin
Greenhorn

Joined: Jun 11, 2012
Posts: 5
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...
Jelle Klap
Bartender

Joined: Mar 10, 2008
Posts: 1771
    
    7

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.


Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16141
    
  21

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.

Customer surveys are for companies who didn't pay proper attention to begin with.
Gregory Grondin
Greenhorn

Joined: Jun 11, 2012
Posts: 5
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

Joined: Jun 11, 2012
Posts: 5
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

Joined: Jun 25, 2001
Posts: 16141
    
  21

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

Joined: Jun 11, 2012
Posts: 5
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.
Tom Griffith
Ranch Hand

Joined: Aug 06, 2004
Posts: 272
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

Joined: Jun 25, 2001
Posts: 16141
    
  21

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Moving an app to a different server, getting No suitable driver / Cannot create JDBC driver of class