-
1. org.infinispan.marshall.NotSerializableException: Object of type class java.lang.String expected to be marshallable
jaysmith May 3, 2011 6:53 AM (in response to jaysmith)Finally found the problem, the river-1.2.3.GA.jar lib wasn't on the classpath and that screwed up the marshalling. Only found that out when looking at the error listed here
Right then, onto the next bit of grief with this questionable software!
-
2. org.infinispan.marshall.NotSerializableException: Object of type class java.lang.String expected to be marshallable
vblagojevic May 4, 2011 9:21 AM (in response to jaysmith)Jay,
Glad you resolved the problem you encountered and thanks for the praise and the encouragement!
Regards,
Vladimir
-
3. org.infinispan.marshall.NotSerializableException: Object of type class java.lang.String expected to be marshallable
yangju May 4, 2011 4:30 PM (in response to jaysmith)Well, I got the same error and more. I upgraded the infinispan jars in jboss AS6 Final from 4.2.0.FIANL to lastest 5.0.0.CR.
river-1.2.3.GA.jar is on my class path (it is in jboss AS 6's lib directory along with other jars).
It seems if I just have one node, everything works fine. But as soon as I added another node in distributed mode, all sorts of errors popped out, including error thrown at deployment time: I don't understand why NodeKey is not serializable and also why org.infinispan.tree.NodeKey gets involved. I am not using tree cache.
Caused by: java.io.NotSerializableException: org.infinispan.tree.NodeKey
at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:972) [:]
at org.jboss.marshalling.AbstractMarshaller.writeObject(AbstractMarshaller.java:423) [:]
at org.infinispan.container.entries.ImmortalCacheEntry$Externalizer.writeObject(ImmortalCacheEntry.java:126) [:5.0.0.CR1]
at org.infinispan.container.entries.ImmortalCacheEntry$Externalizer.writeObject(ImmortalCacheEntry.java:123) [:5.0.0.CR1]
at org.infinispan.marshall.jboss.ExternalizerTable$ExternalizerAdapter.writeObject(ExternalizerTable.java:361) [:5.0.0.CR1]
at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:147) [:]
at org.jboss.marshalling.AbstractMarshaller.writeObject(AbstractMarshaller.java:423) [:]
at org.infinispan.marshall.MarshallUtil.marshallCollection(MarshallUtil.java:49) [:5.0.0.CR1]
at org.infinispan.marshall.exts.SetExternalizer.writeObject(SetExternalizer.java:62) [:5.0.0.CR1]
at org.infinispan.marshall.exts.SetExternalizer.writeObject(SetExternalizer.java:47) [:5.0.0.CR1]
at org.infinispan.marshall.jboss.ExternalizerTable$ExternalizerAdapter.writeObject(ExternalizerTable.java:361) [:5.0.0.CR1]
at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:147) [:]
at org.jboss.marshalling.AbstractMarshaller.writeObject(AbstractMarshaller.java:423) [:]
at org.infinispan.marshall.jboss.GenericJBossMarshaller.objectToObjectStream(GenericJBossMarshaller.java:121) [:5.0.0.CR1]
at org.infinispan.marshall.VersionAwareMarshaller.objectToObjectStream(VersionAwareMarshaller.java:156) [:5.0.0.CR1]
at org.infinispan.statetransfer.StateTransferManagerImpl.generateInMemoryState(StateTransferManagerImpl.java:362) [:5.0.0.CR1]
... 14 more
Caused by: an exception which occurred:
in object org.infinispan.tree.NodeKey@ff816b1c
-> toString = NodeKey{contents=STRUCTURE, fqn=/}
in object org.infinispan.container.entries.ImmortalCacheEntry@f28dc3ea
-> toString = ImmortalCacheEntry{cacheValue=ImmortalCacheValue{value=AtomicHashMap{delegate=org.infinispan.util.FastCopyHashMap@1719c5f}}} ImmortalCacheEntry{key=NodeKey{contents=STRUCTURE, fqn=/}}
in object java.util.HashSet@e39ea0fd
-> toString = [ImmortalCacheEntry{cacheValue=ImmortalCacheValue{value=AtomicHashMap{delegate=org.infinispan.util.FastCopyHashMap@1719c5f}}} ImmortalCacheEntry{key=NodeKey{contents=STRUCTURE, fqn=/}}, ImmortalCacheEntry{cacheValue=ImmortalCacheValue{value=AtomicHashMap{delegate=org.infinispan.util.FastCopyHashMap@1d16256}}} ImmortalCacheEntry{key=NodeKey{contents=DATA, fqn=/}}]
The also got errors like this:
15:01:09,350 ERROR [AbstractKernelController] Error installing to Start: name=HAJNDI state=Create: org.infinispan.CacheException: Unable to invoke method public void org.infinispan.statetransfer.StateTransferManagerImpl.start() throws org.infinispan.statetransfer.StateTransferException on object
at org.infinispan.util.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:175) [:5.0.0.CR1]
at org.infinispan.factories.AbstractComponentRegistry$PrioritizedMethod.invoke(AbstractComponentRegistry.java:908) [:5.0.0.CR1]
at org.infinispan.factories.AbstractComponentRegistry.internalStart(AbstractComponentRegistry.java:706) [:5.0.0.CR1]
at org.infinispan.factories.AbstractComponentRegistry.start(AbstractComponentRegistry.java:608) [:5.0.0.CR1]
at org.infinispan.factories.ComponentRegistry.start(ComponentRegistry.java:179) [:5.0.0.CR1]
at org.infinispan.CacheDelegate.start(CacheDelegate.java:349) [:5.0.0.CR1]
at org.infinispan.manager.DefaultCacheManager.createCache(DefaultCacheManager.java:546) [:5.0.0.CR1]
at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:444) [:5.0.0.CR1]
at org.jboss.ha.ispn.DefaultCacheContainer.getCache(DefaultCacheContainer.java:126) [:1.0.0.Final]
at org.jboss.ha.ispn.DefaultCacheContainer.getCache(DefaultCacheContainer.java:71) [:1.0.0.Final]
at org.jboss.ha.jndi.ispn.DistributedTreeManager.init(DistributedTreeManager.java:103) [:1.0.0.Final]
at org.jboss.ha.jndi.HAJNDI.init(HAJNDI.java:100) [:6.0.0.Final]
at org.jboss.ha.jndi.DetachedHANamingService.startService(DetachedHANamingService.java:387) [:6.0.0.Final]
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:355) [:6.0.0.Final (Build SVNTag:JBoss_6.0.0.Final date: 20101228)]
at org.jboss.system.ServiceMBeanSupport.pojoStart(ServiceMBeanSupport.java:195) [:6.0.0.Final (Build SVNTag:JBoss_6.0.0.Final date: 20101228)]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_24]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [:1.6.0_24]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [:1.6.0_24]
at java.lang.reflect.Method.invoke(Unknown Source) [:1.6.0_24]
-
4. org.infinispan.marshall.NotSerializableException: Object of type class java.lang.String expected to be marshallable
yangju May 4, 2011 4:57 PM (in response to yangju)This is how my default cache config looks like (the actual cache is created at runtime by calling embeddedCacheManager.getCache(newCacheName):
<default>
<jmxStatistics enabled="true" />
<invocationBatching enabled="true" />
<indexing enabled="true" indexLocalOnly="true">
<properties>
<property name="hibernate.search.default.directory_provider"
value="ram" />
</properties>
</indexing>
<storeAsBinary enabled="true"/>
<locking isolationLevel="READ_COMMITTED"
lockAcquisitionTimeout="20000" writeSkewCheck="false"
concurrencyLevel="5000" useLockStriping="false" />
<transaction
transactionManagerLookupClass="org.infinispan.transaction.lookup.GenericTransactionManagerLookup"
syncRollbackPhase="false" syncCommitPhase="false" useEagerLocking="true"
eagerLockSingleNode="true" />
<clustering mode="distribution">
<l1 enabled="false" lifespan="60000" />
<hash numOwners="2" rehashRpcTimeout="120000" />
<sync />
</clustering>
</default>
Example of object that is cached:
@ProvidedId
@Indexed(index = "responseRecord")
public class MyObject implements Serializable {
private static final long serialVersionUID = 3387448277567400646L;
@Field(index = Index.UN_TOKENIZED, store = Store.NO)
long responseID = 0L;
@Field(index = Index.UN_TOKENIZED, store = Store.NO)
int responseStateCode = 0;
@Field(index = Index.UN_TOKENIZED, store = Store.NO)
int priority = 0;
public String toString() {
return Long.toString(this.getResponseID());
}
}
-
5. Re: org.infinispan.marshall.NotSerializableException: Object of type class java.lang.String expected to be marshallable
galder.zamarreno May 27, 2011 8:16 AM (in response to yangju)That's weird. I can only assume the issue is due to AS6 still having some dependencies on Infinispan 4.2 and somehow not being able to read the Infinispan 5.0 version of NodeKey which in 5.0 is marshalled via the internal framework.
-
6. Re: org.infinispan.marshall.NotSerializableException: Object of type class java.lang.String expected to be marshallable
yangju Jun 17, 2011 11:51 PM (in response to galder.zamarreno)Galder,
Could you please ask someone on AS team to give a simple instruction on how to upgrade jboss AS 6 final's infinispan to 5.x?
.As you suspect, there must be some jars in jboss as which contains NodeKey class which is loaded earlier than that from infinispan.
We really need Infinispan 5 for query feature because we do not know the key and we have to query the cache for next available entry in a distrubuted mode. We have been stuck for months on this upgrading.
Thanks.
Richard
-
7. Re: org.infinispan.marshall.NotSerializableException: Object of type class java.lang.String expected to be marshallable
manik Jun 23, 2011 11:12 AM (in response to yangju)You should give JBoss AS 7 a try. :-)
-
8. Re: org.infinispan.marshall.NotSerializableException: Object of type class java.lang.String expected to be marshallable
manik Jun 23, 2011 11:13 AM (in response to yangju)Also, if you absolutely need this on JBoss AS 6, have you tried asking this question (about upgrading to Infinispan 5.x) on JBoss AS 6's user forums?