12 Replies Latest reply on Sep 19, 2013 12:18 PM by Andrey Samuleev

    Transaction exception: Illegal attempt to enlist a 2PC XAResource

    James Cameron Newbie

      Hi all,

       

      I have transaction code as below:

      TransactionManager tm = cache.getTransactionManager();
      tm.begin();
      cache.put(3, "Three"); //this line causes the exceptions
      tm.commit();
      

      When running it, I got exceptions below:

       

      org.infinispan.CacheException: java.lang.IllegalStateException: Illegal 
      attempt to enlist a 2PC XAResource
       at 
      org.infinispan.transaction.xa.TransactionTable.getOrCreateXaAdapter(TransactionTable.java:186)
       at 
      org.infinispan.interceptors.TxInterceptor.enlist(TxInterceptor.java:196)
       at 
      org.infinispan.interceptors.TxInterceptor.enlistWriteAndInvokeNext(TxInterceptor.java:178)
       at 
      org.infinispan.interceptors.TxInterceptor.visitPutKeyValueCommand(TxInterceptor.java:132)
       at 
      org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:76)
       at 
      org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
       at 
      org.infinispan.interceptors.CacheMgmtInterceptor.visitPutKeyValueCommand(CacheMgmtInterceptor.java:113)
       at 
      org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:76)
       at 
      org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
       at 
      org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:48)
       at 
      org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:34)
       at 
      org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:57)
       at 
      org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:76)
       at 
      org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
       at 
      org.infinispan.interceptors.BatchingInterceptor.handleDefault(BatchingInterceptor.java:72)
       at 
      org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:57)
       at 
      org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:76)
       at 
      org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:269)
       at org.infinispan.CacheDelegate.put(CacheDelegate.java:434)
      

      My configuration is as follows:

       

      <namedCache name="myCache">
        <transaction transactionManagerLookupClass="org.infinispan.transaction.lookup.GenericTransactionManagerLookup"
        syncRollbackPhase="false"
        syncCommitPhase="false"
        useEagerLocking="false"/>
        <eviction wakeUpInterval="500" maxEntries="1000" strategy="LRU"/>
        <invocationBatching enabled="true"/>
        <clustering mode="replication">
        <sync/>
        </clustering>
        <jmxStatistics enabled="true"/>
      </namedCache>
      
      


      Can anyone point out where I might go wrong?

       

      Many thanks.

        • 1. Transaction exception: Illegal attempt to enlist a 2PC XAResource
          James Cameron Newbie

          Hi,

           

          Does anyone explain what "2PC XAResource" is?

           

          When I ran the same transaction code with the same configuration in a stand-lone application, it works fine. No exceptions. I guess the issue is related to web environment. I follow the article http://community.jboss.org/wiki/Infinispantransactions but got the exception.

           

          Any sample in web environment?

           

          Thank you.

          • 2. Transaction exception: Illegal attempt to enlist a 2PC XAResource
            James Cameron Newbie

            Hi,

             

            Has anyone tried the code in http://community.jboss.org/wiki/Infinispantransactions in a web environment successfully? I strictly followed the article's code and configuration but still got the exceptions.

             

            I read "Transaction" chapter in J2EE tutorial. J2EE recommends using UserTransaction interface instead of TransactionManager. I'm wondering if it's related to the issue or not.

             

            Any feedback is appreciated.

             

            Thank you!

            • 3. Transaction exception: Illegal attempt to enlist a 2PC XAResource
              Dan Berindei Expert

              What version of Infinispan are you using? In what container?

               

              Searching for "Illegal attempt to enlist a 2PC XAResource" yielded a lot of Websphere questions, so it looks like it's an exception thrown by Websphere and rethrown by Infinispan. You should have a "Caused by" exception in your log for the CacheException you posted, please post that too.

              • 4. Transaction exception: Illegal attempt to enlist a 2PC XAResource
                James Cameron Newbie

                Hi Dan,

                 

                I'm using infinispan 4.2.1.CR4 and IBM WAS 6.1 as the local server. Below is the whole exceptions I got:

                nested exception is org.infinispan.CacheException: java.lang.IllegalStateException: Illegal attempt to enlist a 2PC XAResource
                at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:656)
                at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
                at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
                at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
                at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1143)
                at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1084)
                at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:118)
                at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
                at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:832)
                at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:679)
                at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:587)
                at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:481)
                at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:90)
                at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:748)
                at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1466)
                at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:119)
                at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:458)
                at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:387)
                at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
                at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
                at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
                at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
                at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
                at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:196)
                at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:751)
                at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:881)
                at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)
                Caused by: org.infinispan.CacheException: java.lang.IllegalStateException: Illegal attempt to enlist a 2PC XAResource
                at org.infinispan.transaction.xa.TransactionTable.getOrCreateXaAdapter(TransactionTable.java:186)
                at org.infinispan.interceptors.TxInterceptor.enlist(TxInterceptor.java:196)
                at org.infinispan.interceptors.TxInterceptor.enlistWriteAndInvokeNext(TxInterceptor.java:178)
                at org.infinispan.interceptors.TxInterceptor.visitPutKeyValueCommand(TxInterceptor.java:132)
                at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:76)
                at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
                at org.infinispan.interceptors.CacheMgmtInterceptor.visitPutKeyValueCommand(CacheMgmtInterceptor.java:113)
                at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:76)
                at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
                at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:48)
                at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:34)
                at org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:57)
                at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:76)
                at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
                at org.infinispan.interceptors.BatchingInterceptor.handleDefault(BatchingInterceptor.java:72)
                at org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:57)
                at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:76)
                at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:269)
                at org.infinispan.CacheDelegate.put(CacheDelegate.java:434)
                at org.infinispan.CacheDelegate.put(CacheDelegate.java:205)
                at ccra.ik.admin.cache.infinispan.InfinispanProxy.put(InfinispanProxy.java:27)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
                at java.lang.reflect.Method.invoke(Method.java:600)
                at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:175)
                at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:421)
                at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:409)
                at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:774)
                at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
                at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
                ... 26 more
                Caused by: java.lang.IllegalStateException: Illegal attempt to enlist a 2PC XAResource
                at com.ibm.ws.Transaction.JTA.TransactionImpl.enlistResource(TransactionImpl.java:3191)
                at org.infinispan.transaction.xa.TransactionTable.getOrCreateXaAdapter(TransactionTable.java:183)
                ... 57 more

                [05/04/11 15:59:42:081 EDT] 0000003a WebApp        E   [Servlet Error]-[Spring Dispatcher Servlet]: org.infinispan.CacheException: java.lang.IllegalStateException: Illegal attempt to enlist a 2PC XAResource
                at org.infinispan.transaction.xa.TransactionTable.getOrCreateXaAdapter(TransactionTable.java:186)
                at org.infinispan.interceptors.TxInterceptor.enlist(TxInterceptor.java:196)
                at org.infinispan.interceptors.TxInterceptor.enlistWriteAndInvokeNext(TxInterceptor.java:178)
                at org.infinispan.interceptors.TxInterceptor.visitPutKeyValueCommand(TxInterceptor.java:132)
                at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:76)
                at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
                at org.infinispan.interceptors.CacheMgmtInterceptor.visitPutKeyValueCommand(CacheMgmtInterceptor.java:113)
                at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:76)
                at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
                at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:48)
                at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:34)
                at org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:57)
                at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:76)
                at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
                at org.infinispan.interceptors.BatchingInterceptor.handleDefault(BatchingInterceptor.java:72)
                at org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:57)
                at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:76)
                at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:269)
                at org.infinispan.CacheDelegate.put(CacheDelegate.java:434)
                at org.infinispan.CacheDelegate.put(CacheDelegate.java:205)
                at ccra.ik.admin.cache.infinispan.InfinispanProxy.put(InfinispanProxy.java:27)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
                at java.lang.reflect.Method.invoke(Method.java:600)
                at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:175)
                at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:421)
                at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:409)
                at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:774)
                at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
                at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
                at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
                at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
                at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
                at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1143)
                at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1084)
                at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:118)
                at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
                at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:832)
                at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:679)
                at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:587)
                at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:481)
                at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:90)
                at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:748)
                at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1466)
                at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:119)
                at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:458)
                at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:387)
                at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
                at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
                at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
                at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
                at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
                at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:196)
                at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:751)
                at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:881)
                at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)
                Caused by: java.lang.IllegalStateException: Illegal attempt to enlist a 2PC XAResource
                at com.ibm.ws.Transaction.JTA.TransactionImpl.enlistResource(TransactionImpl.java:3191)
                at org.infinispan.transaction.xa.TransactionTable.getOrCreateXaAdapter(TransactionTable.java:183)
                ... 57 more

                The messages close to the end show the exceptions are caused by com.ibm.ws.Transaction.JTA.TransactionImpl.enlistResource(TransactionImpl.java:3191). Do I miss some configuration?

                 

                Thanks.


                • 5. Transaction exception: Illegal attempt to enlist a 2PC XAResource
                  Dan Berindei Expert

                  James, are you sure you're using 4.2.1.CR4? I see TransactionTable.getOrCreateXaAdapter() in the stack trace, and that method was removed in 4.2.0.CR4.

                  • 6. Transaction exception: Illegal attempt to enlist a 2PC XAResource
                    Mehmet Dongel Newbie

                    Hi,

                     

                    I'm exposing to this problem, too.

                     

                    I'm using infinispan-4.2.1.FINAL for cache implementation, Hibernate 3.6.2 Final for JPA 2.0 implementation. Application Server is

                    WebSphere Application Server  7.0.0.11.

                    EntityManagerFactory is initialized by Spring Framework 3.0.3.

                    DataSource Type is Oracle XA Datasource with ojdbc6.jar driver.

                    Cache definition is done by hibernate annotations like below.

                    @Entity

                    @Table(name = "USER")

                    @Cacheable

                    @Cache(usage=CacheConcurrencyStrategy.TRANSACTIONAL)

                    public class User implements java.io.Serializable {

                    ..................

                    }

                     

                    When I update User object in Spring Controller, below exception is thrown.

                    Where is the wrong?

                    I'm waiting for your help.

                    Thanks...

                     

                     

                    Exception
                    javax.servlet.ServletException: org.springframework.transaction.TransactionSystemException: UOWManager transaction processing failed; nested exception is com.ibm.wsspi.uow.UOWException: javax.transaction.RollbackException
                            at javax.faces.webapp.FacesServlet.service(FacesServlet.java:422)
                            at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1655)
                            at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1595)
                            at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:131)
                            at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)
                            at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
                            at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
                            at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
                            at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188)
                            at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:116)
                            at com.atosorigin.vftr.etopup.web.filter.SessionTimeOutFilter.doFilter(SessionTimeOutFilter.java:83)
                            at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188)
                            at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:116)
                            at com.atosorigin.vftr.etopup.web.filter.ErrorFilter.doFilter(ErrorFilter.java:72)
                            at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188)
                            at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:116)
                            at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:77)
                            at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:908)
                            at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:932)
                            at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:500)
                            at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
                            at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3826)
                            at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:276)
                            at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:931)
                            at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1583)
                            at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:186)
                            at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)
                            at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
                            at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)
                            at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
                            at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
                            at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
                            at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
                            at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
                            at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
                            at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
                            at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1550)
                    Caused by: javax.faces.el.EvaluationException: org.springframework.transaction.TransactionSystemException: UOWManager transaction processing failed; nested exception is com.ibm.wsspi.uow.UOWException: javax.transaction.RollbackException
                            at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102)
                            at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
                            at javax.faces.component.UICommand.broadcast(UICommand.java:315)
                            at org.ajax4jsf.component.AjaxActionComponent.broadcast(AjaxActionComponent.java:55)
                            at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:329)
                            at org.ajax4jsf.component.AjaxViewRoot.broadcastEventsForPhase(AjaxViewRoot.java:304)
                            at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:261)
                            at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:474)
                            at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
                            at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
                            at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
                            at javax.faces.webapp.FacesServlet.service(FacesServlet.java:409)
                            ... 36 more
                    Caused by: org.springframework.transaction.TransactionSystemException: UOWManager transaction processing failed; nested exception is com.ibm.wsspi.uow.UOWException: javax.transaction.RollbackException
                            at org.springframework.transaction.jta.WebSphereUowTransactionManager.execute(WebSphereUowTransactionManager.java:288)
                            at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:127)
                            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
                            at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:621)
                            at com.atosorigin.vftr.etopup.web.controller.UserLoginController$$EnhancerByCGLIB$$cbb8a867.login(<generated>)
                            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
                            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
                            at java.lang.reflect.Method.invoke(Method.java:600)
                            at com.sun.el.parser.AstValue.invoke(AstValue.java:234)
                            at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:297)
                            at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
                            at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
                            ... 47 more
                    Caused by: com.ibm.wsspi.uow.UOWException: javax.transaction.RollbackException
                            at com.ibm.ws.uow.UOWManagerImpl.runUnderNewUOW(UOWManagerImpl.java:1098)
                            at com.ibm.ws.uow.UOWManagerImpl.runUnderUOW(UOWManagerImpl.java:627)
                            at org.springframework.transaction.jta.WebSphereUowTransactionManager.execute(WebSphereUowTransactionManager.java:281)
                            ... 59 more
                    Caused by: javax.transaction.RollbackException
                            at com.ibm.tx.jta.TransactionImpl.stage3CommitProcessing(TransactionImpl.java:1221)
                            at com.ibm.tx.jta.TransactionImpl.processCommit(TransactionImpl.java:991)
                            at com.ibm.tx.jta.TransactionImpl.commit(TransactionImpl.java:913)
                            at com.ibm.ws.tx.jta.TranManagerImpl.commit(TranManagerImpl.java:377)
                            at com.ibm.tx.jta.TranManagerSet.commit(TranManagerSet.java:161)
                            at com.ibm.ws.uow.UOWManagerImpl.uowCommit(UOWManagerImpl.java:1173)
                            at com.ibm.ws.uow.UOWManagerImpl.uowEnd(UOWManagerImpl.java:1143)
                            at com.ibm.ws.uow.UOWManagerImpl.runUnderNewUOW(UOWManagerImpl.java:1093)
                            ... 61 more
                    Caused by: javax.persistence.PersistenceException: org.hibernate.cache.CacheException: org.infinispan.CacheException: java.lang.IllegalStateException: Illegal attempt to enlist a 2PC XAResource
                            at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1214)
                            at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1147)
                            at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1153)
                            at org.hibernate.ejb.AbstractEntityManagerImpl$3.mapManagedFlushFailure(AbstractEntityManagerImpl.java:1067)
                            at org.hibernate.transaction.synchronization.CallbackCoordinator.beforeCompletion(CallbackCoordinator.java:122)
                            at org.hibernate.transaction.synchronization.HibernateSynchronizationImpl.beforeCompletion(HibernateSynchronizationImpl.java:51)
                            at com.ibm.tx.jta.RegisteredSyncs.coreDistributeBefore(RegisteredSyncs.java:289)
                            at com.ibm.ws.tx.jta.RegisteredSyncs.distributeBefore(RegisteredSyncs.java:150)
                            at com.ibm.ws.tx.jta.TransactionImpl.prePrepare(TransactionImpl.java:2312)
                            at com.ibm.ws.tx.jta.TransactionImpl.stage1CommitProcessing(TransactionImpl.java:533)
                            at com.ibm.tx.jta.TransactionImpl.processCommit(TransactionImpl.java:978)
                            ... 67 more
                    Caused by: org.hibernate.cache.CacheException: org.infinispan.CacheException: java.lang.IllegalStateException: Illegal attempt to enlist a 2PC XAResource
                            at org.hibernate.cache.infinispan.util.CacheAdapterImpl.put(CacheAdapterImpl.java:102)
                            at org.hibernate.cache.infinispan.access.TransactionalAccessDelegate.update(TransactionalAccessDelegate.java:128)
                            at org.hibernate.cache.infinispan.entity.TransactionalAccess.update(TransactionalAccess.java:64)
                            at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:170)
                            at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273)
                            at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:265)
                            at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:185)
                            at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
                            at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51)
                            at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1216)
                            at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:383)
                            at org.hibernate.transaction.synchronization.CallbackCoordinator.beforeCompletion(CallbackCoordinator.java:117)
                            ... 73 more
                    Caused by: org.infinispan.CacheException: java.lang.IllegalStateException: Illegal attempt to enlist a 2PC XAResource
                            at org.infinispan.interceptors.TxInterceptor.enlist(TxInterceptor.java:213)
                            at org.infinispan.interceptors.TxInterceptor.enlistWriteAndInvokeNext(TxInterceptor.java:178)
                            at org.infinispan.interceptors.TxInterceptor.visitPutKeyValueCommand(TxInterceptor.java:132)
                            at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:80)
                            at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
                            at org.infinispan.interceptors.CacheMgmtInterceptor.visitPutKeyValueCommand(CacheMgmtInterceptor.java:113)
                            at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:80)
                            at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
                            at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:95)
                            at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:62)
                            at org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:58)
                            at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:80)
                            at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
                            at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:132)
                            at org.hibernate.cache.infinispan.impl.ClassLoaderAwareCache$ClassLoaderAwareCommandInterceptor.handleDefault(ClassLoaderAwareCache.java:79)
                            at org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:58)
                            at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:80)
                            at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:273)
                            at org.infinispan.CacheDelegate.put(CacheDelegate.java:450)
                            at org.infinispan.CacheSupport.put(CacheSupport.java:28)
                            at org.hibernate.cache.infinispan.util.CacheAdapterImpl.put(CacheAdapterImpl.java:100)
                            ... 84 more
                    Caused by: java.lang.IllegalStateException: Illegal attempt to enlist a 2PC XAResource
                            at com.ibm.ws.tx.jta.TransactionImpl.enlistResource(TransactionImpl.java:1732)
                            at org.infinispan.interceptors.TxInterceptor.enlist(TxInterceptor.java:200)
                            ... 104 more

                     

                     

                    persistence.xml

                    <?xml version="1.0" encoding="UTF-8"?>

                    <persistence 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"

                                 version="2.0">

                               <persistence-unit name="ETopUp" transaction-type="JTA">

                            <provider>org.hibernate.ejb.HibernatePersistence</provider>

                            <properties>

                                <property name="hibernate.generate_statistics" value="true"/>

                                <property name="hibernate.cache.infinispan.statistics" value="true"/>

                               

                                <property name="hibernate.cache.use_second_level_cache" value="true"/>

                                <property name="hibernate.cache.use_query_cache" value="false"/>

                                <property name="hibernate.cache.region.factory_class" value="org.hibernate.cache.infinispan.InfinispanRegionFactory"/>

                               

                                <property name="hibernate.cache.infinispan.cfg" value="/META-INF/cache-configs.xml"/>

                                <property name="hibernate.cache.infinispan.entity.cfg" value="etopup-entity"/>

                                <property name="hibernate.cache.infinispan.collection.cfg" value="etopup-collection"/>

                               

                                <property name="hibernate.cache.infinispan.entity.eviction.strategy" value= "LRU"/>

                                <property name="hibernate.cache.infinispan.entity.eviction.wake_up_interval" value= "10000"/>

                                <property name="hibernate.cache.infinispan.entity.eviction.max_entries" value= "100"/>

                                <property name="hibernate.cache.infinispan.entity.expiration.lifespan" value= "60000"/>

                                <property name="hibernate.cache.infinispan.entity.expiration.max_idle" value= "30000"/>

                                           

                                <property name="javax.persistence.query.timeout" value="120000"/>           

                                <property name="hibernate.id.new_generator_mappings" value="true"/>

                               

                            </properties>

                        </persistence-unit>

                    </persistence>

                     

                    cache-configs.xml

                    <?xml version="1.0" encoding="UTF-8"?>

                    <infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:infinispan:config:4.0">

                       <global>

                          <transport transportClass = "org.infinispan.remoting.transport.jgroups.JGroupsTransport"

                                clusterName="infinispan-hibernate-cluster" distributedSyncTimeout="50000">

                             <!-- Note that the JGroups transport uses sensible defaults if no configuration property is defined. -->

                             <properties>

                                <!-- TODO: Change to udp.xml once streaming transfer requirement has been removed.  -->

                                <property name="configurationFile" value="/META-INF/cache-flush-udp.xml"/>

                             </properties>

                             <!-- See the JGroupsTransport javadocs for more flags -->

                          </transport>

                       </global>

                     

                       <default>

                          <!-- Used to register JMX statistics in any available MBean server -->

                          <jmxStatistics enabled="false"/>

                    <transaction 

                          transactionManagerLookupClass="org.infinispan.transaction.lookup.GenericTransactionManagerLookup"

                          syncRollbackPhase="false"

                          syncCommitPhase="false"

                          useEagerLocking="false"/>

                       </default>

                     

                       <!-- Default configuration is appropriate for entity/collection caching. -->

                       <namedCache name="entity">

                          <clustering mode="invalidation">

                             <stateRetrieval fetchInMemoryState="false" timeout="20000"/>

                             <sync replTimeout="20000"/>

                          </clustering>

                          <locking isolationLevel="READ_COMMITTED" concurrencyLevel="1000"

                                   lockAcquisitionTimeout="15000" useLockStriping="false" />

                          <!-- Eviction configuration.  WakeupInterval defines how often the eviction thread runs, in milliseconds. 

                               0 means the eviction thread will never run.  A separate executor is used for eviction in each cache. -->

                          <eviction wakeUpInterval="5000" maxEntries="10000" strategy="LRU"/>

                          <expiration maxIdle="100000"/>

                          <lazyDeserialization enabled="true"/>

                       </namedCache>

                      

                       <!-- Default configuration is appropriate for entity/collection caching. -->

                       <namedCache name="entity-repeatable">

                          <clustering mode="invalidation">

                             <stateRetrieval fetchInMemoryState="false" timeout="20000"/>

                             <sync replTimeout="20000"/>

                          </clustering>

                          <!-- Note: REPEATABLE_READ is only useful if the application evicts/clears entities

                            from the Hibernate Session and then expects to repeatably re-read them in

                            the same transaction. Otherwise, the Session's internal cache provides a

                            repeatable-read semantic. Before choosing this config, carefully read the docs

                            and make sure you really need REPEATABLE_READ.

                           -->

                          <locking isolationLevel="REPEATABLE_READ" concurrencyLevel="1000"

                                   lockAcquisitionTimeout="15000" useLockStriping="false"/>

                          <!-- Eviction configuration.  WakeupInterval defines how often the eviction thread runs, in milliseconds. 

                               0 means the eviction thread will never run.  A separate executor is used for eviction in each cache. -->

                          <eviction wakeUpInterval="5000" maxEntries="10000" strategy="LRU"/>

                          <expiration maxIdle="100000"/>

                          <lazyDeserialization enabled="true"/>

                       </namedCache>

                      

                       <!-- An alternative configuration for entity/collection caching that uses replication instead of invalidation -->

                       <namedCache name="replicated-entity">

                          <clustering mode="replication">

                             <stateRetrieval fetchInMemoryState="false" timeout="20000"/>

                             <sync replTimeout="20000"/>

                          </clustering>

                          <locking isolationLevel="READ_COMMITTED" concurrencyLevel="1000"

                                   lockAcquisitionTimeout="15000" useLockStriping="false"/>

                          <!-- Eviction configuration.  WakeupInterval defines how often the eviction thread runs, in milliseconds. 

                               0 means the eviction thread will never run.  A separate executor is used for eviction in each cache. -->

                          <eviction wakeUpInterval="5000" maxEntries="10000" strategy="LRU"/>

                          <expiration maxIdle="100000"/>

                          <lazyDeserialization enabled="true"/>

                       </namedCache>

                      

                      

                       <!-- A config appropriate for query caching. Does not replicate queries. -->

                       <namedCache name="local-query">

                          <locking isolationLevel="READ_COMMITTED" concurrencyLevel="1000"

                                   lockAcquisitionTimeout="15000" useLockStriping="false"/>

                          <!--Eviction configuration.  WakeupInterval defines how often the eviction thread runs, in milliseconds.  0 means

                             the eviction thread will never run.  A separate executor is used for eviction in each cache. -->

                          <eviction wakeUpInterval="5000" maxEntries="10000" strategy="LRU"/>

                          <expiration maxIdle="100000"/>

                       </namedCache>

                     

                       <!-- A query cache that replicates queries. Replication is asynchronous. -->

                       <namedCache name="replicated-query">

                          <clustering mode="replication">

                             <stateRetrieval fetchInMemoryState="false"/>

                             <async/>

                          </clustering>

                          <locking isolationLevel="READ_COMMITTED" concurrencyLevel="1000"

                                   lockAcquisitionTimeout="15000" useLockStriping="false"/>

                          <!--Eviction configuration.  WakeupInterval defines how often the eviction thread runs, in milliseconds.  0 means

                             the eviction thread will never run.  A separate executor is used for eviction in each cache. -->

                          <eviction wakeUpInterval="5000" maxEntries="10000" strategy="LRU"/>

                          <expiration maxIdle="100000"/>

                       </namedCache>

                     

                       <!-- Optimized for timestamp caching. A clustered timestamp cache

                            is required if query caching is used, even if the query cache

                            itself is configured with CacheMode=LOCAL. -->

                       <namedCache name="timestamps">

                          <clustering mode="replication">

                             <stateRetrieval fetchInMemoryState="true" timeout="20000"/>

                             <async/>

                          </clustering>

                          <locking isolationLevel="READ_COMMITTED" concurrencyLevel="1000"

                                   lockAcquisitionTimeout="15000" useLockStriping="false"/>

                          <lazyDeserialization enabled="true"/>

                          <!--  Don't ever evict modification timestamps -->

                          <eviction wakeUpInterval="0" strategy="NONE"/>

                       </namedCache>

                     

                    </infinispan>

                    • 7. Transaction exception: Illegal attempt to enlist a 2PC XAResource
                      Elias Ross Master

                      Seems related? http://jira.terracotta.org/jira/browse/EHC-798

                       

                      "...used to report an error when a user tries to access an XA resource without starting the trasaction first or when the current transaction is marked for rollback only."

                       

                      Is there an active transaction? Was it rolled back?

                      • 8. Transaction exception: Illegal attempt to enlist a 2PC XAResource
                        Dan Berindei Expert

                        Elias, from the link you posted:

                        Since this exception can only be thrown by an overly strict or badly broken transaction manager I think I should include a very explicit error message explaining that the user most probably is using some unsupported TM and maybe include a link to the JTA doc page.

                         

                        I also saw this comment in org.hibernate.transaction.WebSphereExtendedJTATransactionLookup:

                        WAS, unlike every other app server on the planet, does not allow direct access to the JTS TransactionManager.  Instead, for common transaction- related tasks users must utilize a proprietary API known as ExtendedJTATransaction.

                         

                        My guess is until we implement a WebSphereExtendedJTATransactionLookup equivalent in Infinispan, participating in distributed transactions with the WebSphere TM is just not supported.

                        1 of 1 people found this helpful
                        • 9. Transaction exception: Illegal attempt to enlist a 2PC XAResource
                          Mircea Markus Master

                          Infinispan 5.0+ allows transaction enlistment through Synchronization, which should work as does not require 2PC.

                          This means that recovery won't be supported, which is the case anyway for 4.2.1 where recovery is not implemented.

                          1 of 1 people found this helpful
                          • 10. Re: Transaction exception: Illegal attempt to enlist a 2PC XAResource
                            Steven Newson Newbie

                            OK, so I have pretty much the same setup as you have and experienced the same problems. This would almost certainly be fixed by upgrading to Infinispan 5 (from 4.2.1 FINAL). However, I don't currently have the luxury of being able to do that (code is in a stable client branch - not prepared to upgrade Infinispan and JGroups at the moment). So, I've had to implement a workaround. This works for me (although it left me with an additional problem with Lucene search which I had to hack around too).

                             

                            Essentially, I've created a replacement GenericTransactionManagerLookup which returns an adapted ("decorated" perhaps) transaction manager which in turn returns adapted transactions. Those transactions then replay the standard 2PC requests as Synchronization requests. A little bit of reflection is needed here and that necessitates a degree of confidence in the exact version of Websphere that you are within. However, you're fairly safe with this one as it's unlikely the methods will change.

                             

                            The gist is here: https://gist.github.com/3218256

                             

                            HTH someone else.

                            • 12. Re: Transaction exception: Illegal attempt to enlist a 2PC XAResource
                              Andrey Samuleev Newbie

                              I'm trying to use ModeShape JCA adapter on WebSphere 8.

                              ModeShape uses Infinispan 5.2.6 with config

                               

                              <infinispan

                                      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                                      xsi:schemaLocation="urn:infinispan:config:5.2 http://www.infinispan.org/schemas/infinispan-config-5.2.xsd"

                                      xmlns="urn:infinispan:config:5.2">

                                  <namedCache name="inf">

                                      <transaction

                                              transactionManagerLookupClass="org.infinispan.transaction.lookup.GenericTransactionManagerLookup"

                                              transactionMode="TRANSACTIONAL"

                                              lockingMode="OPTIMISTIC"

                                              useSynchronization="false">

                                              <recovery enabled="true"/> 

                                  </transaction>

                                  </namedCache>

                              </infinispan>

                               

                              While starting transaction I'm facing ISPN specific exception:

                               

                              [9/19/13 16:22:04:297 EEST] 0000004d XaTransaction Z org.infinispan.transaction.xa.XaTransactionTable enlist Failed to enlist TransactionXaAdapter to transaction

                                                               java.lang.IllegalStateException: Illegal attempt to enlist a 2PC XAResource

                                  at com.ibm.ws.tx.jta.TransactionImpl.enlistResource(TransactionImpl.java:1758)

                                  at org.infinispan.transaction.xa.XaTransactionTable.enlist(XaTransactionTable.java:97)

                                  at org.infinispan.interceptors.TxInterceptor.enlist(TxInterceptor.java:275)

                                  at org.infinispan.interceptors.TxInterceptor.enlistIfNeeded(TxInterceptor.java:236)

                                  at org.infinispan.interceptors.TxInterceptor.enlistReadAndInvokeNext(TxInterceptor.java:230)

                                  at org.infinispan.interceptors.TxInterceptor.visitGetKeyValueCommand(TxInterceptor.java:226)

                                  at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:58)

                                  at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)

                                  at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:128)

                                  at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:92)

                                  at org.infinispan.commands.AbstractVisitor.visitGetKeyValueCommand(AbstractVisitor.java:104)

                                  at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:58)

                                  at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:343)

                                  at org.infinispan.CacheImpl.get(CacheImpl.java:289)

                                  at org.infinispan.CacheImpl.get(CacheImpl.java:281)

                                  at org.infinispan.schematic.internal.CacheSchematicDb.<init>(CacheSchematicDb.java:69)

                                  at org.infinispan.schematic.Schematic.get(Schematic.java:99)

                                  at org.modeshape.jcr.JcrRepository$RunningState.<init>(JcrRepository.java:1025)

                                  at org.modeshape.jcr.JcrRepository$RunningState.<init>(JcrRepository.java:928)

                                  at org.modeshape.jcr.JcrRepository.doStart(JcrRepository.java:361)

                                  at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:605)

                                  at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:155)

                                  at org.modeshape.jca.JcrManagedConnection.openSession(JcrManagedConnection.java:134)

                                  at org.modeshape.jca.JcrManagedConnection.<init>(JcrManagedConnection.java:86)

                                  at org.modeshape.jca.JcrManagedConnectionFactory.createManagedConnection(JcrManagedConnectionFactory.java:189)

                                  at com.ibm.ejs.j2c.FreePool.createManagedConnectionWithMCWrapper(FreePool.java:2097)

                                  at com.ibm.ejs.j2c.FreePool.createOrWaitForConnection(FreePool.java:1778)

                                  at com.ibm.ejs.j2c.PoolManager.reserve(PoolManager.java:3258)

                                  at com.ibm.ejs.j2c.PoolManager.reserve(PoolManager.java:2599)

                                  at com.ibm.ejs.j2c.ConnectionManager.allocateMCWrapper(ConnectionManager.java:1500)

                                  at com.ibm.ejs.j2c.ConnectionManager.allocateConnection(ConnectionManager.java:1012)

                                  at org.modeshape.jca.JcrRepositoryHandle.login(JcrRepositoryHandle.java:131)

                                  at org.modeshape.jca.JcrRepositoryHandle.login(JcrRepositoryHandle.java:123)

                                  at service_pak.DaoImpl.getSession(DaoImpl.java:34)

                                  at service_pak.EJSLocal0SLDaoImpl_42d97f67.getSession(EJSLocal0SLDaoImpl_42d97f67.java)

                                  at service_pak.ServiceImpl.getTransactionManager(ServiceImpl.java:82)

                                  at service_pak.EJSLocal0SLServiceImpl_3d720e08.getTransactionManager(EJSLocal0SLServiceImpl_3d720e08.java)

                                  at integtation.IntegrationWebServiceImpl.getTransactionManagerClassName(IntegrationWebServiceImpl.java:49)

                                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)

                                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)

                                  at java.lang.reflect.Method.invoke(Method.java:611)

                                  at org.apache.axis2.jaxws.server.dispatcher.JavaDispatcher.invokeTargetOperation(JavaDispatcher.java:101)

                                  at com.ibm.ws.websvcs.server.dispatcher.EJBBeanDispatcher.invokeTargetOperation(EJBBeanDispatcher.java:192)

                                  at org.apache.axis2.jaxws.server.dispatcher.JavaBeanDispatcher.invoke(JavaBeanDispatcher.java:118)

                                  at com.ibm.ws.websvcs.server.dispatcher.EJBBeanDispatcher.invoke(EJBBeanDispatcher.java:80)

                                  at org.apache.axis2.jaxws.server.EndpointController.invoke(EndpointController.java:111)

                                  at org.apache.axis2.jaxws.server.JAXWSMessageReceiver.receive(JAXWSMessageReceiver.java:161)

                                  at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:208)

                                  at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:172)

                                  at com.ibm.ws.websvcs.transport.http.WASAxis2Servlet.doPost(WASAxis2Servlet.java:1517)

                                  at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)

                                  at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)

                                  at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1224)

                                  at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:774)

                                  at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:456)

                                  at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)

                                  at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1032)

                                  at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:87)

                                  at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:895)

                                  at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)

                                  at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:195)

                                  at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:452)

                                  at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:511)

                                  at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:305)

                                  at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)

                                  at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)

                                  at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)

                                  at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)

                                  at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)

                                  at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)

                                  at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)

                                  at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)

                                  at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1690)

                               

                              [9/19/13 16:22:04:300 EEST] 0000004d InvocationCon Z org.infinispan.interceptors.InvocationContextInterceptor handleAll ISPN000136: Execution error

                                                               org.infinispan.CacheException: java.lang.IllegalStateException: Illegal attempt to enlist a 2PC XAResource

                                  at org.infinispan.transaction.xa.XaTransactionTable.enlist(XaTransactionTable.java:112)

                                  at org.infinispan.interceptors.TxInterceptor.enlist(TxInterceptor.java:275)

                                  at org.infinispan.interceptors.TxInterceptor.enlistIfNeeded(TxInterceptor.java:236)

                                  at org.infinispan.interceptors.TxInterceptor.enlistReadAndInvokeNext(TxInterceptor.java:230)

                                  at org.infinispan.interceptors.TxInterceptor.visitGetKeyValueCommand(TxInterceptor.java:226)

                                  at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:58)

                                  at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)

                                  at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:128)

                                  at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:92)

                                  at org.infinispan.commands.AbstractVisitor.visitGetKeyValueCommand(AbstractVisitor.java:104)

                                  at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:58)

                                  at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:343)

                                  at org.infinispan.CacheImpl.get(CacheImpl.java:289)

                                  at org.infinispan.CacheImpl.get(CacheImpl.java:281)

                                  at org.infinispan.schematic.internal.CacheSchematicDb.<init>(CacheSchematicDb.java:69)

                                  at org.infinispan.schematic.Schematic.get(Schematic.java:99)

                                  at org.modeshape.jcr.JcrRepository$RunningState.<init>(JcrRepository.java:1025)

                                  at org.modeshape.jcr.JcrRepository$RunningState.<init>(JcrRepository.java:928)

                                  at org.modeshape.jcr.JcrRepository.doStart(JcrRepository.java:361)

                                  at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:605)

                                  at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:155)

                                  at org.modeshape.jca.JcrManagedConnection.openSession(JcrManagedConnection.java:134)

                                  at org.modeshape.jca.JcrManagedConnection.<init>(JcrManagedConnection.java:86)

                                  at org.modeshape.jca.JcrManagedConnectionFactory.createManagedConnection(JcrManagedConnectionFactory.java:189)

                                  at com.ibm.ejs.j2c.FreePool.createManagedConnectionWithMCWrapper(FreePool.java:2097)

                                  at com.ibm.ejs.j2c.FreePool.createOrWaitForConnection(FreePool.java:1778)

                                  at com.ibm.ejs.j2c.PoolManager.reserve(PoolManager.java:3258)

                                  at com.ibm.ejs.j2c.PoolManager.reserve(PoolManager.java:2599)

                                  at com.ibm.ejs.j2c.ConnectionManager.allocateMCWrapper(ConnectionManager.java:1500)

                                  at com.ibm.ejs.j2c.ConnectionManager.allocateConnection(ConnectionManager.java:1012)

                                  at org.modeshape.jca.JcrRepositoryHandle.login(JcrRepositoryHandle.java:131)

                                  at org.modeshape.jca.JcrRepositoryHandle.login(JcrRepositoryHandle.java:123)

                                  at service_pak.DaoImpl.getSession(DaoImpl.java:34)

                                  at service_pak.EJSLocal0SLDaoImpl_42d97f67.getSession(EJSLocal0SLDaoImpl_42d97f67.java)

                                  at service_pak.ServiceImpl.getTransactionManager(ServiceImpl.java:82)

                                  at service_pak.EJSLocal0SLServiceImpl_3d720e08.getTransactionManager(EJSLocal0SLServiceImpl_3d720e08.java)

                                  at integtation.IntegrationWebServiceImpl.getTransactionManagerClassName(IntegrationWebServiceImpl.java:49)

                                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)

                                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)

                                  at java.lang.reflect.Method.invoke(Method.java:611)

                                  at org.apache.axis2.jaxws.server.dispatcher.JavaDispatcher.invokeTargetOperation(JavaDispatcher.java:101)

                                  at com.ibm.ws.websvcs.server.dispatcher.EJBBeanDispatcher.invokeTargetOperation(EJBBeanDispatcher.java:192)

                                  at org.apache.axis2.jaxws.server.dispatcher.JavaBeanDispatcher.invoke(JavaBeanDispatcher.java:118)

                                  at com.ibm.ws.websvcs.server.dispatcher.EJBBeanDispatcher.invoke(EJBBeanDispatcher.java:80)

                                  at org.apache.axis2.jaxws.server.EndpointController.invoke(EndpointController.java:111)

                                  at org.apache.axis2.jaxws.server.JAXWSMessageReceiver.receive(JAXWSMessageReceiver.java:161)

                                  at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:208)

                                  at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:172)

                                  at com.ibm.ws.websvcs.transport.http.WASAxis2Servlet.doPost(WASAxis2Servlet.java:1517)

                                  at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)

                                  at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)

                                  at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1224)

                                  at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:774)

                                  at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:456)

                                  at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)

                                  at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1032)

                                  at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:87)

                                  at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:895)

                                  at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)

                                  at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:195)

                                  at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:452)

                                  at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:511)

                                  at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:305)

                                  at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)

                                  at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)

                                  at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)

                                  at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)

                                  at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)

                                  at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)

                                  at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)

                                  at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)

                                  at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1690)

                              Caused by: java.lang.IllegalStateException: Illegal attempt to enlist a 2PC XAResource

                                  at com.ibm.ws.tx.jta.TransactionImpl.enlistResource(TransactionImpl.java:1758)

                                  at org.infinispan.transaction.xa.XaTransactionTable.enlist(XaTransactionTable.java:97)

                                  ... 72 more

                               

                              That being said, ISPN 5+ can handle this situation.

                              Where am I wrong?

                              Thanks in advance.