Cannot load JDBC driver class 'null'
I'm going to post my newly-found solution to an often-seen error in hopes that it will help someone. In the struts-resume demo application that runs on this server, I've been getting the following error message everytime I startup the context.
java.sql.SQLException: Cannot load JDBC driver class 'null' at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:529) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:312)
In the past, this problem has been caused by not having the JDBC driver in my $CATALINA_HOME/common/lib directory, having an invalid username/password, or having another JNDI setting incorrect in server.xml. The strange thing about the problem this time was that everything was correct, and the app ran fine, save for the error (in the log file) on startup. Tonight I figured out the solution - I needed to grant permissions for the user with the specific hostname of the machine. I've been using the following SQL to grant permissions to the app's db user. This is the syntax for MySQL, it is probably different for other databases.
grant all privileges on resume.* to username@"%" identified by "password";
While this has worked on my WinXP machine, it failed on my RH9 box tonight. The solution turned out to be specifying the specific HOSTNAME (i.e. drevil.raibledesign.home), rather than "%".
grant all privileges on resume.* to username@HOSTNAME identified by "password";
Here Google, come and get it!