4 Replies Latest reply on Jul 6, 2009 11:09 AM by peterj

    mysql connection from jboss 5.1 on a mac

      Hi, I have spent this lovely sunday trying to connect to a mysql DB on my mac. I have taken a server configuration I have been using on my Linux machine and a Linux VM on this mac with success. I installed mysql on this mac because I'm going on holiday want to work on my mac "natively" so to speak without the VM. Unfortunately the very same configuration that works on my Linux machines fails on my mac with:

      Caused by: org.jboss.resource.JBossResourceException: Failed to register driver for: org.mysql.jdbc.Driver; - nested throwable: (java.lang.ClassNotFoundException: org.mysql.jdbc.Driver from BaseClassLoader@e83135{

      I assume this is the cause, however I have no explanation why it should really be a classloading issue. The mysql-connector-java-5.1.7-bin.jar is in the $JBOSS_HOME/server/default/lib. I have also tried packaging it with the application I'm trying to deploy, no change. I also know the DB is working, I can connect using the command line, the mysql GUI adminstration tool as well as connect using the exact driver above from a simple java main program I have written. Any ideas why jboss would fail would be greatly appreciated!

      Best Regards,

      André

        • 1. Re: mysql connection from jboss 5.1 on a mac
          peterj

          org.mysql.jdbc.Driver should be com.mysql.jdbc.Driver

          • 2. Re: mysql connection from jboss 5.1 on a mac

            Yep so it should be and then it works, I'm so baffled, I can't think right now. I should have seen this... But why does the very same org.mysql.jdbc.Driver work on my Linux machine?

            Best Regards,

            Andre

            • 3. Re: mysql connection from jboss 5.1 on a mac

              Just to clarify, I checked my Linux System and the datasource works fine with the org.mysql.jdbc.Driver. So I meant the previous question serious :-). Also because I don't see why the classpath should be different on the Linux machine as the jboss installation is exactly the same as I have stored it centrally in my svn.

              Best Regards,

              Andre

              • 4. Re: mysql connection from jboss 5.1 on a mac
                peterj

                Check the MySQL JDBC JAR file and look at the full package names of the drivers, maybe there is an extra one. Where did you get this JAR file? My driver comes from the Maven repository, it's been years since I obtained the driver from the MySQL web site.

                Currently, com.mysql.jdbc.Driver class is the recommended driver, but org.gjt.mm.mysql.Driver is still retained for backwards compatibility.