3 Replies Latest reply on Sep 29, 2009 3:14 AM by Galder Zamarreño

    Searching for user data serialization info

    Michal Galet Newbie

      Hi,
      the Infinispan project looks awesome and I am looking forward for next releases!

      I am searching currently for some information regarding data serialization when transferring the entries to another node. Has anything been written on that? Do you need to explicitly specify the serialization somehow?

      My problem is that everything works fine for strings, however when I try to use cache in clustered mode with my custom data structure I get:
      java.lang.RuntimeException: Failure to marshal argument(s)
      ...
      Caused by: java.io.NotActiveException: Fields were never written

      The data structure I am trying to store implements Serializable/Externalizable.

      Thanks for any help!

      Michal

        • 1. Re: Searching for user data serialization info
          Galder Zamarreño Master

          Hi galet, would it be possible for you to show the full stacktrace and the custom class that you're trying to sent around?

          • 2. Re: Searching for user data serialization info
            Michal Galet Newbie

            Sorry for the late reply. I tried to modify the gui demo application to store 'new Date()' under a given key and I run into the same problem with serializing the data. If there is only 1 node it works fine. When I add another one to the cluster it fails.

            Is there any example that stores something else than a simple String?

            The full stack trace:

            Exception in thread "pool-1-thread-1" org.infinispan.CacheException: java.lang.RuntimeException: Fai
            lure to marshal argument(s)
             at org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher.invokeRemoteCommands(
            CommandAwareRpcDispatcher.java:112)
             at org.infinispan.remoting.transport.jgroups.JGroupsTransport.invokeRemotely(JGroupsTranspor
            t.java:305)
             at org.infinispan.remoting.rpc.RpcManagerImpl.invokeRemotely(RpcManagerImpl.java:88)
             at org.infinispan.remoting.rpc.RpcManagerImpl.invokeRemotely(RpcManagerImpl.java:107)
             at org.infinispan.remoting.rpc.RpcManagerImpl.invokeRemotely(RpcManagerImpl.java:214)
             at org.infinispan.remoting.rpc.RpcManagerImpl.invokeRemotely(RpcManagerImpl.java:201)
             at org.infinispan.remoting.rpc.RpcManagerImpl.invokeRemotely(RpcManagerImpl.java:197)
             at org.infinispan.interceptors.DistributionInterceptor.handleWriteCommand(DistributionInterc
            eptor.java:291)
             at org.infinispan.interceptors.DistributionInterceptor.visitPutKeyValueCommand(DistributionI
            nterceptor.java:145)
             at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:77
            )
             at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandIntercep
            tor.java:118)
             at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java
            :132)
             at org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:57)
             at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:77
            )
             at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandIntercep
            tor.java:118)
             at org.infinispan.interceptors.TxInterceptor.enlistWriteAndInvokeNext(TxInterceptor.java:179
            )
             at org.infinispan.interceptors.TxInterceptor.visitPutKeyValueCommand(TxInterceptor.java:126)
            
             at org.infinispan.interceptors.DistTxInterceptor.visitPutKeyValueCommand(DistTxInterceptor.j
            ava:76)
             at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:77
            )
             at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandIntercep
            tor.java:118)
             at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInter
            ceptor.java:48)
             at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextI
            nterceptor.java:34)
             at org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:57)
             at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:77
            )
             at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:237)
             at org.infinispan.CacheDelegate.put(CacheDelegate.java:326)
             at org.infinispan.CacheDelegate.put(CacheDelegate.java:544)
             at org.infinispan.demo.InfinispanDemo$2$1.run(InfinispanDemo.java:137)
             at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
             at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
             at java.lang.Thread.run(Unknown Source)
            Caused by: java.lang.RuntimeException: Failure to marshal argument(s)
             at org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher$ReplicationTask.call(
            CommandAwareRpcDispatcher.java:217)
             at org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher.invokeRemoteCommands(
            CommandAwareRpcDispatcher.java:110)
             ... 30 more
            Caused by: java.io.NotActiveException: Fields were never written
             at org.jboss.marshalling.river.RiverObjectOutputStream.finish(RiverObjectOutputStream.java:1
            74)
             at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.jav
            a:984)
             at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:890)
             at org.jboss.marshalling.AbstractMarshaller.writeObject(AbstractMarshaller.java:392)
             at org.infinispan.marshall.exts.ReplicableCommandExternalizer.writeObject(ReplicableCommandE
            xternalizer.java:54)
             at org.infinispan.marshall.jboss.ConstantObjectTable$ExternalizerAdapter.writeObject(Constan
            tObjectTable.java:260)
             at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:130)
             at org.jboss.marshalling.AbstractMarshaller.writeObject(AbstractMarshaller.java:392)
             at org.infinispan.marshall.exts.ReplicableCommandExternalizer.writeObject(ReplicableCommandE
            xternalizer.java:54)
             at org.infinispan.marshall.jboss.ConstantObjectTable$ExternalizerAdapter.writeObject(Constan
            tObjectTable.java:260)
             at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:130)
             at org.jboss.marshalling.AbstractMarshaller.writeObject(AbstractMarshaller.java:392)
             at org.infinispan.marshall.jboss.JBossMarshaller.objectToObjectStream(JBossMarshaller.java:1
            63)
             at org.infinispan.marshall.VersionAwareMarshaller.objectToBuffer(VersionAwareMarshaller.java
            :92)
             at org.infinispan.remoting.transport.jgroups.MarshallerAdapter.objectToBuffer(MarshallerAdap
            ter.java:22)
             at org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher$ReplicationTask.call(
            CommandAwareRpcDispatcher.java:214)
             ... 31 more
            


            • 3. Re: Searching for user data serialization info
              Galder Zamarreño Master

              JBoss Marshalling which is the underlying marshalling framework had an issue marshalling Date instances: https://jira.jboss.org/jira/browse/JBMAR-77. This is solved now and will be fixed in Infinispan 4.0.0.Beta2.

              As a workaround, store a long rather than a Date to get around the issue.