Dear All,

I am having a problem with JTA in my production application.

I have a class that implements Runnable called Generator and I call the EJB
method on the server several times through this Runnable class.
I implemented a nice exception handling, but I am sure the server is wasting
time processing the thread again.

If you could tell me what should I do to fix this, would be highly
appreciated.
I am using Hibernate in JBoss app server and the stack trace is shown as
follows:

java.lang.IllegalStateException:
[com.arjuna.ats.internal.jta.transaction.arjunacore.inactive]
[com.arjuna.ats.internal.jta.transaction.arjunacore.inactive] The
transaction is not active!
        at
com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1379)
        at
com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:135)
        at
com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:87)
        at org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:175)
        at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:87)
        at
org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at
org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at
org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at
org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
        at
org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at
org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at
org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at
org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:304)
        at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
        at
org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
        at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:809)
        at
org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:608)
        at
org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:406)
        at
org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:173)
        at
org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:163)
        at org.jboss.remoting.Client.invoke(Client.java:1634)
        at org.jboss.remoting.Client.invoke(Client.java:548)
        at
org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:62)
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at
org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:67)
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at
org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:53)
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at
org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:74)
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at
org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:107)
        at $Proxy0.extract(Unknown Source)
        at modelclient.Generator.run(Generator.java:64)
        at java.lang.Thread.run(Thread.java:619)
        at
org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:74)
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at
org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:67)
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at
org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:53)
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at
org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:74)
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at
org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:107)
        at $Proxy0.extract(Unknown Source)
        at modelclient.Generator.run(Generator.java:64)
        at java.lang.Thread.run(Thread.java:619)
31-Dec-2008 11:17:41 AM modelclient.Generator run
INFO: null
java.lang.IllegalStateException:
[com.arjuna.ats.internal.jta.transaction.arjunacore.inactive]
[com.arjuna.ats.internal.jta.transaction.arjunacore.inactive] The
transaction is not active!
        at
com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1379)
        at
com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:135)
        at
com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:87)
        at org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:175)
        at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:87)
        at
org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at
org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at
org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at
org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
        at
org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at
org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at
org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at
org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:304)
        at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
        at
org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
        at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:809)
        at
org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:608)
        at
org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:406)
        at
org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:173)
        at
org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:163)
        at org.jboss.remoting.Client.invoke(Client.java:1634)
        at org.jboss.remoting.Client.invoke(Client.java:548)
        at
org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:62)
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at
org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:67)
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at
org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:53)
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at
org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:74)
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at
org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:107)
        at $Proxy0.extract(Unknown Source)
        at modelclient.Generator.run(Generator.java:64)
        at java.lang.Thread.run(Thread.java:619)
        at
org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:74)
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at
org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:67)
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at
org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:53)
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at
org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:74)
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at
org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:107)
        at $Proxy0.extract(Unknown Source)
        at modelclient.Generator.run(Generator.java:64)
        at java.lang.Thread.run(Thread.java:619)

In the JBoss web site, the solution is done by implementing a better
transaction, but this is not the transaction used in the database right ?
How do I implement the transaction correctly to work with threads ?

Thank you for your time and have a Happy New Year !!

-- 
Fernando Abreu
fxab...@gmail.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Java 
EE (J2EE) Programming with Passion!" group.
To post to this group, send email to 
java-ee-j2ee-programming-with-passion@googlegroups.com
To unsubscribe from this group, send email to 
java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to