5 Replies Latest reply on May 4, 2016 2:46 PM by Tendai Munetsi

    ISPN000136: Execution error: java.lang.ClassCastException: org.infinispan.commands.tx.PrepareCommand cannot be cast to org.infinispan.commands.tx.VersionedPrepareCommand

    Tendai Munetsi Newbie

      I am receiving the error above (stack trace below) running WildFly 9.0.2 with the included Infinispan 7.2.3 module. I am attempting to configure a replicated cache using 'NON_DURABLE_XA' transactions with 'OPTIMISTIC' locking between two standalone-ha instances. The exception is generated on the second instance when an attempt to store a value is made on the first instance. Below is the stack trace and the relevant pieces of the configuration. Any ideas?

       

      ====== stack trace =====

      12:28:08,235 ERROR [org.infinispan.interceptors.InvocationContextInterceptor] (remote-thread--p8-t1) ISPN000136: Execution error: java.lang.ClassCastException: org.infinispan.commands.tx.PrepareCommand cannot be cast to org.infinispan.commands.tx.VersionedPrepareCommand

        at org.infinispan.interceptors.VersionedEntryWrappingInterceptor.visitPrepareCommand(VersionedEntryWrappingInterceptor.java:53)

        at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

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

        at org.infinispan.interceptors.locking.AbstractTxLockingInterceptor.invokeNextAndCommitIf1Pc(AbstractTxLockingInterceptor.java:96)

        at org.infinispan.interceptors.locking.OptimisticLockingInterceptor.visitPrepareCommand(OptimisticLockingInterceptor.java:91)

        at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

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

        at org.infinispan.interceptors.NotificationInterceptor.visitPrepareCommand(NotificationInterceptor.java:36)

        at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

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

        at org.infinispan.interceptors.TxInterceptor.invokeNextInterceptorAndVerifyTransaction(TxInterceptor.java:138)

        at org.infinispan.interceptors.TxInterceptor.visitPrepareCommand(TxInterceptor.java:125)

        at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

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

        at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:111)

        at org.infinispan.commands.AbstractVisitor.visitPrepareCommand(AbstractVisitor.java:123)

        at org.infinispan.statetransfer.TransactionSynchronizerInterceptor.visitPrepareCommand(TransactionSynchronizerInterceptor.java:39)

        at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

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

        at org.infinispan.statetransfer.StateTransferInterceptor.handleTxCommand(StateTransferInterceptor.java:200)

        at org.infinispan.statetransfer.StateTransferInterceptor.visitPrepareCommand(StateTransferInterceptor.java:88)

        at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

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

        at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:111)

        at org.infinispan.commands.AbstractVisitor.visitPrepareCommand(AbstractVisitor.java:123)

        at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

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

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

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

        at org.infinispan.commands.AbstractVisitor.visitPrepareCommand(AbstractVisitor.java:123)

        at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

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

        at org.infinispan.commands.tx.PrepareCommand.perform(PrepareCommand.java:113)

        at org.infinispan.remoting.inboundhandler.BasePerCacheInboundInvocationHandler.invokePerform(BasePerCacheInboundInvocationHandler.java:85)

        at org.infinispan.remoting.inboundhandler.BaseBlockingRunnable.run(BaseBlockingRunnable.java:32)

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

        at java.lang.Thread.run(Thread.java:745)

       

      12:28:08,236 WARN  [org.infinispan.remoting.inboundhandler.NonTotalOrderPerCacheInboundInvocationHandler] (remote-thread--p8-t1) ISPN000071: Caught exception when handling command PrepareCommand {modifications=[PutKeyValueCommand{key=1, value=AviationAccident [eventId=1111111, investigationType=null, accidentNumber=FA123456, eventDate=11/04/2015], flags=null, putIfAbsent=false, valueMatcher=MATCH_ALWAYS, metadata=EmbeddedMetadata{version=null}, successful=true}], onePhaseCommit=false, gtx=GlobalTransaction:<silver1>:14:remote, cacheName='dist', topologyId=2}: java.lang.ClassCastException: org.infinispan.commands.tx.PrepareCommand cannot be cast to org.infinispan.commands.tx.VersionedPrepareCommand

        at org.infinispan.interceptors.VersionedEntryWrappingInterceptor.visitPrepareCommand(VersionedEntryWrappingInterceptor.java:53)

        at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

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

        at org.infinispan.interceptors.locking.AbstractTxLockingInterceptor.invokeNextAndCommitIf1Pc(AbstractTxLockingInterceptor.java:96)

        at org.infinispan.interceptors.locking.OptimisticLockingInterceptor.visitPrepareCommand(OptimisticLockingInterceptor.java:91)

        at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

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

        at org.infinispan.interceptors.NotificationInterceptor.visitPrepareCommand(NotificationInterceptor.java:36)

        at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

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

        at org.infinispan.interceptors.TxInterceptor.invokeNextInterceptorAndVerifyTransaction(TxInterceptor.java:138)

        at org.infinispan.interceptors.TxInterceptor.visitPrepareCommand(TxInterceptor.java:125)

        at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

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

        at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:111)

        at org.infinispan.commands.AbstractVisitor.visitPrepareCommand(AbstractVisitor.java:123)

        at org.infinispan.statetransfer.TransactionSynchronizerInterceptor.visitPrepareCommand(TransactionSynchronizerInterceptor.java:39)

        at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

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

        at org.infinispan.statetransfer.StateTransferInterceptor.handleTxCommand(StateTransferInterceptor.java:200)

        at org.infinispan.statetransfer.StateTransferInterceptor.visitPrepareCommand(StateTransferInterceptor.java:88)

        at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

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

        at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:111)

        at org.infinispan.commands.AbstractVisitor.visitPrepareCommand(AbstractVisitor.java:123)

        at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

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

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

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

        at org.infinispan.commands.AbstractVisitor.visitPrepareCommand(AbstractVisitor.java:123)

        at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

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

        at org.infinispan.commands.tx.PrepareCommand.perform(PrepareCommand.java:113)

        at org.infinispan.remoting.inboundhandler.BasePerCacheInboundInvocationHandler.invokePerform(BasePerCacheInboundInvocationHandler.java:85)

        at org.infinispan.remoting.inboundhandler.BaseBlockingRunnable.run(BaseBlockingRunnable.java:32)

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

        at java.lang.Thread.run(Thread.java:745)

      ====== END OF stack trace =========

       

      ===== Cache configuration ===========

      <cache-container name="FARR" default-cache="dist" module="org.infinispan">

          <transport lock-timeout="60000"/>

          <replicated-cache name="dist" mode="SYNC" >

              <locking isolation="REPEATABLE_READ"/>

              <transaction mode="NON_DURABLE_XA" locking="OPTIMISTIC"/>

          </replicated-cache>

      </cache-container>

       

      ====== code that inserts value into cache =====

        if (!cache.containsKey((Object)"1")) {

             AviationAccident accident = new AviationAccident();

             accident.setEventId("1111111");

             accident.setAccidentNumber("FA123456");

             accident.setEventDate("11/15/2015");

             cache.put("1", accident);

             System.out.println("Inserted cache object: " + accident);

             if (cache.get("1") != null) {

                  System.out.println("Retrieved cache object: " + accident);

             } else {

                  System.out.println("Cannot retrieve inserted cache object: " + accident);

             }

        } else {

        AviationAccident accident = (AviationAccident)cacheObj;

        System.out.println("Found cache object: " + accident);

        }

        • 2. Re: ISPN000136: Execution error: java.lang.ClassCastException: org.infinispan.commands.tx.PrepareCommand cannot be cast to org.infinispan.commands.tx.VersionedPrepareCommand
          Tendai Munetsi Newbie

          Hi Pedro,

          Below is the stack trace from the first instance.

           

          ==== stack trace from instance1 =====

           

          16:24:09,965 TRACE [org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher] (default task-4) Responses: [sender=silver2, retval=ExceptionResponse, received=true, suspected=false]

           

          16:24:09,966 TRACE [org.infinispan.remoting.rpc.RpcManagerImpl] (default task-4) replication exception: : org.infinispan.remoting.RemoteException: ISPN000217: Received exception from silver2, see cause for remote stack trace

            at org.infinispan.remoting.transport.AbstractTransport.checkResponse(AbstractTransport.java:46)

            at org.infinispan.remoting.transport.AbstractTransport.parseResponseAndAddToResponseList(AbstractTransport.java:71)

            at org.infinispan.remoting.transport.jgroups.JGroupsTransport.invokeRemotely(JGroupsTransport.java:586)

            at org.infinispan.remoting.rpc.RpcManagerImpl.invokeRemotely(RpcManagerImpl.java:287)

            at org.infinispan.interceptors.distribution.TxDistributionInterceptor.prepareOnAffectedNodes(TxDistributionInterceptor.java:222)

            at org.infinispan.interceptors.distribution.TxDistributionInterceptor.visitPrepareCommand(TxDistributionInterceptor.java:206)

            at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

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

            at org.infinispan.interceptors.EntryWrappingInterceptor.visitPrepareCommand(EntryWrappingInterceptor.java:102)

            at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

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

            at org.infinispan.interceptors.locking.AbstractTxLockingInterceptor.invokeNextAndCommitIf1Pc(AbstractTxLockingInterceptor.java:96)

            at org.infinispan.interceptors.locking.OptimisticLockingInterceptor.visitPrepareCommand(OptimisticLockingInterceptor.java:91)

            at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

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

            at org.infinispan.interceptors.NotificationInterceptor.visitPrepareCommand(NotificationInterceptor.java:36)

            at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

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

            at org.infinispan.interceptors.TxInterceptor.invokeNextInterceptorAndVerifyTransaction(TxInterceptor.java:138)

            at org.infinispan.interceptors.TxInterceptor.visitPrepareCommand(TxInterceptor.java:125)

            at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

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

            at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:111)

            at org.infinispan.commands.AbstractVisitor.visitPrepareCommand(AbstractVisitor.java:123)

            at org.infinispan.statetransfer.TransactionSynchronizerInterceptor.visitPrepareCommand(TransactionSynchronizerInterceptor.java:42)

            at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

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

            at org.infinispan.statetransfer.StateTransferInterceptor.handleTxCommand(StateTransferInterceptor.java:200)

            at org.infinispan.statetransfer.StateTransferInterceptor.visitPrepareCommand(StateTransferInterceptor.java:88)

            at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

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

            at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:111)

            at org.infinispan.commands.AbstractVisitor.visitPrepareCommand(AbstractVisitor.java:123)

            at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

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

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

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

            at org.infinispan.commands.AbstractVisitor.visitPrepareCommand(AbstractVisitor.java:123)

            at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

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

            at org.infinispan.transaction.impl.TransactionCoordinator.prepare(TransactionCoordinator.java:121)

            at org.infinispan.transaction.impl.TransactionCoordinator.prepare(TransactionCoordinator.java:104)

            at org.infinispan.transaction.synchronization.SynchronizationAdapter.beforeCompletion(SynchronizationAdapter.java:44)

            at org.jboss.as.txn.service.internal.tsr.JCAOrderedLastSynchronizationList.beforeCompletion(JCAOrderedLastSynchronizationList.java:116)

            at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:76)

            at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:371)

            at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:91)

            at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:162)

            at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1200)

            at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:126)

            at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:75)

            at org.infinispan.cache.impl.CacheImpl.tryCommit(CacheImpl.java:1667)

            at org.infinispan.cache.impl.CacheImpl.executeCommandAndCommitIfNeeded(CacheImpl.java:1624)

            at org.infinispan.cache.impl.CacheImpl.putInternal(CacheImpl.java:1097)

            at org.infinispan.cache.impl.CacheImpl.put(CacheImpl.java:1089)

            at org.infinispan.cache.impl.CacheImpl.put(CacheImpl.java:1688)

            at org.infinispan.cache.impl.CacheImpl.put(CacheImpl.java:253)

            at org.infinispan.cache.impl.AbstractDelegatingCache.put(AbstractDelegatingCache.java:292)

            at com.openlogic.support.singleton.CacheSingleton.getNextInt(CacheSingleton.java:54)

            at com.openlogic.support.singleton.CacheSingleton$Proxy$_$$_WeldClientProxy.getNextInt(Unknown Source)

            at com.openlogic.support.test.faces.RequestBean.save(RequestBean.java:67)

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

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

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

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

            at com.sun.el.parser.AstValue.invoke(AstValue.java:292)

            at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:304)

            at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:40)

            at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50)

            at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:40)

            at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50)

            at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)

            at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:87)

            at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)

            at javax.faces.component.UICommand.broadcast(UICommand.java:315)

            at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790)

            at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1282)

            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:198)

            at javax.faces.webapp.FacesServlet.service(FacesServlet.java:658)

            at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:86)

            at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)

            at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)

            at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)

            at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

            at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)

            at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)

            at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

            at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)

            at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)

            at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58)

            at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:72)

            at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)

            at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76)

            at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

            at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)

            at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

            at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

            at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:282)

            at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:261)

            at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:80)

            at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:172)

            at io.undertow.server.Connectors.executeRootHandler(Connectors.java:199)

            at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:774)

            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

            at java.lang.Thread.run(Thread.java:745)

          Caused by: java.lang.ClassCastException: org.infinispan.commands.tx.PrepareCommand cannot be cast to org.infinispan.commands.tx.VersionedPrepareCommand

            at org.infinispan.interceptors.VersionedEntryWrappingInterceptor.visitPrepareCommand(VersionedEntryWrappingInterceptor.java:53)

            at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

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

            at org.infinispan.interceptors.locking.AbstractTxLockingInterceptor.invokeNextAndCommitIf1Pc(AbstractTxLockingInterceptor.java:96)

            at org.infinispan.interceptors.locking.OptimisticLockingInterceptor.visitPrepareCommand(OptimisticLockingInterceptor.java:91)

            at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

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

            at org.infinispan.interceptors.NotificationInterceptor.visitPrepareCommand(NotificationInterceptor.java:36)

            at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

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

            at org.infinispan.interceptors.TxInterceptor.invokeNextInterceptorAndVerifyTransaction(TxInterceptor.java:138)

            at org.infinispan.interceptors.TxInterceptor.visitPrepareCommand(TxInterceptor.java:125)

            at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

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

            at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:111)

            at org.infinispan.commands.AbstractVisitor.visitPrepareCommand(AbstractVisitor.java:123)

            at org.infinispan.statetransfer.TransactionSynchronizerInterceptor.visitPrepareCommand(TransactionSynchronizerInterceptor.java:39)

            at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

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

            at org.infinispan.statetransfer.StateTransferInterceptor.handleTxCommand(StateTransferInterceptor.java:200)

            at org.infinispan.statetransfer.StateTransferInterceptor.visitPrepareCommand(StateTransferInterceptor.java:88)

            at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

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

            at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:111)

            at org.infinispan.commands.AbstractVisitor.visitPrepareCommand(AbstractVisitor.java:123)

            at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

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

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

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

            at org.infinispan.commands.AbstractVisitor.visitPrepareCommand(AbstractVisitor.java:123)

            at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

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

            at org.infinispan.commands.tx.PrepareCommand.perform(PrepareCommand.java:113)

            at org.infinispan.remoting.inboundhandler.BasePerCacheInboundInvocationHandler.invokePerform(BasePerCacheInboundInvocationHandler.java:85)

            at org.infinispan.remoting.inboundhandler.BaseBlockingRunnable.run(BaseBlockingRunnable.java:32)

            ... 3 more

          • 3. Re: ISPN000136: Execution error: java.lang.ClassCastException: org.infinispan.commands.tx.PrepareCommand cannot be cast to org.infinispan.commands.tx.VersionedPrepareCommand
            Pedro Ruivo Novice

            Hi Tendai,

             

            Check your configuration for instance 1. It is not using the same configuration as instance 2. From the stack trace, instance 1 is using NON_XA instead of NON_DURABLE_XA.

             

            Cheers,

            Pedro

            • 4. Re: ISPN000136: Execution error: java.lang.ClassCastException: org.infinispan.commands.tx.PrepareCommand cannot be cast to org.infinispan.commands.tx.VersionedPrepareCommand
              Tendai Munetsi Newbie

              Hi Pedro,

              Thanks for the quick response. Can you show the line(s) in the stack trace that indicate the transaction mode mis-match between the two instances? I have since ensured that the cache configurations are the same on both instances 'NON_DURABLE_XA' and I still get the ClassCastException.

              • 5. Re: ISPN000136: Execution error: java.lang.ClassCastException: org.infinispan.commands.tx.PrepareCommand cannot be cast to org.infinispan.commands.tx.VersionedPrepareCommand
                Tendai Munetsi Newbie

                Hi Pedro,

                Upon further investigation, I did find the configuration differences in isolation level between the two instances. One had REAPEABLE_READ, while the other was set to READ_COMMITTED. Setting them to the same fixed the issue. Thanks!