1 Reply Latest reply on Feb 1, 2012 7:31 AM by Peter Brewer

    Using 7.1CR1b with JTS throws exception

    Peter Brewer Novice

      Server environment is JBoss AS 7.1CR1b (flux capacitor) on windows 7 64-bit.

       

      I'm have an application (deployed as a war file) that works without warnings or exceptions using the standalone.xml configuration without an issue. However, when switching to use the JTS configuration (using standalone-jts.xml supplied in the docs directory)  the application logs an exception at the warning level after committing the transaction.

       

      To test this issue I've simplified the database operation to a stateless session bean that performs an insert, but after the call returns, an exception is logged and the insert still commits.

       

      Has anyone got any hints or suggestions as to what the exception means and how to avoid it? I've included the session bean, log extract and persistence.xml below.

       

      Thanks In Advance, Pete.

       

      TestInsertBean.java

      @Stateless
      public class TestInsertBean implements TestInsertLocal {
        
        @PersistenceContext(unitName="test-insert-unit")
        private EntityManager em ;
        
        @Override
        @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
        public void insert() {
          MySimpleEntity mse = new MySimpleEntity() ;
          mse.setMyString("Insert me please") ;
          
          em.persist(mse) ;
          em.flush() ;
          System.out.println("Test Insert complete.") ;
        }  
      }
      

       

      server.log extract

      09:57:42,822 INFO  [stdout] (MSC service thread 1-12) Test Insert complete.
      09:57:42,999 WARN  [com.arjuna.ats.jts] (RequestProcessor-4) ARJUNA022037: ServerTopLevelAction.registerResource caught exception: org.omg.CosTransactions.Inactive: IDL:omg.org/CosTransactions/Inactive:1.0
           at org.omg.CosTransactions.InactiveHelper.read(InactiveHelper.java:42) [jbossjts-4.16.0.Final.jar:]
           at org.omg.CosTransactions._CoordinatorStub.register_resource(_CoordinatorStub.java:1130) [jbossjts-4.16.0.Final.jar:]
           at com.arjuna.ats.internal.jts.orbspecific.interposition.resources.arjuna.ServerTopLevelAction.registerResource(ServerTopLevelAction.java:601) [jbossjts-4.16.0.Final.jar:]
           at com.arjuna.ats.internal.jts.orbspecific.interposition.resources.arjuna.ServerTopLevelAction.(ServerTopLevelAction.java:120) [jbossjts-4.16.0.Final.jar:]
           at com.arjuna.ats.internal.jts.interposition.resources.arjuna.Interposition.createHierarchy(Interposition.java:178) [jbossjts-4.16.0.Final.jar:]
           at com.arjuna.ats.internal.jts.interposition.resources.arjuna.Interposition.setupHierarchy(Interposition.java:109) [jbossjts-4.16.0.Final.jar:]
           at com.arjuna.ats.internal.jts.interposition.resources.arjuna.Interposition.create(Interposition.java:68) [jbossjts-4.16.0.Final.jar:]
           at com.arjuna.ats.internal.jts.interposition.resources.arjuna.InterpositionCreator.recreateLocal(InterpositionCreator.java:48) [jbossjts-4.16.0.Final.jar:]
           at com.arjuna.ats.internal.jts.interposition.FactoryElement.recreateLocal(FactoryList.java:66) [jbossjts-4.16.0.Final.jar:]
           at com.arjuna.ats.internal.jts.interposition.FactoryList.recreateLocal(FactoryList.java:113) [jbossjts-4.16.0.Final.jar:]
           at com.arjuna.ats.internal.jts.orbspecific.TransactionFactoryImple.recreateLocal(TransactionFactoryImple.java:222) [jbossjts-4.16.0.Final.jar:]
           at com.arjuna.ats.internal.jts.context.ContextManager.createHierarchy(ContextManager.java:702) [jbossjts-4.16.0.Final.jar:]
           at com.arjuna.ats.internal.jts.context.ContextManager.currentPIContext(ContextManager.java:609) [jbossjts-4.16.0.Final.jar:]
           at com.arjuna.ats.internal.jts.context.ContextManager.current(ContextManager.java:169) [jbossjts-4.16.0.Final.jar:]
           at com.arjuna.ats.internal.jts.context.ContextManager.associate(ContextManager.java:310) [jbossjts-4.16.0.Final.jar:]
           at com.arjuna.ats.internal.jts.OTSImpleManager.current(OTSImpleManager.java:79) [jbossjts-4.16.0.Final.jar:]
           at com.arjuna.ats.internal.jta.transaction.jts.TransactionImple.getTransaction(TransactionImple.java:1129) [jbossjts-4.16.0.Final.jar:]
           at com.arjuna.ats.internal.jta.transaction.jts.BaseTransaction.getStatus(BaseTransaction.java:194) [jbossjts-4.16.0.Final.jar:]
           at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.getStatus(BaseTransactionManagerDelegate.java:85) [jbossjts-integration-4.16.0.Final.jar:]
           at org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.getStatus(JtaStatusHelper.java:73)
           at org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.isActive(JtaStatusHelper.java:115)
           at org.hibernate.engine.transaction.internal.jta.CMTTransaction.isActive(CMTTransaction.java:115)
           at org.hibernate.engine.transaction.internal.TransactionCoordinatorImpl.isTransactionInProgress(TransactionCoordinatorImpl.java:160)
           at org.hibernate.internal.SessionImpl.isTransactionInProgress(SessionImpl.java:460)
           at org.hibernate.ejb.AbstractEntityManagerImpl.isTransactionInProgress(AbstractEntityManagerImpl.java:1120)
           at org.hibernate.ejb.EntityManagerImpl.close(EntityManagerImpl.java:133)
           at org.jboss.as.jpa.transaction.TransactionUtil$SessionSynchronization.afterCompletion(TransactionUtil.java:218)
           at com.arjuna.ats.internal.jta.resources.jts.orbspecific.SynchronizationImple.after_completion(SynchronizationImple.java:139) [jbossjts-4.16.0.Final.jar:]
           at com.arjuna.ArjunaOTS.ManagedSynchronizationPOATie.after_completion(ManagedSynchronizationPOATie.java:58) [jbossjts-4.16.0.Final.jar:]
           at com.arjuna.ArjunaOTS.ManagedSynchronizationPOA._invoke(ManagedSynchronizationPOA.java:53) [jbossjts-4.16.0.Final.jar:]
           at org.jacorb.poa.RequestProcessor.invokeOperation(RequestProcessor.java:306)
           at org.jacorb.poa.RequestProcessor.process(RequestProcessor.java:614)
           at org.jacorb.poa.RequestProcessor.run(RequestProcessor.java:757)
      09:57:43,001 WARN  [com.arjuna.ats.jts] (RequestProcessor-4) ARJUNA022039: ServerTopLevelAction - could not register interposed hierarchy!
      09:57:43,001 WARN  [com.arjuna.ats.jts] (RequestProcessor-4) ARJUNA022008: ContextManager.createHierarchy caught exception: org.omg.CORBA.TRANSACTION_ROLLEDBACK
           at com.arjuna.ats.internal.jts.interposition.resources.arjuna.Interposition.createHierarchy(Interposition.java:190) [jbossjts-4.16.0.Final.jar:]
           at com.arjuna.ats.internal.jts.interposition.resources.arjuna.Interposition.setupHierarchy(Interposition.java:109) [jbossjts-4.16.0.Final.jar:]
           at com.arjuna.ats.internal.jts.interposition.resources.arjuna.Interposition.create(Interposition.java:68) [jbossjts-4.16.0.Final.jar:]
           at com.arjuna.ats.internal.jts.interposition.resources.arjuna.InterpositionCreator.recreateLocal(InterpositionCreator.java:48) [jbossjts-4.16.0.Final.jar:]
           at com.arjuna.ats.internal.jts.interposition.FactoryElement.recreateLocal(FactoryList.java:66) [jbossjts-4.16.0.Final.jar:]
           at com.arjuna.ats.internal.jts.interposition.FactoryList.recreateLocal(FactoryList.java:113) [jbossjts-4.16.0.Final.jar:]
           at com.arjuna.ats.internal.jts.orbspecific.TransactionFactoryImple.recreateLocal(TransactionFactoryImple.java:222) [jbossjts-4.16.0.Final.jar:]
           at com.arjuna.ats.internal.jts.context.ContextManager.createHierarchy(ContextManager.java:702) [jbossjts-4.16.0.Final.jar:]
           at com.arjuna.ats.internal.jts.context.ContextManager.currentPIContext(ContextManager.java:609) [jbossjts-4.16.0.Final.jar:]
           at com.arjuna.ats.internal.jts.context.ContextManager.current(ContextManager.java:169) [jbossjts-4.16.0.Final.jar:]
           at com.arjuna.ats.internal.jts.context.ContextManager.associate(ContextManager.java:310) [jbossjts-4.16.0.Final.jar:]
           at com.arjuna.ats.internal.jts.OTSImpleManager.current(OTSImpleManager.java:79) [jbossjts-4.16.0.Final.jar:]
           at com.arjuna.ats.internal.jta.transaction.jts.TransactionImple.getTransaction(TransactionImple.java:1129) [jbossjts-4.16.0.Final.jar:]
           at com.arjuna.ats.internal.jta.transaction.jts.BaseTransaction.getStatus(BaseTransaction.java:194) [jbossjts-4.16.0.Final.jar:]
           at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.getStatus(BaseTransactionManagerDelegate.java:85) [jbossjts-integration-4.16.0.Final.jar:]
           at org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.getStatus(JtaStatusHelper.java:73)
           at org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.isActive(JtaStatusHelper.java:115)
           at org.hibernate.engine.transaction.internal.jta.CMTTransaction.isActive(CMTTransaction.java:115)
           at org.hibernate.engine.transaction.internal.TransactionCoordinatorImpl.isTransactionInProgress(TransactionCoordinatorImpl.java:160)
           at org.hibernate.internal.SessionImpl.isTransactionInProgress(SessionImpl.java:460)
           at org.hibernate.ejb.AbstractEntityManagerImpl.isTransactionInProgress(AbstractEntityManagerImpl.java:1120)
           at org.hibernate.ejb.EntityManagerImpl.close(EntityManagerImpl.java:133)
           at org.jboss.as.jpa.transaction.TransactionUtil$SessionSynchronization.afterCompletion(TransactionUtil.java:218)
           at com.arjuna.ats.internal.jta.resources.jts.orbspecific.SynchronizationImple.after_completion(SynchronizationImple.java:139) [jbossjts-4.16.0.Final.jar:]
           at com.arjuna.ArjunaOTS.ManagedSynchronizationPOATie.after_completion(ManagedSynchronizationPOATie.java:58) [jbossjts-4.16.0.Final.jar:]
           at com.arjuna.ArjunaOTS.ManagedSynchronizationPOA._invoke(ManagedSynchronizationPOA.java:53) [jbossjts-4.16.0.Final.jar:]
           at org.jacorb.poa.RequestProcessor.invokeOperation(RequestProcessor.java:306)
           at org.jacorb.poa.RequestProcessor.process(RequestProcessor.java:614)
           at org.jacorb.poa.RequestProcessor.run(RequestProcessor.java:757)
      09:57:43,003 ERROR [stderr] (RequestProcessor-4) org.omg.CORBA.TRANSACTION_ROLLEDBACK
      09:57:43,003 ERROR [stderr] (RequestProcessor-4)      at com.arjuna.ats.internal.jts.interposition.resources.arjuna.Interposition.createHierarchy(Interposition.java:190)
      09:57:43,003 ERROR [stderr] (RequestProcessor-4)      at com.arjuna.ats.internal.jts.interposition.resources.arjuna.Interposition.setupHierarchy(Interposition.java:109)
      09:57:43,004 ERROR [stderr] (RequestProcessor-4)      at com.arjuna.ats.internal.jts.interposition.resources.arjuna.Interposition.create(Interposition.java:68)
      09:57:43,004 ERROR [stderr] (RequestProcessor-4)      at com.arjuna.ats.internal.jts.interposition.resources.arjuna.InterpositionCreator.recreateLocal(InterpositionCreator.java:48)
      09:57:43,004 ERROR [stderr] (RequestProcessor-4)      at com.arjuna.ats.internal.jts.interposition.FactoryElement.recreateLocal(FactoryList.java:66)
      09:57:43,004 ERROR [stderr] (RequestProcessor-4)      at com.arjuna.ats.internal.jts.interposition.FactoryList.recreateLocal(FactoryList.java:113)
      09:57:43,004 ERROR [stderr] (RequestProcessor-4)      at com.arjuna.ats.internal.jts.orbspecific.TransactionFactoryImple.recreateLocal(TransactionFactoryImple.java:222)
      09:57:43,004 ERROR [stderr] (RequestProcessor-4)      at com.arjuna.ats.internal.jts.context.ContextManager.createHierarchy(ContextManager.java:702)
      09:57:43,004 ERROR [stderr] (RequestProcessor-4)      at com.arjuna.ats.internal.jts.context.ContextManager.currentPIContext(ContextManager.java:609)
      09:57:43,005 ERROR [stderr] (RequestProcessor-4)      at com.arjuna.ats.internal.jts.context.ContextManager.current(ContextManager.java:169)
      09:57:43,005 ERROR [stderr] (RequestProcessor-4)      at com.arjuna.ats.internal.jts.context.ContextManager.associate(ContextManager.java:310)
      09:57:43,005 ERROR [stderr] (RequestProcessor-4)      at com.arjuna.ats.internal.jts.OTSImpleManager.current(OTSImpleManager.java:79)
      09:57:43,005 ERROR [stderr] (RequestProcessor-4)      at com.arjuna.ats.internal.jta.transaction.jts.TransactionImple.getTransaction(TransactionImple.java:1129)
      09:57:43,005 ERROR [stderr] (RequestProcessor-4)      at com.arjuna.ats.internal.jta.transaction.jts.BaseTransaction.getStatus(BaseTransaction.java:194)
      09:57:43,005 ERROR [stderr] (RequestProcessor-4)      at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.getStatus(BaseTransactionManagerDelegate.java:85)
      09:57:43,006 ERROR [stderr] (RequestProcessor-4)      at org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.getStatus(JtaStatusHelper.java:73)
      09:57:43,006 ERROR [stderr] (RequestProcessor-4)      at org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.isActive(JtaStatusHelper.java:115)
      09:57:43,006 ERROR [stderr] (RequestProcessor-4)      at org.hibernate.engine.transaction.internal.jta.CMTTransaction.isActive(CMTTransaction.java:115)
      09:57:43,006 ERROR [stderr] (RequestProcessor-4)      at org.hibernate.engine.transaction.internal.TransactionCoordinatorImpl.isTransactionInProgress(TransactionCoordinatorImpl.java:160)
      09:57:43,006 ERROR [stderr] (RequestProcessor-4)      at org.hibernate.internal.SessionImpl.isTransactionInProgress(SessionImpl.java:460)
      09:57:43,006 ERROR [stderr] (RequestProcessor-4)      at org.hibernate.ejb.AbstractEntityManagerImpl.isTransactionInProgress(AbstractEntityManagerImpl.java:1120)
      09:57:43,006 ERROR [stderr] (RequestProcessor-4)      at org.hibernate.ejb.EntityManagerImpl.close(EntityManagerImpl.java:133)
      09:57:43,007 ERROR [stderr] (RequestProcessor-4)      at org.jboss.as.jpa.transaction.TransactionUtil$SessionSynchronization.afterCompletion(TransactionUtil.java:218)
      09:57:43,007 ERROR [stderr] (RequestProcessor-4)      at com.arjuna.ats.internal.jta.resources.jts.orbspecific.SynchronizationImple.after_completion(SynchronizationImple.java:139)
      09:57:43,007 ERROR [stderr] (RequestProcessor-4)      at com.arjuna.ArjunaOTS.ManagedSynchronizationPOATie.after_completion(ManagedSynchronizationPOATie.java:58)
      09:57:43,007 ERROR [stderr] (RequestProcessor-4)      at com.arjuna.ArjunaOTS.ManagedSynchronizationPOA._invoke(ManagedSynchronizationPOA.java:53)
      09:57:43,007 ERROR [stderr] (RequestProcessor-4)      at org.jacorb.poa.RequestProcessor.invokeOperation(RequestProcessor.java:306)
      09:57:43,007 ERROR [stderr] (RequestProcessor-4)      at org.jacorb.poa.RequestProcessor.process(RequestProcessor.java:614)
      09:57:43,008 ERROR [stderr] (RequestProcessor-4)      at org.jacorb.poa.RequestProcessor.run(RequestProcessor.java:757)
      

       

      persistence.xml


      <?xml version="1.0" encoding="UTF-8"?>
      <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
          <persistence-unit name="test-insert-unit">
            <provider>org.hibernate.ejb.HibernatePersistence</provider>
            <jta-data-source>java:jboss/datasources/MyTestDS</jta-data-source>
            <mapping-file>META-INF/orm.xml</mapping-file>
         
            <exclude-unlisted-classes>false</exclude-unlisted-classes>
          
            <properties>
               <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
                 <property name="hibernate.hbm2ddl.auto" value="update"/>
                 <property name="hibernate.show_sql" value="true"/>
                 <property name="hibernate.format_sql" value="true"/>   
                 <property name="hibernate.jdbc.batch_size" value="20"/>
                 <property name="hibernate.default_catalog" value="my_test"/>
               <property name="hibernate.listeners.envers.autoRegister" value="false"/>
            </properties>
      
          </persistence-unit>
      </persistence>