users@glassfish.java.net

Mysql on GFv2 on linux -- can't load driver

From: Johnny Tolliver <jxt_at_ornl.gov>
Date: Mon, 24 Mar 2008 12:05:55 -0400 (EDT)

I have what is surely a simple problem. I've been developing a simple web
app with Netbeans on Glassfish on localhost. Now I need to move it to
the real host, a Linux machine.

I'm using MySQL and plain JDBC calls. On my development machine, I put the
mysql-connector-java-5.1.5-bin.jar in the Glassfish /lib directory and all
was well.

Unfortunately, when I put that same jar in the Glassfish /lib directory on
my real server machine and restart glassfish (with stop-domain,
start-domain) I keep getting ClassNotFoundExceptions for
com.mysql.jdbc.Driver. Here's the top of the stacktrace:

...java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
        at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1498)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:169)
        <at my code that calls Class.forName()>

What simple and dumb thing am I missing? Thanks.

Johnny S. Tolliver
Oak Ridge National Laboratory
tolliverjs_at_ornl.gov, 865-574-1305