2 Replies Latest reply on Jan 4, 2017 1:46 AM by Sreela Gopi

    ISPN000188: Error while processing a commit in a two-phase transaction in JBoss EAP 6.4.6

    Sreela Gopi Newbie

      Hello,

       

      I have enabled session replication in my web application. But replication of session is not happening, giving the below error in the logs. Could anyone please help what I am missing?

       

      ERROR [org.infinispan.transaction.TransactionCoordinator] (http-/127.0.0.1:8080-1) ISPN000188: Error while processing a commit in a two-phase transaction: o

      rg.infinispan.marshall.NotSerializableException: java.lang.Object

      Caused by: an exception which occurred:

              in field mutex

              in object java.util.HashMap@f885ff55

              in object org.jboss.as.clustering.SimpleMarshalledValue@f885ff55

              in object org.infinispan.util.FastCopyHashMap@594812e

              in object org.infinispan.atomic.AtomicHashMap@39ec241c

              in object org.infinispan.container.entries.ImmortalCacheEntry@640f4d24

              in object org.infinispan.loaders.bucket.Bucket@2f84c387

       

       

      17:44:57,219 ERROR [org.infinispan.transaction.tm.DummyTransaction] (http-/127.0.0.1:8080-1) ISPN000111: afterCompletion() failed for SynchronizationAdapter{localTransac

      tion=LocalTransaction{remoteLockedNodes=null, isMarkedForRollback=false, lockedKeys=null, backupKeyLocks=null, topologyId=-1, isFromStateTransfer=false} org.infinispan.t

      ransaction.synchronization.SyncLocalTransaction@3c} org.infinispan.transaction.synchronization.SynchronizationAdapter@5b: org.infinispan.CacheException: Could not commit

      .

              at org.infinispan.transaction.synchronization.SynchronizationAdapter.afterCompletion(SynchronizationAdapter.java:83)

              at org.infinispan.transaction.tm.DummyTransaction.notifyAfterCompletion(DummyTransaction.java:285)

              at org.infinispan.transaction.tm.DummyTransaction.runCommitTx(DummyTransaction.java:334)

              at org.infinispan.transaction.tm.DummyTransaction.commit(DummyTransaction.java:91)

              at org.infinispan.transaction.tm.DummyBaseTransactionManager.commit(DummyBaseTransactionManager.java:102)

              at org.jboss.as.clustering.web.impl.TransactionBatchingManager.endBatch(TransactionBatchingManager.java:75)

              at org.jboss.as.web.session.DistributableSessionManager.processSessionRepl(DistributableSessionManager.java:1574) [jboss-as-web-7.5.6.Final-redhat-2.jar:7.5.6.Fi

      nal-redhat-2]

              at org.jboss.as.web.session.DistributableSessionManager.storeSession(DistributableSessionManager.java:872) [jboss-as-web-7.5.6.Final-redhat-2.jar:7.5.6.Final-red

      hat-2]

              at org.jboss.as.web.session.InstantSnapshotManager.snapshot(InstantSnapshotManager.java:47) [jboss-as-web-7.5.6.Final-redhat-2.jar:7.5.6.Final-redhat-2]

              at org.jboss.as.web.session.ClusteredSessionValve.handleRequest(ClusteredSessionValve.java:142) [jboss-as-web-7.5.6.Final-redhat-2.jar:7.5.6.Final-redhat-2]

              at org.jboss.as.web.session.ClusteredSessionValve.invoke(ClusteredSessionValve.java:99) [jboss-as-web-7.5.6.Final-redhat-2.jar:7.5.6.Final-redhat-2]

              at org.jboss.as.web.session.JvmRouteValve.invoke(JvmRouteValve.java:92) [jboss-as-web-7.5.6.Final-redhat-2.jar:7.5.6.Final-redhat-2]

              at org.jboss.as.web.session.LockingValve.invoke(LockingValve.java:64) [jboss-as-web-7.5.6.Final-redhat-2.jar:7.5.6.Final-redhat-2]

              at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.5.6.Final-redhat-2.jar:7.5.6.Final-redhat-2]

              at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.5.6.Final-redhat-2.jar:7.5.6.Final-redhat-2]

              at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169) [jboss-as-web-7.5.6.Final-redhat-2.jar:7.5.6.Final-

      redhat-2]

              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:150) [jbossweb-7.5.12.Final-redhat-1.jar:7.5.12.Final-redhat-1]

              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) [jbossweb-7.5.12.Final-redhat-1.jar:7.5.12.Final-redhat-1]

              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) [jbossweb-7.5.12.Final-redhat-1.jar:7.5.12.Final-redhat-1]

              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344) [jbossweb-7.5.12.Final-redhat-1.jar:7.5.12.Final-redhat-1]

              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:854) [jbossweb-7.5.12.Final-redhat-1.jar:7.5.12.Final-redhat-1]

              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653) [jbossweb-7.5.12.Final-redhat-1.jar:7.5.12.Final-redhat-1]

              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:926) [jbossweb-7.5.12.Final-redhat-1.jar:7.5.12.Final-redhat-1]

              at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_101]

      Caused by: javax.transaction.xa.XAException

              at org.infinispan.transaction.TransactionCoordinator.handleCommitFailure(TransactionCoordinator.java:224)

              at org.infinispan.transaction.TransactionCoordinator.commit(TransactionCoordinator.java:185)

              at org.infinispan.transaction.synchronization.SynchronizationAdapter.afterCompletion(SynchronizationAdapter.java:81)

              ... 23 more

        • 1. Re: ISPN000188: Error while processing a commit in a two-phase transaction in JBoss EAP 6.4.6
          Anup Dey Apprentice

          Hi,

           

          - This will occur whenever a non-serializable class resides in the session and the session is replicated. JBoss has no way to serialize a class that does not implement Serializable. It will therefore throw an exception.

           

          - Note that clustering will not work properly if this issue is not resolved. The purpose of clustering is to achieve high availability. High availability is achieved through replication.

           

           

          1. Make sure all classes put in the session are Serializable.
          2. All members of a Serializable class must also be Serializable or marked as transient.
          3. Disable clustering to avoid session replication.

           

          - If an object in the session has a log4j Logger in it, but the Log4J Loggers are not serializable you can do one of two things:

           

          1. Mark the logger as transient ( if you are using a separate logger for each instance)
          2. Mark the logger as static

           

          Ideally, you should also use "Externalizable" or "AdvancedExternalizer" to optimize serialization of your objects. See: Infinispan 6.0 User Guide

           

          - Some code is attempting to allocate a large object that is too large to ever possibly fit in the configured heap space.

          - Increase heap size for the large allocation to fit or address any code issues resulting in undesirably large allocation attempts

           

           

          1 of 1 people found this helpful
          • 2. Re: ISPN000188: Error while processing a commit in a two-phase transaction in JBoss EAP 6.4.6
            Sreela Gopi Newbie

            Hello Anup,

             

            Thank you very much for the answer. Let me recheck if all of my classes are serializable or not, or missed any.