5 Replies Latest reply on Nov 17, 2006 12:13 PM by Manik Surtani

    ClassCastException during cache replication

    Matt Accola Newbie

      I am using Hibernate 3.2 ga with JBoss TreeCache 1.3.0.SP2. The application is clustered and I have setup the cache for REPL_SYNC. I am now getting the following stack trace on the target machine when the cache replications occur. This only seems to occur when I enable HTTP session replication on the web container I am using. (The HTTP session replication is a separate process from the JBoss/JGroups replication.) Any ideas?


      ERROR [Thread-41] (org.jboss.cache.interceptors.OrderedSynchronizationHandler:83) 2006-11-9 22:40:51,468 - failed calling afterCompletion() on TxInterceptor.RemoteSynchronizationHandler(gtx=GlobalTransaction:<127.0.0.1:3082>:30, tx=com.ibm.ws.Transaction.JTA.TransactionImpl@28802880#tid=678)
      java.lang.RuntimeException: Commit failed, marking tx to be rolled back.
      at org.jboss.cache.interceptors.TxInterceptor.runCommitPhase(TxInterceptor.java:700)
      at org.jboss.cache.interceptors.TxInterceptor$RemoteSynchronizationHandler.afterCompletion(TxInterceptor.java:983)
      at org.jboss.cache.interceptors.OrderedSynchronizationHandler.afterCompletion(OrderedSynchronizationHandler.java:80)
      at com.ibm.ws.Transaction.JTA.RegisteredSyncs.distributeAfter(RegisteredSyncs.java:423)
      at com.ibm.ws.Transaction.JTA.TransactionImpl.distributeAfter(TransactionImpl.java:3803)
      at com.ibm.ws.Transaction.JTA.TransactionImpl.postCompletion(TransactionImpl.java:3782)
      at com.ibm.ws.Transaction.JTA.TransactionImpl.prepareResources(TransactionImpl.java:2160)
      at com.ibm.ws.Transaction.JTA.TransactionImpl.stage1CommitProcessing(TransactionImpl.java:1621)
      at com.ibm.ws.Transaction.JTA.TransactionImpl.processCommit(TransactionImpl.java:1577)
      at com.ibm.ws.Transaction.JTA.TransactionImpl.commit(TransactionImpl.java:1512)
      at com.ibm.ws.Transaction.JTA.TranManagerImpl.commit(TranManagerImpl.java:237)
      at com.ibm.ws.Transaction.JTA.TranManagerSet.commit(TranManagerSet.java:162)
      at org.jboss.cache.interceptors.TxInterceptor.handleRemoteCommitRollback(TxInterceptor.java:570)
      at org.jboss.cache.interceptors.TxInterceptor.invoke(TxInterceptor.java:126)
      at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:67)
      at org.jboss.cache.interceptors.CacheMgmtInterceptor.invoke(CacheMgmtInterceptor.java:181)
      at org.jboss.cache.TreeCache.invokeMethod(TreeCache.java:4804)
      at org.jboss.cache.TreeCache._replicate(TreeCache.java:4366)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:615)
      at org.jgroups.blocks.MethodCall.invoke(MethodCall.java:286)
      at org.jgroups.blocks.RpcDispatcher.handle(RpcDispatcher.java:236)
      at org.jgroups.blocks.RequestCorrelator.handleRequest(RequestCorrelator.java:618)
      at org.jgroups.blocks.RequestCorrelator.receiveMessage(RequestCorrelator.java:515)
      at org.jgroups.blocks.RequestCorrelator.receive(RequestCorrelator.java:326)
      at org.jgroups.blocks.MessageDispatcher$ProtocolAdapter.handleUp(MessageDispatcher.java:734)
      at org.jgroups.blocks.MessageDispatcher$ProtocolAdapter.access$300(MessageDispatcher.java:566)
      at org.jgroups.blocks.MessageDispatcher$1.run(MessageDispatcher.java:703)
      at java.lang.Thread.run(Thread.java:797)
      Caused by:
      java.lang.ClassCastException: org.hibernate.cacheb.OptimisticTreeCache$NonLockingDataVersion incompatible with org.jboss.cache.optimistic.DefaultDataVersion
      at org.jboss.cache.interceptors.OptimisticValidatorInterceptor.commit(OptimisticValidatorInterceptor.java:212)
      at org.jboss.cache.interceptors.OptimisticValidatorInterceptor.invoke(OptimisticValidatorInterceptor.java:68)
      at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:67)
      at org.jboss.cache.interceptors.OptimisticLockingInterceptor.invoke(OptimisticLockingInterceptor.java:96)
      at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:67)
      at org.jboss.cache.interceptors.OptimisticReplicationInterceptor.invoke(OptimisticReplicationInterceptor.java:102)
      at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:67)
      at org.jboss.cache.interceptors.TxInterceptor.handleCommitRollback(TxInterceptor.java:643)
      at org.jboss.cache.interceptors.TxInterceptor.runCommitPhase(TxInterceptor.java:687)
      ... 30 more