1 2 3 Previous Next 39 Replies Latest reply on Jan 24, 2013 9:11 AM by Haifeng Song Go to original post
      • 30. Re: Jboss7.1 arjuna configuration
        Alexey S. Newbie

        I tried to do what you actually say, and configured the XA-Datasource in standalone.xml

        However I got the same error as before.

         

        My configuration is

        <xa-datasource jndi-name="java:jboss/datasources/xyz" pool-name="xyz" enabled="true" use-java-context="true">

                            <xa-datasource-property name="ServerName">

                                localhost

                            </xa-datasource-property>

                            <xa-datasource-property name="DatabaseName">

                                xyz

                            </xa-datasource-property>

                            <xa-datasource-property name="User">

                                xyz

                            </xa-datasource-property>

                            <xa-datasource-property name="Password">

                                xyz

                            </xa-datasource-property>

                            <driver>com.mysql</driver>

                        </xa-datasource>

         

         

        However when I tried to deploy my EAR

        I got

        17:45:27,179 WARN  [org.jboss.modules] (MSC service thread 1-11) Failed to define class com.mysql.jdbc.jdbc2.optional.MysqlXAConnection in Module "com.mysql:main" from local module loader @3c572554 (roots: C:\Jboss\jboss-as-7.1.1.Final\modules): java.lang.LinkageError: Failed to link com/mysql/jdbc/jdbc2/optional/MysqlXAConnection (Module "com.mysql:main" from local module loader @3c572554 (roots: C:\Jboss\jboss-as-7.1.1.Final\modules))

                  at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:396)

                  at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:243)

                  at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73)

                  at org.jboss.modules.Module.loadModuleClass(Module.java:517)

                  at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:182)

                  at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

                  at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

                  at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

                  at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

                  at com.mysql.jdbc.jdbc2.optional.MysqlXADataSource.wrapConnection(MysqlXADataSource.java:73) [mysql-connector-java-5.1.6.jar:]

                  at com.mysql.jdbc.jdbc2.optional.MysqlXADataSource.getXAConnection(MysqlXADataSource.java:49) [mysql-connector-java-5.1.6.jar:]

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

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

                  at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.createConnectionEventListener(SemaphoreArrayListManagedConnectionPool.java:761)

                  at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.getConnection(SemaphoreArrayListManagedConnectionPool.java:343)

                  at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getSimpleConnection(AbstractPool.java:397)

                  at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getConnection(AbstractPool.java:365)

                  at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.getManagedConnection(AbstractConnectionManager.java:329)

                  at org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.getManagedConnection(TxConnectionManagerImpl.java:368)

                  at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:464)

                  at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:129)

                  at org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider.getConnection(InjectedDataSourceConnectionProvider.java:67) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]

                  at org.hibernate.engine.jdbc.internal.JdbcServicesImpl$ConnectionProviderJdbcConnectionAccess.obtainConnection(JdbcServicesImpl.java:253) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

                  at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:119) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

                  at org.hibernate.service.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:75) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

                  at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:159) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

                  at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:131) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

                  at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:71) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

                  at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2270) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

                  at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2266) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

                  at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1735) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

                  at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:84) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]

                  at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:904) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]

                  at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:889) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]

                  at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:73) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]

                  at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:162) [jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final]

                  at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.start(PersistenceUnitServiceImpl.java:85) [jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final]

                  at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)

                  at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)

                  at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_03]

                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_03]

                  at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_03]

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

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

                  at java.lang.ClassLoader.defineClass(Unknown Source) [rt.jar:1.7.0_03]

                  at java.security.SecureClassLoader.defineClass(Unknown Source) [rt.jar:1.7.0_03]

                  at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:327)

                  at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:391)

                  ... 41 more

        Caused by: java.lang.ClassNotFoundException: javax.transaction.xa.XAResource from [Module "com.mysql:main" from local module loader @3c572554 (roots: C:\Jboss\jboss-as-7.1.1.Final\modules)]

                  at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)

                  at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

                  at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

                  at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

                  at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

                  ... 46 more

        I actually wrote about that, I added the mysqlconnector (from jboss modules) to my EAR file as well as jboss-transaction-api_1.1_spec-1.0.0.Final.jar.

        • 31. Re: Jboss7.1 arjuna configuration
          Alexey S. Newbie

          ok, the previous error solved by adding a dependency to modules.xml of mysql module.

          We are starting to digg the XA-datasource, thanks for your help, let see if this works

          • 32. Re: Jboss7.1 arjuna configuration
            Diogo Carleto Newbie

            For me the configuration suggest for Michael Musgrove works fine.

             

            Add the configuration in your standalone.xml and try again.

             

            <system-properties>

                <property name="com.arjuna.ats.arjuna.allowMultipleLastResources" value="true"/>

            </system-properties>

            • 33. Re: Jboss7.1 arjuna configuration
              Sans Kum Newbie

              I am using JBoss 7.1.1.Final and It hasn't been fixed yet. but, System Properties flag does the magic. It worked. Thanks a lot....

               

               

              <server xmlns="urn:jboss:domain:1.2">
              
                  <extensions>
                      .........
                  </extensions>
              
                  <system-properties>
                      <property name="com.arjuna.ats.arjuna.allowMultipleLastResources" value="true"/>
                  </system-properties>
              
                  <management>
                      ........
                  </management>
              
                  ........
                  ........
              </server>
              
              • 34. Re: Jboss7.1 arjuna configuration
                Haifeng Song Newbie

                Hi Alexey,

                 

                Could you tell what dependency to add?

                I have exactly the same problem with you.

                I only have dependency :

                  <dependencies>
                    <module name="javax.api"/>
                  </dependencies>

                • 35. Re: Jboss7.1 arjuna configuration
                  Tom Jenkinson Master

                  Were you intendeding to enlist mutliple last resources?

                  • 36. Re: Jboss7.1 arjuna configuration
                    Tom Jenkinson Master

                    Same question to Haifeng: "were you intending to enlist multiple last resources?"

                    • 37. Re: Jboss7.1 arjuna configuration
                      Haifeng Song Newbie

                      I'm not configuring arjuna. I just ask about the jdbc connector configuration problem.

                      As Alexey said "solved by adding a dependency to modules.xml of mysql module"

                      • 38. Re: Jboss7.1 arjuna configuration
                        Alexey S. Newbie

                        That what I did in modules.xml

                         

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

                        <module xmlns="urn:jboss:module:1.0" name="com.mysql.jdbc">

                          <resources>

                            <resource-root path="mysql-connector-java-5.1.15.jar"/>

                                <!-- Insert resources here -->

                          </resources>

                          <dependencies>

                            <module name="javax.api"/>

                            <module name="javax.transaction.api"/>

                          </dependencies>

                        </module>

                         

                        Please mention that your datasources should be XA datasources

                        • 39. Re: Jboss7.1 arjuna configuration
                          Haifeng Song Newbie

                          Thanks, Alexey. It works.

                          1 2 3 Previous Next