5 Replies Latest reply on Sep 9, 2008 6:14 PM by jason.greene

    Deserialization problem with collections moving from JBC 2.1

    kringdahl

      I'm using the JDBCCacheLoader to persist a cache which was originally created with JBC 2.1.1.GA. When I upgrade to 2.2.0.GA and start up, the preload routine throws an exception as described below. The exception suggests that the collection being preloaded is supposed to be an ArrayList, but it was in fact stored as a HashSet. Any thoughts on what I might be doing wrong here? Is there some special handling with collections when moving from 2.1.1 to 2.2.0?

      Thanks,
      Ken

      2008-09-04 15:59:50,843 DEBUG [org.jboss.cache.loader.JDBCCacheLoader] executing sql: select value from dht where fqn=? (/)
      2008-09-04 15:59:50,856 DEBUG [org.jboss.cache.marshall.VersionAwareMarshaller] Started with version 2.2.0 and versionInt 22
      2008-09-04 15:59:50,856 DEBUG [org.jboss.cache.marshall.VersionAwareMarshaller] Using default marshaller class class org.jboss.cache.marshall.CacheMarshaller210
      2008-09-04 15:59:50,857 DEBUG [org.jboss.cache.RPCManagerImpl] Cache mode is REPL_SYNC
      2008-09-04 15:59:51,102 INFO [STDOUT]
      -------------------------------------------------------
      GMS: address is 172.16.100.247:40540
      -------------------------------------------------------
      2008-09-04 15:59:51,104 DEBUG [org.jboss.cache.RPCManagerImpl] Block received at 172.16.100.247:40540
      2008-09-04 15:59:51,104 DEBUG [org.jboss.cache.RPCManagerImpl] Block processed at 172.16.100.247:40540
      2008-09-04 15:59:53,137 INFO [org.jboss.cache.RPCManagerImpl] Received new cluster view: [172.16.100.247:40540|0] [172.16.100.247:40540]
      2008-09-04 15:59:53,140 DEBUG [org.jboss.cache.RPCManagerImpl] UnBlock received at 172.16.100.247:40540
      2008-09-04 15:59:53,162 DEBUG [org.jboss.cache.RPCManagerImpl] UnBlock processed at 172.16.100.247:40540
      2008-09-04 15:59:53,178 INFO [org.jboss.cache.RPCManagerImpl] Cache local address is 172.16.100.247:40540
      2008-09-04 15:59:53,178 DEBUG [org.jboss.cache.loader.CacheLoaderManager] preloading transient state from cache loader org.jboss.cache.loader.JDBCCacheLoader@11170a9
      2008-09-04 15:59:53,196 DEBUG [org.jboss.cache.loader.JDBCCacheLoader] executing sql: select value from dht where fqn=? (/)
      2008-09-04 15:59:53,197 DEBUG [org.jboss.cache.loader.JDBCCacheLoader] executing sql: select fqn from dht where parent_fqn=? (/)
      2008-09-04 15:59:53,199 DEBUG [org.jboss.cache.loader.JDBCCacheLoader] executing sql: select value from dht where fqn=? (/__JBossInternal__)
      2008-09-04 15:59:53,200 DEBUG [org.jboss.cache.loader.JDBCCacheLoader] executing sql: select fqn from dht where parent_fqn=? (/__JBossInternal__)
      2008-09-04 15:59:53,201 DEBUG [org.jboss.cache.loader.JDBCCacheLoader] executing sql: select value from dht where fqn=? (/__JBossInternal__/dht)
      2008-09-04 15:59:53,204 DEBUG [org.jboss.cache.loader.JDBCCacheLoader] executing sql: select fqn from dht where parent_fqn=? (/__JBossInternal__/dht)
      2008-09-04 15:59:53,204 DEBUG [org.jboss.cache.loader.JDBCCacheLoader] executing sql: select value from dht where fqn=? (/__JBossInternal__/dht/fabric)
      2008-09-04 15:59:53,205 DEBUG [org.jboss.cache.loader.JDBCCacheLoader] executing sql: select fqn from dht where parent_fqn=? (/__JBossInternal__/dht/fabric)
      2008-09-04 15:59:53,206 DEBUG [org.jboss.cache.loader.JDBCCacheLoader] executing sql: select value from dht where fqn=? (/__JBossInternal__/dht/fabric/poolmanager)
      2008-09-04 15:59:53,207 DEBUG [org.jboss.cache.loader.JDBCCacheLoader] executing sql: select fqn from dht where parent_fqn=? (/__JBossInternal__/dht/fabric/poolmanager)
      2008-09-04 15:59:53,208 DEBUG [org.jboss.cache.loader.JDBCCacheLoader] executing sql: select value from dht where fqn=? (/__JBossInternal__/dht/fabric/poolmanager/activenode)
      2008-09-04 15:59:53,208 DEBUG [org.jboss.cache.loader.JDBCCacheLoader] executing sql: select fqn from dht where parent_fqn=? (/__JBossInternal__/dht/fabric/poolmanager/activenode)
      2008-09-04 15:59:53,209 DEBUG [org.jboss.cache.loader.JDBCCacheLoader] executing sql: select value from dht where fqn=? (/__JBossInternal__/dht/fabric/poolmanager/activenode/_ID_)
      2008-09-04 15:59:53,210 DEBUG [org.jboss.cache.loader.JDBCCacheLoader] executing sql: select fqn from dht where parent_fqn=? (/__JBossInternal__/dht/fabric/poolmanager/activenode/_ID_)
      2008-09-04 15:59:53,211 DEBUG [org.jboss.cache.loader.JDBCCacheLoader] executing sql: select value from dht where fqn=? (/__JBossInternal__/dht/fabric/bootstrap)
      2008-09-04 15:59:53,211 DEBUG [org.jboss.cache.loader.JDBCCacheLoader] executing sql: select fqn from dht where parent_fqn=? (/__JBossInternal__/dht/fabric/bootstrap)
      2008-09-04 15:59:53,212 DEBUG [org.jboss.cache.loader.JDBCCacheLoader] executing sql: select value from dht where fqn=? (/__JBossInternal__/dht/fabric/bootstrap/_ID_)
      2008-09-04 15:59:53,213 DEBUG [org.jboss.cache.loader.JDBCCacheLoader] executing sql: select fqn from dht where parent_fqn=? (/__JBossInternal__/dht/fabric/bootstrap/_ID_)
      2008-09-04 15:59:53,213 DEBUG [org.jboss.cache.loader.JDBCCacheLoader] executing sql: select value from dht where fqn=? (/__JBossInternal__/dht/fabric/bootstrap/_ID_/3j011-casrw7-fkpurkb5-1-fkpusalh-t)
      2008-09-04 15:59:53,219 DEBUG [org.jboss.cache.loader.JDBCCacheLoader] executing sql: select fqn from dht where parent_fqn=? (/__JBossInternal__/dht/fabric/bootstrap/_ID_/3j011-casrw7-fkpurkb5-1-fkpusalh-t)
      2008-09-04 15:59:53,220 DEBUG [org.jboss.cache.loader.JDBCCacheLoader] executing sql: select value from dht where fqn=? (/__JBossInternal__/dht/fabric/domain)
      2008-09-04 15:59:53,221 DEBUG [org.jboss.cache.loader.JDBCCacheLoader] executing sql: select fqn from dht where parent_fqn=? (/__JBossInternal__/dht/fabric/domain)
      2008-09-04 15:59:53,222 DEBUG [org.jboss.cache.loader.JDBCCacheLoader] executing sql: select value from dht where fqn=? (/__JBossInternal__/dht/fabric/domain/inventory)
      2008-09-04 15:59:53,222 DEBUG [org.jboss.cache.loader.JDBCCacheLoader] executing sql: select fqn from dht where parent_fqn=? (/__JBossInternal__/dht/fabric/domain/inventory)
      2008-09-04 15:59:53,223 DEBUG [org.jboss.cache.loader.JDBCCacheLoader] executing sql: select value from dht where fqn=? (/__JBossInternal__/dht/fabric/domain/inventory/list)
      2008-09-04 15:59:53,224 DEBUG [org.jboss.cache.loader.JDBCCacheLoader] executing sql: select fqn from dht where parent_fqn=? (/__JBossInternal__/dht/fabric/domain/inventory/list)
      2008-09-04 15:59:53,224 DEBUG [org.jboss.cache.loader.JDBCCacheLoader] executing sql: select value from dht where fqn=? (/__JBossInternal__/dht/fabric/domain/inventory/list/_ID_)
      2008-09-04 15:59:53,225 DEBUG [org.jboss.cache.loader.JDBCCacheLoader] executing sql: select fqn from dht where parent_fqn=? (/__JBossInternal__/dht/fabric/domain/inventory/list/_ID_)
      2008-09-04 15:59:53,226 DEBUG [org.jboss.cache.loader.JDBCCacheLoader] executing sql: select value from dht where fqn=? (/__JBossInternal__/dht/fabric/domain/inventory/list/_ID_/3j011-casrw7-fkpurkb5-1-fkpusj41-3z)
      2008-09-04 15:59:53,229 ERROR [org.jboss.cache.loader.JDBCCacheLoader] Failed to load node for fqn /__JBossInternal__/dht/fabric/domain/inventory/list/_ID_/3j011-casrw7-fkpurkb5-1-fkpusj41-3z
      java.lang.Exception: Unable to load to deserialize result:
       at org.jboss.cache.loader.AdjListJDBCCacheLoader.loadNode(AdjListJDBCCacheLoader.java:378)
       at org.jboss.cache.loader.AdjListJDBCCacheLoader.get(AdjListJDBCCacheLoader.java:99)
       at org.jboss.cache.interceptors.CacheLoaderInterceptor.loadData(CacheLoaderInterceptor.java:563)
       at org.jboss.cache.interceptors.CacheLoaderInterceptor.loadNode(CacheLoaderInterceptor.java:490)
       at org.jboss.cache.interceptors.CacheLoaderInterceptor.loadIfNeeded(CacheLoaderInterceptor.java:304)
       at org.jboss.cache.interceptors.CacheLoaderInterceptor.visitGetKeyValueCommand(CacheLoaderInterceptor.java:136)
       at org.jboss.cache.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:75)
       at org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:142)
       at org.jboss.cache.interceptors.PessimisticLockInterceptor.handleGetKeyValueCommand(PessimisticLockInterceptor.java:310)
       at org.jboss.cache.interceptors.base.PostProcessingCommandInterceptor.visitGetKeyValueCommand(PostProcessingCommandInterceptor.java:239)
       at org.jboss.cache.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:75)
       at org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:142)
       at org.jboss.cache.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:157)
       at org.jboss.cache.commands.AbstractVisitor.visitGetKeyValueCommand(AbstractVisitor.java:89)
       at org.jboss.cache.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:75)
       at org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:142)
       at org.jboss.cache.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:157)
       at org.jboss.cache.commands.AbstractVisitor.visitGetKeyValueCommand(AbstractVisitor.java:89)
       at org.jboss.cache.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:75)
       at org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:142)
       at org.jboss.cache.interceptors.TxInterceptor.attachGtxAndPassUpChain(TxInterceptor.java:266)
       at org.jboss.cache.interceptors.TxInterceptor.handleDefault(TxInterceptor.java:253)
       at org.jboss.cache.commands.AbstractVisitor.visitGetKeyValueCommand(AbstractVisitor.java:89)
       at org.jboss.cache.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:75)
       at org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:142)
       at org.jboss.cache.interceptors.CacheMgmtInterceptor.visitGetKeyValueCommand(CacheMgmtInterceptor.java:75)
       at org.jboss.cache.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:75)
       at org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:142)
       at org.jboss.cache.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:155)
       at org.jboss.cache.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:108)
       at org.jboss.cache.commands.AbstractVisitor.visitGetKeyValueCommand(AbstractVisitor.java:89)
       at org.jboss.cache.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:75)
       at org.jboss.cache.interceptors.InterceptorChain.invoke(InterceptorChain.java:215)
       at org.jboss.cache.invocation.CacheInvocationDelegate.get(CacheInvocationDelegate.java:371)
       at org.jboss.cache.loader.CacheLoaderManager.preload(CacheLoaderManager.java:337)
       at org.jboss.cache.loader.CacheLoaderManager.preload(CacheLoaderManager.java:368)
       at org.jboss.cache.loader.CacheLoaderManager.preload(CacheLoaderManager.java:368)
       at org.jboss.cache.loader.CacheLoaderManager.preload(CacheLoaderManager.java:368)
       at org.jboss.cache.loader.CacheLoaderManager.preload(CacheLoaderManager.java:368)
       at org.jboss.cache.loader.CacheLoaderManager.preload(CacheLoaderManager.java:368)
       at org.jboss.cache.loader.CacheLoaderManager.preload(CacheLoaderManager.java:368)
       at org.jboss.cache.loader.CacheLoaderManager.preload(CacheLoaderManager.java:368)
       at org.jboss.cache.loader.CacheLoaderManager.preload(CacheLoaderManager.java:368)
       at org.jboss.cache.loader.CacheLoaderManager.preloadCache(CacheLoaderManager.java:310)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.cache.util.reflect.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:123)
       at org.jboss.cache.factories.ComponentRegistry$PrioritizedMethod.invoke(ComponentRegistry.java:932)
       at org.jboss.cache.factories.ComponentRegistry.internalStart(ComponentRegistry.java:718)
       at org.jboss.cache.factories.ComponentRegistry.start(ComponentRegistry.java:582)
       at org.jboss.cache.invocation.CacheInvocationDelegate.start(CacheInvocationDelegate.java:279)
       at org.jboss.cache.pojo.impl.PojoCacheImpl.start(PojoCacheImpl.java:318)
       at com.desktone.server.accessFabric.jbossCache.FabricNode.startPojoCache(FabricNode.java:81)
       at com.desktone.server.accessFabric.jbossCache.FabricNode.init(FabricNode.java:62)
       at com.desktone.server.accessFabric.service.FabricAccessService.startService(FabricAccessService.java:58)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
       at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
       at $Proxy0.start(Unknown Source)
       at org.jboss.system.ServiceController.start(ServiceController.java:417)
       at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy4.start(Unknown Source)
       at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
       at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy9.deploy(Unknown Source)
       at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
       at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
       at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
       at $Proxy0.start(Unknown Source)
       at org.jboss.system.ServiceController.start(ServiceController.java:417)
       at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy4.start(Unknown Source)
       at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy5.deploy(Unknown Source)
       at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
       at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
       at org.jboss.Main.boot(Main.java:200)
       at org.jboss.Main$1.run(Main.java:508)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: java.lang.ClassCastException: cannot assign instance of java.util.ArrayList to field org.jboss.cache.pojo.impl.PojoInstance.referencedBy_ of type java.util.Set in instance of org.jboss.cache.pojo.impl.PojoInstance
       at java.io.ObjectStreamClass$FieldReflector.setObjFieldValues(ObjectStreamClass.java:2004)
       at java.io.ObjectStreamClass.setObjFieldValues(ObjectStreamClass.java:1184)
       at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1914)
       at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1832)
       at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
       at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
       at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
       at org.jboss.cache.marshall.CacheMarshaller200.unmarshallObject(CacheMarshaller200.java:549)
       at org.jboss.cache.marshall.CacheMarshaller200.populateFromStream(CacheMarshaller200.java:759)
       at org.jboss.cache.marshall.CacheMarshaller200.unmarshallHashMap(CacheMarshaller200.java:722)
       at org.jboss.cache.marshall.CacheMarshaller200.unmarshallObject(CacheMarshaller200.java:580)
       at org.jboss.cache.marshall.CacheMarshaller200.unmarshallObject(CacheMarshaller200.java:522)
       at org.jboss.cache.marshall.CacheMarshaller200.objectFromObjectStream(CacheMarshaller200.java:140)
       at org.jboss.cache.marshall.VersionAwareMarshaller.objectFromByteBuffer(VersionAwareMarshaller.java:189)
       at org.jboss.cache.marshall.VersionAwareMarshaller.objectFromStream(VersionAwareMarshaller.java:223)
       at org.jboss.cache.loader.AdjListJDBCCacheLoader.unmarshall(AdjListJDBCCacheLoader.java:681)
       at org.jboss.cache.loader.AdjListJDBCCacheLoader.loadNode(AdjListJDBCCacheLoader.java:374)
       ... 148 more
      2008-09-04 15:59:53,246 WARN [com.desktone.server.accessFabric.jbossCache.FabricNode] Caught exception during cache startup: Failed starting org.jboss.cache.CacheException: Unable to invoke method public void org.jboss.cache.loader.CacheLoaderManager.preloadCache() throws org.jboss.cache.CacheException on object instance org.jboss.cache.loader.CacheLoaderManager@bcf47
      2008-09-04 15:59:53,247 DEBUG [com.desktone.server.accessFabric.jbossCache.FabricNode]
      org.jboss.cache.pojo.PojoCacheException: Failed starting org.jboss.cache.CacheException: Unable to invoke method public void org.jboss.cache.loader.CacheLoaderManager.preloadCache() throws org.jboss.cache.CacheException on object instance org.jboss.cache.loader.CacheLoaderManager@bcf47
       at org.jboss.cache.pojo.impl.PojoCacheImpl.start(PojoCacheImpl.java:322)
       at com.desktone.server.accessFabric.jbossCache.FabricNode.startPojoCache(FabricNode.java:81)
       at com.desktone.server.accessFabric.jbossCache.FabricNode.init(FabricNode.java:62)
       at com.desktone.server.accessFabric.service.FabricAccessService.startService(FabricAccessService.java:58)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
       at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
       at $Proxy0.start(Unknown Source)
       at org.jboss.system.ServiceController.start(ServiceController.java:417)
       at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy4.start(Unknown Source)
       at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
       at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy9.deploy(Unknown Source)
       at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
       at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
       at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
       at $Proxy0.start(Unknown Source)
       at org.jboss.system.ServiceController.start(ServiceController.java:417)
       at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy4.start(Unknown Source)
       at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy5.deploy(Unknown Source)
       at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
       at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
       at org.jboss.Main.boot(Main.java:200)
       at org.jboss.Main$1.run(Main.java:508)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: org.jboss.cache.CacheException: Unable to invoke method public void org.jboss.cache.loader.CacheLoaderManager.preloadCache() throws org.jboss.cache.CacheException on object instance org.jboss.cache.loader.CacheLoaderManager@bcf47
       at org.jboss.cache.util.reflect.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:127)
       at org.jboss.cache.factories.ComponentRegistry$PrioritizedMethod.invoke(ComponentRegistry.java:932)
       at org.jboss.cache.factories.ComponentRegistry.internalStart(ComponentRegistry.java:718)
       at org.jboss.cache.factories.ComponentRegistry.start(ComponentRegistry.java:582)
       at org.jboss.cache.invocation.CacheInvocationDelegate.start(CacheInvocationDelegate.java:279)
       at org.jboss.cache.pojo.impl.PojoCacheImpl.start(PojoCacheImpl.java:318)
       ... 95 more
      Caused by: java.lang.reflect.InvocationTargetException
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.cache.util.reflect.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:123)
       ... 100 more
      Caused by: org.jboss.cache.CacheException: java.lang.Exception: Unable to load to deserialize result:
       at org.jboss.cache.interceptors.InterceptorChain.invoke(InterceptorChain.java:227)
       at org.jboss.cache.invocation.CacheInvocationDelegate.get(CacheInvocationDelegate.java:371)
       at org.jboss.cache.loader.CacheLoaderManager.preload(CacheLoaderManager.java:337)
       at org.jboss.cache.loader.CacheLoaderManager.preload(CacheLoaderManager.java:368)
       at org.jboss.cache.loader.CacheLoaderManager.preload(CacheLoaderManager.java:368)
       at org.jboss.cache.loader.CacheLoaderManager.preload(CacheLoaderManager.java:368)
       at org.jboss.cache.loader.CacheLoaderManager.preload(CacheLoaderManager.java:368)
       at org.jboss.cache.loader.CacheLoaderManager.preload(CacheLoaderManager.java:368)
       at org.jboss.cache.loader.CacheLoaderManager.preload(CacheLoaderManager.java:368)
       at org.jboss.cache.loader.CacheLoaderManager.preload(CacheLoaderManager.java:368)
       at org.jboss.cache.loader.CacheLoaderManager.preload(CacheLoaderManager.java:368)
       at org.jboss.cache.loader.CacheLoaderManager.preloadCache(CacheLoaderManager.java:310)
       ... 105 more
      Caused by: java.lang.Exception: Unable to load to deserialize result:
       at org.jboss.cache.loader.AdjListJDBCCacheLoader.loadNode(AdjListJDBCCacheLoader.java:378)
       at org.jboss.cache.loader.AdjListJDBCCacheLoader.get(AdjListJDBCCacheLoader.java:99)
       at org.jboss.cache.interceptors.CacheLoaderInterceptor.loadData(CacheLoaderInterceptor.java:563)
       at org.jboss.cache.interceptors.CacheLoaderInterceptor.loadNode(CacheLoaderInterceptor.java:490)
       at org.jboss.cache.interceptors.CacheLoaderInterceptor.loadIfNeeded(CacheLoaderInterceptor.java:304)
       at org.jboss.cache.interceptors.CacheLoaderInterceptor.visitGetKeyValueCommand(CacheLoaderInterceptor.java:136)
       at org.jboss.cache.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:75)
       at org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:142)
       at org.jboss.cache.interceptors.PessimisticLockInterceptor.handleGetKeyValueCommand(PessimisticLockInterceptor.java:310)
       at org.jboss.cache.interceptors.base.PostProcessingCommandInterceptor.visitGetKeyValueCommand(PostProcessingCommandInterceptor.java:239)
       at org.jboss.cache.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:75)
       at org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:142)
       at org.jboss.cache.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:157)
       at org.jboss.cache.commands.AbstractVisitor.visitGetKeyValueCommand(AbstractVisitor.java:89)
       at org.jboss.cache.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:75)
       at org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:142)
       at org.jboss.cache.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:157)
       at org.jboss.cache.commands.AbstractVisitor.visitGetKeyValueCommand(AbstractVisitor.java:89)
       at org.jboss.cache.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:75)
       at org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:142)
       at org.jboss.cache.interceptors.TxInterceptor.attachGtxAndPassUpChain(TxInterceptor.java:266)
       at org.jboss.cache.interceptors.TxInterceptor.handleDefault(TxInterceptor.java:253)
       at org.jboss.cache.commands.AbstractVisitor.visitGetKeyValueCommand(AbstractVisitor.java:89)
       at org.jboss.cache.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:75)
       at org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:142)
       at org.jboss.cache.interceptors.CacheMgmtInterceptor.visitGetKeyValueCommand(CacheMgmtInterceptor.java:75)
       at org.jboss.cache.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:75)
       at org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:142)
       at org.jboss.cache.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:155)
       at org.jboss.cache.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:108)
       at org.jboss.cache.commands.AbstractVisitor.visitGetKeyValueCommand(AbstractVisitor.java:89)
       at org.jboss.cache.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:75)
       at org.jboss.cache.interceptors.InterceptorChain.invoke(InterceptorChain.java:215)
       ... 116 more
      Caused by: java.lang.ClassCastException: cannot assign instance of java.util.ArrayList to field org.jboss.cache.pojo.impl.PojoInstance.referencedBy_ of type java.util.Set in instance of org.jboss.cache.pojo.impl.PojoInstance
       at java.io.ObjectStreamClass$FieldReflector.setObjFieldValues(ObjectStreamClass.java:2004)
       at java.io.ObjectStreamClass.setObjFieldValues(ObjectStreamClass.java:1184)
       at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1914)
       at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1832)
       at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
       at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
       at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
       at org.jboss.cache.marshall.CacheMarshaller200.unmarshallObject(CacheMarshaller200.java:549)
       at org.jboss.cache.marshall.CacheMarshaller200.populateFromStream(CacheMarshaller200.java:759)
       at org.jboss.cache.marshall.CacheMarshaller200.unmarshallHashMap(CacheMarshaller200.java:722)
       at org.jboss.cache.marshall.CacheMarshaller200.unmarshallObject(CacheMarshaller200.java:580)
       at org.jboss.cache.marshall.CacheMarshaller200.unmarshallObject(CacheMarshaller200.java:522)
       at org.jboss.cache.marshall.CacheMarshaller200.objectFromObjectStream(CacheMarshaller200.java:140)
       at org.jboss.cache.marshall.VersionAwareMarshaller.objectFromByteBuffer(VersionAwareMarshaller.java:189)
       at org.jboss.cache.marshall.VersionAwareMarshaller.objectFromStream(VersionAwareMarshaller.java:223)
       at org.jboss.cache.loader.AdjListJDBCCacheLoader.unmarshall(AdjListJDBCCacheLoader.java:681)
       at org.jboss.cache.loader.AdjListJDBCCacheLoader.loadNode(AdjListJDBCCacheLoader.java:374)
       ... 148 more
      2008-09-04 15:59:53,249 DEBUG [com.desktone.server.accessFabric.jbossCache.FabricNode] Cache status is FAILED
      2008-09-04 15:59:53,249 WARN [com.desktone.server.accessFabric.jbossCache.FabricNode] Cache has failed to start; will attempt to restart
      2008-09-04 15:59:53,249 INFO [com.desktone.server.accessFabric.jbossCache.FabricNode] Stopping the PojoCache
      2008-09-04 15:59:53,249 INFO [org.jboss.cache.RPCManagerImpl] Disconnecting and closing the Channel
      2008-09-04 15:59:53,313 INFO [org.jboss.cache.RPCManagerImpl] Stopping the RpcDispatcher


        • 1. Re: Deserialization problem with collections moving from JBC
          kringdahl

          Any thoughts on this one? I've dug into some of the marshalling code and it is not immediately obvious what the problem is. It does seem to only affect collections (in this case a HashSet) that was persisted with 2.1.0 PojoCache and is trying to be loaded by a 2.2.0 PojoCache. The additional problem is that there is no way to transform the cache from 2.1 to 2.2 as I can't create a 2.1 and 2.2 PojoCache in the same JVM. If this isn't a configuration problem, I'd need to probably do something like:

          - Start 2.1.0 pojo cache
          - Recursively read the cache and serialize to disk
          - Stop the 2.1.0 pojo cache
          - Start the 2.2.0 pojo cache
          - Read from disk and persist to the 2.2.0 cache
          - Stop the 2.2.0 pojo cache

          • 2. Re: Deserialization problem with collections moving from JBC
            jason.greene

            This is definitely a compatibility bug. Thanks for reporting it!

            https://jira.jboss.org/jira/browse/PCACHE-73

            • 3. Re: Deserialization problem with collections moving from JBC
              jason.greene

              This is scheduled for fix by POJO Cache 2.2.0.GA

              • 4. Re: Deserialization problem with collections moving from JBC
                kringdahl

                Hi Jason, thanks for the feedback. Any thoughts on how to best workaround this? Assuming PojoCache 2.2.0.GA won't be out in the next week, I'll need to come up with some other way to get from 2.1.0 to 2.2.0.

                • 5. Re: Deserialization problem with collections moving from JBC
                  jason.greene

                  Looking at this in more detail, the only way to make this backward compatible would be to move the getReferences() feature to 3.0.0, which a lot of folks were asking for. It's also not easy to convert since information that is needed in the 2.2 implementation is not stored in 2.1.

                  However, you should be able to work around this, by creating a copy of your object model, and storing the copy in equivalent locations of 2.2. The easiest approach would be using copy constructors. Stay away from clone(), since it will copy the AOP interceptors, and proxies, which still point to the origin cache.

                  You can use multiple versions of POJO Cache in the same JVM, you just have to load them in different classloaders. One approach is to use 2 URLClassLoaders, and then get access to the PojoCache interface by using reflection. If the reflection becomes a pain, you can implement a routine which performs the copy and uses normal java imports, and then load that copy routine using both classloaders and reflection. For that to work the routine has to be loaded by the 2 URLClassLoaders, and not present in the system classloader. Everything else, especially the domain/data classes stored in the cache must be in the main classloader/classpath.

                  So, if you follow the above situation you end up with the following classloader layout

                  Main/Default ClassLoader/ClassPath
                  ----------------------------------------
                  Main class for conversion tool
                  Domain/Data classes stored in POJO Cache

                  URLClassLoader 1 - POJO Cache 2.1
                  ----------------------------------------
                  All jars used by POJO Cache 2.1
                  Conversion class which calls a callback on the Main class to process each class stored in the 2.1 instance

                  URLClassLoader 2 - POJO Cache 2.2
                  ----------------------------------------
                  All jars used by POJO Cache 2.2
                  Conversion class which takes a fqn, and a clean object copy, and attaches it to the 2.2 instance.