1 Reply Latest reply on Jan 24, 2013 9:41 AM by hypheng

    Mysql JDBC module can't start: ClassNotFoundException XAResource

    hypheng

      I got a problem when deploying Mysql JDBC module on jboss-as-7.2.0.Alpha1-SNAPSHOT (on rhel 6.3)

      I was deploying just according to the document at https://community.jboss.org/wiki/DataSourceConfigurationInAS7

      Error message is:

      00:00:15,513 WARN  [org.jboss.modules] (JCA PoolFiller) Failed to define class com.mysql.jdbc.jdbc2.optional.MysqlXAConnection in Module "com.mysql:main" from local module loader @68e2918b (roots: /home/bruce/jboss-as-7.2.0.Alpha1-SNAPSHOT/modules): java.lang.LinkageError: Failed to link com/mysql/jdbc/jdbc2/optional/MysqlXAConnection (Module "com.mysql:main" from local module loader @68e2918b (roots: /home/bruce/jboss-as-7.2.0.Alpha1-SNAPSHOT/modules))

              at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:396) [jboss-modules.jar:1.1.3.GA]

              at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:243) [jboss-modules.jar:1.1.3.GA]

              at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73) [jboss-modules.jar:1.1.3.GA]

              at org.jboss.modules.Module.loadModuleClass(Module.java:527) [jboss-modules.jar:1.1.3.GA]

              at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:182) [jboss-modules.jar:1.1.3.GA]

              at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.3.GA]

              at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.3.GA]

              at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.1.3.GA]

              at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.1.3.GA]

              at com.mysql.jdbc.jdbc2.optional.MysqlXADataSource.wrapConnection(MysqlXADataSource.java:74)

              at com.mysql.jdbc.jdbc2.optional.MysqlXADataSource.getXAConnection(MysqlXADataSource.java:61)

              at org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory.getXAManagedConnection(XAManagedConnectionFactory.java:441)

              at org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory.createManagedConnection(XAManagedConnectionFactory.java:395)

              at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.createConnectionEventListener(SemaphoreArrayListManagedConnectionPool.java:775) [ironjacamar-core-impl-1.0.14.Final.jar:1.0.14.Final]

              at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.fillToMin(SemaphoreArrayListManagedConnectionPool.java:720) [ironjacamar-core-impl-1.0.14.Final.jar:1.0.14.Final]

              at org.jboss.jca.core.connectionmanager.pool.mcp.PoolFiller.run(PoolFiller.java:97) [ironjacamar-core-impl-1.0.14.Final.jar:1.0.14.Final]

              at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_09-icedtea]

      Caused by: java.lang.NoClassDefFoundError: javax/transaction/xa/XAResource

              at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.7.0_09-icedtea]

              at java.lang.ClassLoader.defineClass(ClassLoader.java:791) [rt.jar:1.7.0_09-icedtea]

              at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) [rt.jar:1.7.0_09-icedtea]

              at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:327) [jboss-modules.jar:1.1.3.GA]

              at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:391) [jboss-modules.jar:1.1.3.GA]

              ... 16 more

      Caused by: java.lang.ClassNotFoundException: javax.transaction.xa.XAResource from [Module "com.mysql:main" from local module loader @68e2918b (roots: /home/bruce/jboss-as-7.2.0.Alpha1-SNAPSHOT/modules)]

              at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.1.3.GA]

              at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.3.GA]

              at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.3.GA]

              at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.1.3.GA]

              at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.1.3.GA]

              ... 21 more

       

      BTW, previously on as 7.1.2 I deploy jdbc under standalone/deployments, but when I switch to as 7.2, it can't work.

      So I deploy it as a module now.