2 Replies Latest reply on Mar 3, 2002 7:31 AM by thohawk

    MySQL and Jboss-3: ClassNotFoundException

    thohawk

      Hi

      Been trying everything now, but still, JBoss 3 beta (from cvs) cannot seem to find my mysql.jar. I've put it into \lib - and from the log i can see that Jboss successfully deploys it at startup...the error is;

      23:08:12,624 ERROR [JDBCManagedConnectionFactory] Unable to load JDBC driver 'or
      g.gjt.mm.mysql.Driver '
      java.lang.ClassNotFoundException: org/gjt/mm/mysql/Driver
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:120)
      at org.jboss.resource.adapter.jdbc.local.JDBCManagedConnectionFactory.se
      tDriverClass(JDBCManagedConnectionFactory.java:134)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.resource.ConnectionFactoryLoader.loadConnectionFactory(Conn
      ectionFactoryLoader.java:643)
      at org.jboss.resource.ConnectionFactoryLoader.startService(ConnectionFac
      toryLoader.java:433)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:1
      62)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:16
      28)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
      23)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
      ler.java:779)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:343)
      at org.jboss.system.ServiceController.start(ServiceController.java:360)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:16
      28)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
      23)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:78)
      at $Proxy2.start(Unknown Source)
      at org.jboss.resource.RARDeployer.start(RARDeployer.java:213)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:649)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:526)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:506)
      at org.jboss.deployment.MainDeployer.scan(MainDeployer.java:327)
      at org.jboss.deployment.MainDeployer.startService(MainDeployer.java:254)

      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:1
      62)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:16
      28)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
      23)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
      ler.java:779)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:343)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:16
      28)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
      23)
      at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:331)
      at org.jboss.system.server.ServerImpl.start(ServerImpl.java:211)
      at org.jboss.Main.boot(Main.java:127)
      at org.jboss.Main$1.run(Main.java:335)
      at java.lang.Thread.run(Thread.java:484)

      i've put this mysql-service.xml into \server\default\deploy ...;







      ConnectionURL=jdbc:mysql://localhost
      DriverClass=org.gjt.mm.mysql.Driver
      UserName=root
      StandardDS
      java:/TransactionManager
      <depends optional-attribute-name="ResourceAdapterName">jboss.jca:service=RARDeployment,name=Minerva JDBC LocalTransaction ResourceAdapter
      <depends optional-attribute-name="ConnectionManagerFactoryLoaderName">jboss.jca:service=ConnectionManagerFactoryLoader,name=MinervaSharedLocalCMFactory

      BlockingTimeoutMillis=500000
      IdleTimeoutMinutes=30
      MaxSize=10
      CleanupIntervalMinutes=10
      MinSize=0
      MaxIdleTimeoutPercent=1.0


      org.jboss.resource.security.ManyToOnePrincipalMapping

      UserName=root


      *ANY* help is greatly appreciated - i'm very stuck here, although it seems to be a "fundemental" class-path problem :-)

      Regards
      Jesper, Denmark

        • 1. Re: MySQL and Jboss-3: ClassNotFoundException
          ben.alex

          Hi Jesper

          I got mySql working with JBoss 3.0.0beta as follows:

          1. Download latest driver from http://sourceforge.net/projects/mmmysql, unjar and pop mm.mysql-2.0.11-bin.jar in /ext/lib.

          2. Add following mysql-service.xml to /deploy:

          <?xml version="1.0" encoding="UTF-8"?>

          <!-- ===================================================================== -->
          <!-- -->
          <!-- foo App DataSource -->
          <!-- -->
          <!-- ===================================================================== -->

          <!-- $Id: resource.xml,v 3.4 2001/12/01 02:17:42 d_jencks Exp $ -->






          ConnectionURL=jdbc:mysql://localhost/MysqlDatabaseName
          DriverClass=org.gjt.mm.mysql.Driver
          UserName=root
          MysqlDS
          <depends optional-attribute-name="ResourceAdapterName">jboss.jca:service=RARDeployment,name=Minerva JDBC LocalTransaction ResourceAdapter
          <depends optional-attribute-name="ConnectionManagerFactoryLoaderName">jboss.jca:service=ConnectionManagerFactoryLoader,name=MinervaSharedLocalCMFactory
          #
          #Wed Aug 15 16:17:29 EDT 2001
          BlockingTimeoutMillis=500000
          IdleTimeoutMinutes=30
          MaxSize=10
          CleanupIntervalMinutes=10
          MinSize=0
          MaxIdleTimeoutPercent=1.0


          org.jboss.resource.security.ManyToOnePrincipalMapping

          UserName=root




          Hope this helps.

          Ben

          • 2. Re: MySQL and Jboss-3: ClassNotFoundException
            thohawk

            Hi Ben

            Thanks a lot for your help!!! IT WORKS NOW :-)
            Haven't found the source for my problem, but maybe it has something to do with the codebase attribute...Actually i don't know if it works on JBoss beta, as i've checked out the beta2 from cvs. But on beta2 - it works ;-)

            Regards
            Jesper