tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: Tomcat 5.5, getting exception while creating database driver instance
Date Fri, 03 Jul 2009 03:00:27 GMT
Hash: SHA1


On 6/24/2009 7:23 PM, Kyle Bahr wrote:
> The exact exception is java.lang.reflect.InvocationTargetException, but
> sadly I don't have a stack trace available.

Hmm... that's going to make it pretty hard to debug. Any error message
along with the InvocationTargetException itself?

This kind of thing usually happens because of some tiny misconfiguration
of a JNDI DataSource, but it looks like you are probably registering the
driver yourself. Can you give us a bit larger code sample?

If you are able to modify the code, you could just put a try/catch block
around the Class.forName(...).newInstance() line and print any
InvocationTargetExceptions thrown to stdout:

try { Class.forName(...).newInstance(); }
catch (InvocationTargetException ite) { ite.printStackTrace();
       throw ite; }

WTF JAR file placement, make sure that your Connector/J JAR file is in
common/lib and /nowhere else/: check your webapp. Check shared/lib.
Check server/lib. Check for multiple versions of the same driver (like
mysql-connector-3.1.4.jar AND mysql-connector-3.1.5.jar).

Also, Connector/J 3.x is super old. Any chance of upgrading? They're on
5.1 these days...

> I'm getting that except
> back as the web service faultstring and the stack trace isn't being
> logged to the catalina.log.  I've tried changing the to
> capture the error, but still nothing is getting logged.

If the error is happening on the server, then you'll have a hard time
getting a client to give you the full stack trace: you'll have to check
the server's logs.

> I don't know where to find the exact level of Tomcat.

Try this (output shown from my environment):

$ /usr/local/tomcat/bin/ version
Using CATALINA_BASE:   /usr/local/tomcat
Using CATALINA_HOME:   /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME:       /home/chris/.gentoo/java-config-2/current-user-vm
Server version: Apache Tomcat/5.5.26
Server built:   Jan 28 2008 01:35:23
Server number:
OS Name:        Linux
OS Version:     2.6.14-gentoo-r5
Architecture:   i386
JVM Version:    1.6.0_13-b03
JVM Vendor:     Sun Microsystems Inc.

- -chris
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message