2 Replies Latest reply on May 23, 2013 10:51 AM by Sean Murphy

    JBoss AS7 Datasource autoReconnect, failOverReadOnly, maxReconnects, initialTimeout

    Alfred Wong Newbie

      Hi, I want to upgrade my existing JBoss 4 to JBoss 7, the datasource structure had changed a lot and now datasources need to be define in the standalone*.xml configuration file.

       

      In my previous JBoss 4, for local-tx-datasource, i can used extra elements like:

      1) autoReconnect

      2) failOverReadOnly

      3)maxReconnects

      4)initialTimeout


      However in JBoss 7, those elements doesn't seems like supported anymore. I also found some people set those elements as "xa-datasource-property" through the used of xa-datasource, but I tried the same setting but hit exceptions like:

       

       

      14:36:33,163 WARN  org.jboss.jca.core.connectionmanager.pool.strategy.OnePool (MSC service thread 1-2) IJ000604: Throwable while attempting to get a new connection: null: javax.resource.ResourceException: Could not create connection

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

              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.(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(ThreadPoolExecutor.java:1110) https://community.jboss.org/docs/DOC-48601/rt.jar:1.7.0_09

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) https://community.jboss.org/docs/DOC-48601/rt.jar:1.7.0_09

              at java.lang.Thread.run(Thread.java:722) https://community.jboss.org/docs/DOC-48601/rt.jar:1.7.0_09

      Caused by: javax.resource.ResourceException: Could not find accessor on XADataSource:

              at org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory.getXADataSource(XAManagedConnectionFactory.java:629)

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

              ... 30 more

      Caused by: java.lang.NoSuchMethodException: oracle.jdbc.xa.client.OracleXADataSource.setMaxReconnects(java.lang.String)

              at java.lang.Class.getMethod(Class.java:1622) https://community.jboss.org/docs/DOC-48601/rt.jar:1.7.0_09

              at org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory.getXADataSource(XAManagedConnectionFactory.java:597)

              ... 31 more

       

       

       

      The exception I got is "NoSuchMethodExceptionNoSuchMethodException". I also did check the "jboss-as-datasources_1_0.xsd", but nothing seems related to those element. Can anybody tell me what is the replacement for them?