7 Replies Latest reply on Oct 8, 2012 10:56 AM by Joseph Fouts

    Error notifying listener org.jboss.jca.core.tx.jbossts.UserTransactionListener

    Joseph Fouts Novice

      Currently using JBoss-as7 Final 7.1.1

       

      I have a local session been that I have setup with a timer.

       

      The TimerHandler method defined in the session bean is

      calling another local session bean whos job is to write a

      JMS message to a message queue. 

       

      Because I want the have the write to the JMS message queue

      happen regardless if the the TimerHandler's session bean has

      a problem and does a rollback I added TransactionalManagement

      to the second session bean in order to do an explicit committ on

      the JMS message write.

       

      I have the following annotations defined in the JMS message write

      session bean.

       

      @TransactionManagement(javax.ejb.TransactionManagementType.BEAN)

       

      @Resource private javax.transaction.UserTransaction userTx;

       

      @TransactionAttribute(javax.ejb.TransactionAttributeType.REQUIRES_NEW)

       

      When executing the following l get the Error notifying listener org.jboss.jca.core.tx.jbossts.UserTransactionListener.

       

            userTx.begin();

       

      Not sure if its my approach or could this be a bug with Jboss-as7.

       

      I'm hoping that some of the JBoss experts can help me.

       

      Thanks.

       

      Below is the full stacktrace:

       

      14:32:53,838 WARN  [org.jboss.tm.usertx.UserTransactionRegistry] (EJB default - 3) Error notifying listener org.jboss.jca.core.tx.jbossts.UserTransactionListenerImpl@6436d311 of userTransactionStarted: java.lang.IllegalStateException: Trying to change transaction TransactionImple < ac, BasicAction: 0:ffff0a5a640c:-3d2bdb96:506de43a:1f status: ActionStatus.RUNNING > in enlist!

          at org.jboss.jca.core.connectionmanager.listener.TxConnectionListener.enlist(TxConnectionListener.java:218)

          at org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.transactionStarted(TxConnectionManagerImpl.java:383)

          at org.jboss.jca.core.connectionmanager.ccm.CachedConnectionManagerImpl.userTransactionStarted(CachedConnectionManagerImpl.java:207)

          at org.jboss.jca.core.tx.jbossts.UserTransactionListenerImpl.userTransactionStarted(UserTransactionListenerImpl.java:52)

          at org.jboss.tm.usertx.UserTransactionRegistry.userTransactionStarted(UserTransactionRegistry.java:119)

          at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.begin(ServerVMClientUserTransaction.java:146)

          at com.lidp.enterprise.background.util.BG_QMaint_Util.addProcessMsg(BG_QMaint_Util.java:50) [LIDP_ADMI_Enterprise.jar:]

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_04]

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_04]

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_04]

          at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_04]

          at org.jboss.as.ee.component.ManagedReferenceMethodInterceptorFactory$ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptorFactory.java:72) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:36) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.as.ejb3.tx.EjbBMTInterceptor.handleInvocation(EjbBMTInterceptor.java:105) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.as.ejb3.tx.BMTInterceptor.processInvocation(BMTInterceptor.java:56) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:32) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:165) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.as.ejb3.remote.LocalEjbReceiver.processInvocation(LocalEjbReceiver.java:179) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:179) [jboss-ejb-client-1.0.5.Final.jar:1.0.5.Final]

          at org.jboss.ejb.client.TransactionInterceptor.handleInvocation(TransactionInterceptor.java:43) [jboss-ejb-client-1.0.5.Final.jar:1.0.5.Final]

          at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:181) [jboss-ejb-client-1.0.5.Final.jar:1.0.5.Final]

          at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:128) [jboss-ejb-client-1.0.5.Final.jar:1.0.5.Final]

          at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:181) [jboss-ejb-client-1.0.5.Final.jar:1.0.5.Final]

          at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:136) [jboss-ejb-client-1.0.5.Final.jar:1.0.5.Final]

          at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:121) [jboss-ejb-client-1.0.5.Final.jar:1.0.5.Final]

          at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:104) [jboss-ejb-client-1.0.5.Final.jar:1.0.5.Final]

          at $Proxy24.addProcessMsg(Unknown Source)    at com.lidp.enterprise.background.master.abs.BG_Master.addBGProcessMSG(BG_Master.java:371) [LIDP_ADMI_Enterprise.jar:]

          at com.lidp.enterprise.background.master.BG_Master_ADMH.createBGProcessMSG(BG_Master_ADMH.java:120) [LIDP_ADMI_Enterprise.jar:]

          at com.lidp.enterprise.background.master.BG_Master_ADMH.findWork(BG_Master_ADMH.java:92) [LIDP_ADMI_Enterprise.jar:]

          at com.lidp.enterprise.background.master.abs.BG_Master.process(BG_Master.java:99) [LIDP_ADMI_Enterprise.jar:]

          at com.lidp.enterprise.background.master.abs.BG_Master.timeoutHandler(BG_Master.java:416) [LIDP_ADMI_Enterprise.jar:]

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_04]

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_04]

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_04]

          at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_04]

          at org.jboss.as.ee.component.ManagedReferenceMethodInterceptorFactory$ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptorFactory.java:72) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:34) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:228) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:304) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:190) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:43) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.as.ejb3.timerservice.TimedObjectInvokerImpl.callTimeout(TimedObjectInvokerImpl.java:101) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.as.ejb3.timerservice.TimedObjectInvokerImpl.callTimeout(TimedObjectInvokerImpl.java:111) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.as.ejb3.timerservice.task.TimerTask.callTimeout(TimerTask.java:157) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.as.ejb3.timerservice.task.TimerTask.run(TimerTask.java:132) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]

          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_04]

          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [rt.jar:1.7.0_04]

          at java.util.concurrent.FutureTask.run(FutureTask.java:166) [rt.jar:1.7.0_04]

          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_04]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_04]

          at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_04]

          at org.jboss.threads.JBossThread.run(JBossThread.java:122)

        • 1. Re: Error notifying listener org.jboss.jca.core.tx.jbossts.UserTransactionListener
          Justin Bertram Master

          I'm not sure if this is the root problem, but in any event you definitely should remove this from your session bean:

           

          @TransactionAttribute(javax.ejb.TransactionAttributeType.REQUIRES_NEW)
          

           

          This only applies for CMT, but you are wanting to use BMT.

          • 2. Re: Error notifying listener org.jboss.jca.core.tx.jbossts.UserTransactionListener
            Joseph Fouts Novice

            Hi Justin,

            Thanks for the quick response.

             

            I remove the ...REQUIRES_NEW and I still get the exact same

            message in the stack trace.

             

            I did fail to mention in my first post the everything still seems to work fine.

            The message gets written to the JMS message queue and gets consumed

            before the first session bean ends.  This is what I wanted. 

             

            The stacktrace and WARN/Error still concerns me.  Could this be a small

            bug with JBoss?

             

            Thanks again for your help.

            • 3. Re: Error notifying listener org.jboss.jca.core.tx.jbossts.UserTransactionListener
              Joseph Fouts Novice

              Still hoping one of the JBoss experts can tell me if this could

              be a JBoss bug.  As mentioned above the transaction seems to

              work fine but my client will not accept a stack trace displaying

              on the console everytime they run my transaction.

               

              Is there a way that I can find out if this is a JBoss bug?

               

              Thanks in advance.

              • 4. Re: Error notifying listener org.jboss.jca.core.tx.jbossts.UserTransactionListener
                jaikiran pai Master

                Quick questions before I start investigating this:

                 

                1) Is this reproducible against the latest nightly build?

                2) Do you have any datasources involved in this flow? If yes, \what does your datasource configuration look like?

                • 5. Re: Error notifying listener org.jboss.jca.core.tx.jbossts.UserTransactionListener
                  Joseph Fouts Novice

                  Hi Jaikiran thanks for your help.

                   

                  1.  I have NOT tested it against the nightly build.

                       Current issue was run against 7.1.1.Final

                  2. Yes - see below;

                   

                      The first session bean reads a record from a db2 database table.

                      If matches criteria then the second session bean is called to write

                      the key to a JMS message queue.  It uses TransactionManagement in

                      order to explicitly do the Init/Commit/Rollback.

                   

                      In the second session bean this is the statement that is producing the WARN/Error message

                      in the stack trace:

                   

                      userTx.begin();

                   

                   

                      *As I mentioned above the write to the JMS message queue does seem to still work correctly.

                       Its more the message that I am or any possible long term effects that I am worried about.

                   

                   

                  Datasource:

                   

                  <datasources>

                                  <datasource jta="true" jndi-name="java:/db2DataSource" pool-name="db2DataSource" enabled="true" use-java-context="true" use-ccm="true">

                                      <connection-url>jdbc:db2://10.90.10.125:60009/lidp</connection-url>

                                      <connection-property name="securityMechanism">

                                          4

                                      </connection-property>

                                      <driver>db2jcc</driver>

                                      <pool>

                                          <min-pool-size>1</min-pool-size>

                                          <max-pool-size>20</max-pool-size>

                                      </pool>

                                      <security>

                                          <user-name>apdev70</user-name>

                                      </security>

                                      <timeout>

                                          <idle-timeout-minutes>0</idle-timeout-minutes>

                                          <query-timeout>600</query-timeout>

                                      </timeout>

                                  </datasource>

                                  <drivers>

                                      <driver name="db2jcc" module="com.ibm.db2">

                                          <driver-class>com.ibm.db2.jcc.DB2Driver</driver-class>

                                      </driver>

                          </datasources>

                  • 6. Re: Error notifying listener org.jboss.jca.core.tx.jbossts.UserTransactionListener
                    jaikiran pai Master

                    For now try setting to use-ccm to false on your datasource configuration:

                     

                    use-ccm="false"

                     

                    and see if it makes a difference. I'll take a look at your application or code to see what the problem might be. In the meantime, if it's possible please do test against the nightly build so that we don't waste our time investigating on an issue which might already have been fixed.

                    • 7. Re: Error notifying listener org.jboss.jca.core.tx.jbossts.UserTransactionListener
                      Joseph Fouts Novice

                      Changing : use-ccm="false" seems to have fixed the problem.

                      I no longer get the WARN/Error message on the console and log file.

                       

                      Can you please explain why changing use-ccm from true to false fixed the problem?

                      I would just like to get a better understanding of what the jboss attributes are and how

                      they are defined.

                       

                      Thanks again for your help Jaikiran.