java.io.NotSerializableException: org.infinispan.CacheDelegate
--------------------------------------------------------------
Key: ISPN-973
URL:
https://issues.jboss.org/browse/ISPN-973
Project: Infinispan
Issue Type: Bug
Components: Marshalling
Environment: JBOSS AS6, INFINISPAN 4.2.0
Reporter: Roshan Pradeep
Assignee: Manik Surtani
I have used infinispan cache in my code and below shows how I get it.
EmbeddedCacheManager cacheManager = new
DefaultCacheManager(GlobalConfiguration.getClusteredDefault());
Cache<String, Map<Long, List<Activity>>> cache =
cacheManager.getCache();
then cache.put and cache.get methods.
But when I running my application, I get the below exception to my server log file. I have
enable the following configurations.
In web.xml ==> <distributable />
In EJB beans ==> @CacheConfig(name="sfsb/sync")
Any help is very much appriciated. Thanks.
08:21:50,043 ERROR [InvocationContextInterceptor] Execution error: :
org.infinispan.CacheException: java.lang.RuntimeException: Failure to marshal argument(s)
at org.infinispan.util.Util.rewrapAsCacheException(Util.java:477)
[:4.2.0.FINAL]
at
org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher.invokeRemoteCommands(CommandAwareRpcDispatcher.java:123)
[:4.2.0.FINAL]
at
org.infinispan.remoting.transport.jgroups.JGroupsTransport.invokeRemotely(JGroupsTransport.java:399)
[:4.2.0.FINAL]
at
org.infinispan.remoting.rpc.RpcManagerImpl.invokeRemotely(RpcManagerImpl.java:101)
[:4.2.0.FINAL]
at
org.infinispan.remoting.rpc.RpcManagerImpl.invokeRemotely(RpcManagerImpl.java:125)
[:4.2.0.FINAL]
at
org.infinispan.remoting.rpc.RpcManagerImpl.invokeRemotely(RpcManagerImpl.java:230)
[:4.2.0.FINAL]
at
org.infinispan.remoting.rpc.RpcManagerImpl.invokeRemotely(RpcManagerImpl.java:217)
[:4.2.0.FINAL]
at
org.infinispan.remoting.rpc.RpcManagerImpl.broadcastRpcCommand(RpcManagerImpl.java:200)
[:4.2.0.FINAL]
at
org.infinispan.interceptors.ReplicationInterceptor.visitPrepareCommand(ReplicationInterceptor.java:63)
[:4.2.0.FINAL]
at
org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:120)
[:4.2.0.FINAL]
at
org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
[:4.2.0.FINAL]
at
org.infinispan.interceptors.LockingInterceptor.visitPrepareCommand(LockingInterceptor.java:134)
[:4.2.0.FINAL]
at
org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:120)
[:4.2.0.FINAL]
at
org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
[:4.2.0.FINAL]
at
org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:132)
[:4.2.0.FINAL]
at
org.infinispan.commands.AbstractVisitor.visitPrepareCommand(AbstractVisitor.java:106)
[:4.2.0.FINAL]
at
org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:120)
[:4.2.0.FINAL]
at
org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
[:4.2.0.FINAL]
at
org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:132)
[:4.2.0.FINAL]
at
org.infinispan.commands.AbstractVisitor.visitPrepareCommand(AbstractVisitor.java:106)
[:4.2.0.FINAL]
at
org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:120)
[:4.2.0.FINAL]
at
org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
[:4.2.0.FINAL]
at
org.infinispan.interceptors.NotificationInterceptor.visitPrepareCommand(NotificationInterceptor.java:48)
[:4.2.0.FINAL]
at
org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:120)
[:4.2.0.FINAL]
at
org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
[:4.2.0.FINAL]
at
org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:132)
[:4.2.0.FINAL]
at
org.infinispan.commands.AbstractVisitor.visitPrepareCommand(AbstractVisitor.java:106)
[:4.2.0.FINAL]
at
org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:120)
[:4.2.0.FINAL]
at
org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
[:4.2.0.FINAL]
at
org.infinispan.interceptors.TxInterceptor.visitPrepareCommand(TxInterceptor.java:101)
[:4.2.0.FINAL]
at
org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:120)
[:4.2.0.FINAL]
at
org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
[:4.2.0.FINAL]
at
org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:132)
[:4.2.0.FINAL]
at
org.infinispan.commands.AbstractVisitor.visitPrepareCommand(AbstractVisitor.java:106)
[:4.2.0.FINAL]
at
org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:120)
[:4.2.0.FINAL]
at
org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
[:4.2.0.FINAL]
at
org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:87)
[:4.2.0.FINAL]
at
org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:58)
[:4.2.0.FINAL]
at
org.infinispan.commands.AbstractVisitor.visitPrepareCommand(AbstractVisitor.java:106)
[:4.2.0.FINAL]
at
org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:120)
[:4.2.0.FINAL]
at
org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
[:4.2.0.FINAL]
at
org.infinispan.interceptors.BatchingInterceptor.handleDefault(BatchingInterceptor.java:76)
[:4.2.0.FINAL]
at
org.infinispan.commands.AbstractVisitor.visitPrepareCommand(AbstractVisitor.java:106)
[:4.2.0.FINAL]
at
org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:120)
[:4.2.0.FINAL]
at
org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:273)
[:4.2.0.FINAL]
at
org.infinispan.transaction.xa.TransactionXaAdapter.commit(TransactionXaAdapter.java:106)
[:4.2.0.FINAL]
at
org.infinispan.transaction.tm.DummyTransaction.runCommitTx(DummyTransaction.java:305)
[:4.2.0.FINAL]
at
org.infinispan.transaction.tm.DummyTransaction.commit(DummyTransaction.java:97)
[:4.2.0.FINAL]
at
org.infinispan.transaction.tm.DummyBaseTransactionManager.commit(DummyBaseTransactionManager.java:96)
[:4.2.0.FINAL]
at
org.infinispan.batch.BatchContainer.resolveTransaction(BatchContainer.java:130)
[:4.2.0.FINAL]
at org.infinispan.batch.BatchContainer.endBatch(BatchContainer.java:107)
[:4.2.0.FINAL]
at org.infinispan.batch.BatchContainer.endBatch(BatchContainer.java:92)
[:4.2.0.FINAL]
at org.infinispan.CacheDelegate.endBatch(CacheDelegate.java:389) [:4.2.0.FINAL]
at
org.infinispan.AbstractDelegatingCache.endBatch(AbstractDelegatingCache.java:47)
[:4.2.0.FINAL]
at
org.jboss.web.tomcat.service.session.distributedcache.ispn.DistributedCacheManager.batch(DistributedCacheManager.java:582)
[:1.0.0.Final]
at
org.jboss.web.tomcat.service.session.distributedcache.ispn.DistributedCacheManager.storeSessionData(DistributedCacheManager.java:222)
[:1.0.0.Final]
at
org.jboss.web.tomcat.service.session.ClusteredSession.processSessionReplication(ClusteredSession.java:1190)
[:6.0.0.Final]
at
org.jboss.web.tomcat.service.session.JBossCacheManager.processSessionRepl(JBossCacheManager.java:2301)
[:6.0.0.Final]
at
org.jboss.web.tomcat.service.session.JBossCacheManager.storeSession(JBossCacheManager.java:342)
[:6.0.0.Final]
at
org.jboss.web.tomcat.service.session.InstantSnapshotManager.snapshot(InstantSnapshotManager.java:50)
[:6.0.0.Final]
at
org.jboss.web.tomcat.service.session.ClusteredSessionValve.handleRequest(ClusteredSessionValve.java:147)
[:6.0.0.Final]
at
org.jboss.web.tomcat.service.session.ClusteredSessionValve.invoke(ClusteredSessionValve.java:94)
[:6.0.0.Final]
at
org.jboss.web.tomcat.service.session.JvmRouteValve.invoke(JvmRouteValve.java:88)
[:6.0.0.Final]
at
org.jboss.web.tomcat.service.session.LockingValve.invoke(LockingValve.java:62)
[:6.0.0.Final]
at
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88)
[:6.0.0.Final]
at
org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100)
[:6.0.0.Final]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
[:6.0.0.Final]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
[:6.0.0.Final]
at
org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
[:6.0.0.Final]
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
[:6.0.0.Final]
at
org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53)
[:6.0.0.Final]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362)
[:6.0.0.Final]
at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:504)
[:6.0.0.Final]
at
org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:437)
[:6.0.0.Final]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951)
[:6.0.0.Final]
at java.lang.Thread.run(Thread.java:619) [:1.6.0_20]
Caused by: java.lang.RuntimeException: Failure to marshal argument(s)
at
org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher$ReplicationTask.marshallCall(CommandAwareRpcDispatcher.java:243)
[:4.2.0.FINAL]
at
org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher$ReplicationTask.call(CommandAwareRpcDispatcher.java:270)
[:4.2.0.FINAL]
at
org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher.invokeRemoteCommands(CommandAwareRpcDispatcher.java:121)
[:4.2.0.FINAL]
... 74 more
Caused by: org.infinispan.CacheException: Unable to marshall value
AtomicHashMap{delegate=org.infinispan.util.FastCopyHashMap@6170241a}
at org.infinispan.marshall.MarshalledValue.serialize(MarshalledValue.java:100)
[:4.2.0.FINAL]
at org.infinispan.marshall.MarshalledValue.getRaw(MarshalledValue.java:156)
[:4.2.0.FINAL]
at
org.infinispan.marshall.MarshalledValue$Externalizer.writeObject(MarshalledValue.java:248)
[:4.2.0.FINAL]
at
org.infinispan.marshall.jboss.ConstantObjectTable$ExternalizerAdapter.writeObject(ConstantObjectTable.java:322)
[:4.2.0.FINAL]
at
org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:144)
[:6.0.0.Final]
at
org.jboss.marshalling.AbstractObjectOutput.writeObject(AbstractObjectOutput.java:62)
[:6.0.0.Final]
at
org.jboss.marshalling.AbstractMarshaller.writeObject(AbstractMarshaller.java:115)
[:6.0.0.Final]
at
org.infinispan.marshall.exts.ReplicableCommandExternalizer.writeObject(ReplicableCommandExternalizer.java:61)
[:4.2.0.FINAL]
at
org.infinispan.marshall.jboss.ConstantObjectTable$ExternalizerAdapter.writeObject(ConstantObjectTable.java:322)
[:4.2.0.FINAL]
at
org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:144)
[:6.0.0.Final]
at
org.jboss.marshalling.AbstractObjectOutput.writeObject(AbstractObjectOutput.java:62)
[:6.0.0.Final]
at
org.jboss.marshalling.AbstractMarshaller.writeObject(AbstractMarshaller.java:115)
[:6.0.0.Final]
at
org.infinispan.marshall.exts.ReplicableCommandExternalizer.writeObject(ReplicableCommandExternalizer.java:61)
[:4.2.0.FINAL]
at
org.infinispan.marshall.jboss.ConstantObjectTable$ExternalizerAdapter.writeObject(ConstantObjectTable.java:322)
[:4.2.0.FINAL]
at
org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:144)
[:6.0.0.Final]
at
org.jboss.marshalling.AbstractObjectOutput.writeObject(AbstractObjectOutput.java:62)
[:6.0.0.Final]
at
org.jboss.marshalling.AbstractMarshaller.writeObject(AbstractMarshaller.java:115)
[:6.0.0.Final]
at
org.infinispan.marshall.jboss.GenericJBossMarshaller.objectToObjectStream(GenericJBossMarshaller.java:98)
[:4.2.0.FINAL]
at
org.infinispan.marshall.VersionAwareMarshaller.objectToBuffer(VersionAwareMarshaller.java:93)
[:4.2.0.FINAL]
at
org.infinispan.marshall.AbstractMarshaller.objectToBuffer(AbstractMarshaller.java:31)
[:4.2.0.FINAL]
at
org.infinispan.remoting.transport.jgroups.MarshallerAdapter.objectToBuffer(MarshallerAdapter.java:22)
[:4.2.0.FINAL]
at
org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher$ReplicationTask.marshallCall(CommandAwareRpcDispatcher.java:240)
[:4.2.0.FINAL]
... 76 more
Caused by: java.io.NotSerializableException: org.infinispan.CacheDelegate
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
[:1.6.0_20]
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
[:1.6.0_20]
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
[:1.6.0_20]
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
[:1.6.0_20]
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
[:1.6.0_20]
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
[:1.6.0_20]
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
[:1.6.0_20]
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
[:1.6.0_20]
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
[:1.6.0_20]
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
[:1.6.0_20]
at java.util.HashMap.writeObject(HashMap.java:1001) [:1.6.0_20]
at sun.reflect.GeneratedMethodAccessor338.invoke(Unknown Source) [:1.6.0_20]
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[:1.6.0_20]
at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_20]
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
[:1.6.0_20]
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1461)
[:1.6.0_20]
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
[:1.6.0_20]
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
[:1.6.0_20]
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
[:1.6.0_20]
at
org.jboss.ha.framework.server.SimpleCachableMarshalledValue.serialize(SimpleCachableMarshalledValue.java:356)
[:2.0.0.Final]
at
org.jboss.ha.framework.server.SimpleCachableMarshalledValue.writeExternal(SimpleCachableMarshalledValue.java:337)
[:2.0.0.Final]
at
org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:827)
[:6.0.0.Final]
at
org.jboss.marshalling.AbstractObjectOutput.writeObject(AbstractObjectOutput.java:62)
[:6.0.0.Final]
at
org.jboss.marshalling.AbstractMarshaller.writeObject(AbstractMarshaller.java:115)
[:6.0.0.Final]
at org.infinispan.marshall.MarshallUtil.marshallMap(MarshallUtil.java:59)
[:4.2.0.FINAL]
at
org.infinispan.marshall.exts.MapExternalizer.writeObject(MapExternalizer.java:61)
[:4.2.0.FINAL]
at
org.infinispan.marshall.jboss.ConstantObjectTable$ExternalizerAdapter.writeObject(ConstantObjectTable.java:322)
[:4.2.0.FINAL]
at
org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:144)
[:6.0.0.Final]
at
org.jboss.marshalling.AbstractObjectOutput.writeObject(AbstractObjectOutput.java:62)
[:6.0.0.Final]
at
org.jboss.marshalling.AbstractMarshaller.writeObject(AbstractMarshaller.java:115)
[:6.0.0.Final]
at
org.infinispan.atomic.AtomicHashMap$Externalizer.writeObject(AtomicHashMap.java:218)
[:4.2.0.FINAL]
at
org.infinispan.marshall.jboss.ConstantObjectTable$ExternalizerAdapter.writeObject(ConstantObjectTable.java:322)
[:4.2.0.FINAL]
at
org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:144)
[:6.0.0.Final]
at
org.jboss.marshalling.AbstractObjectOutput.writeObject(AbstractObjectOutput.java:62)
[:6.0.0.Final]
at
org.jboss.marshalling.AbstractMarshaller.writeObject(AbstractMarshaller.java:115)
[:6.0.0.Final]
at
org.infinispan.marshall.jboss.GenericJBossMarshaller.objectToObjectStream(GenericJBossMarshaller.java:98)
[:4.2.0.FINAL]
at
org.infinispan.marshall.VersionAwareMarshaller.objectToObjectStream(VersionAwareMarshaller.java:150)
[:4.2.0.FINAL]
at org.infinispan.marshall.MarshalledValue.serialize(MarshalledValue.java:91)
[:4.2.0.FINAL]
... 97 more
Caused by: an exception which occurred:
in object org.jboss.ha.framework.server.SimpleCachableMarshalledValue@7fffffff
in object org.infinispan.util.FastCopyHashMap@6170241a
in object org.infinispan.atomic.AtomicHashMap@18f2a219
in object org.infinispan.marshall.MarshalledValue@18f2a219
in object org.infinispan.commands.write.PutKeyValueCommand@5da5ffab
in object org.infinispan.commands.tx.PrepareCommand@c7f33a0d
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira