2 Replies Latest reply on Jul 12, 2006 1:56 AM by Peter Kovgan

    two beans within single transaction problem

    Peter Kovgan Newbie

      Hi!
      I have very strange exception. I'm quite new in ejbs, so , please, be patient.
      My bean (SfSB) called by servlet and invoked method on bean has attribute
      TransactionAttributeType.REQUIRED.
      Then my bean calls other SfSB bean(injected) and called method is also has
      TransactionAttributeType.REQUIRED
      On second call I have this annoying exception:

      What is wrong here? I have no clue.
      Please, help!!

      javax.ejb.EJBException: java.lang.RuntimeException: cannot import a transaction
      context when a transaction is already associated with the thread
      at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.ja
      va:69)
      at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
      at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java
      :192)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
      java:98)
      at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInt
      erceptor.java:76)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
      java:98)
      at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulIn
      stanceInterceptor.java:81)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
      java:98)
      at org.jboss.aspects.security.AuthenticationInterceptor.invoke(Authentic
      ationInterceptor.java:78)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
      java:98)
      at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterce
      ptor.java:47)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
      java:98)
      at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(Asynchrono
      usInterceptor.java:106)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
      java:98)
      at org.jboss.ejb3.stateful.StatefulContainer.dynamicInvoke(StatefulConta
      iner.java:308)
      at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:104)
      at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRem
      otingInvocationHandler.java:82)
      at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:828)
      at org.jboss.remoting.transport.local.LocalClientInvoker.invoke(LocalCli
      entInvoker.java:72)
      at org.jboss.remoting.Client.invoke(Client.java:525)
      at org.jboss.remoting.Client.invoke(Client.java:488)
      at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemot
      eInterceptor.java:55)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
      java:98)
      at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPr
      opagationInterceptor.java:61)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
      java:98)
      at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityC
      lientInterceptor.java:55)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
      java:98)
      at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.
      java:65)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
      java:98)
      at org.jboss.ejb3.stateful.StatefulRemoteProxy.invoke(StatefulRemoteProx
      y.java:133)
      at $Proxy87.create(Unknown Source)
      at com.sap.xtp.client.simple.ClientServlet.doPost(ClientServlet.java:74)

      at com.sap.xtp.client.simple.ClientServlet.doGet(ClientServlet.java:40)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
      icationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
      ilterChain.java:173)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFi
      lter.java:81)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
      icationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
      ilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
      alve.java:213)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
      alve.java:178)
      at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrinc
      ipalValve.java:39)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(Securit
      yAssociationValve.java:159)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValv
      e.java:59)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
      ava:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
      ava:105)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
      ve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
      a:148)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
      :856)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
      ssConnection(Http11Protocol.java:744)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpo
      int.java:527)
      at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWor
      kerThread.java:112)
      at java.lang.Thread.run(Thread.java:595)
      Caused by: java.lang.RuntimeException: cannot import a transaction context when
      a transaction is already associated with the thread
      at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInt
      erceptor.java:62)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
      java:98)
      at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulIn
      stanceInterceptor.java:81)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
      java:98)
      at org.jboss.aspects.security.AuthenticationInterceptor.invoke(Authentic
      ationInterceptor.java:78)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
      java:98)
      at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterce
      ptor.java:47)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
      java:98)
      at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(Asynchrono
      usInterceptor.java:106)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
      java:98)
      at org.jboss.ejb3.stateful.StatefulContainer.dynamicInvoke(StatefulConta
      iner.java:308)
      at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:104)
      at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRem
      otingInvocationHandler.java:82)