As per POJOCache specification any non
serializable object can be serialized but when I use Person Class without implementing
Serializable
it throws following error.
If I implements Serializableit works
well , So IN POJO Cache does class need to implement Serializable.?
Exception in thread "main" org.jboss.cache.pojo.PojoCacheException: Failed starting org.jboss.cache.CacheException: java.lang.reflect.InvocationTargetException
at org.jboss.cache.pojo.impl.PojoCacheImpl.start(PojoCacheImpl.java:316)
at org.jboss.cache.pojo.passivation.TRGLocalTest.setUp(TRGLocalTest.java:56)
at org.jboss.cache.pojo.passivation.TRGLocalTest.main(TRGLocalTest.java:132)
Caused by: org.jboss.cache.CacheException: java.lang.reflect.InvocationTargetException
at org.jboss.cache.util.reflect.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:148)
at
org.jboss.cache.factories.ComponentRegistry$PrioritizedMethod.invoke(ComponentRegistry.java:970)
at org.jboss.cache.factories.ComponentRegistry.internalStart(ComponentRegistry.java:746)
at org.jboss.cache.factories.ComponentRegistry.start(ComponentRegistry.java:610)
at org.jboss.cache.invocation.CacheInvocationDelegate.start(CacheInvocationDelegate.java:355)
at org.jboss.cache.pojo.impl.PojoCacheImpl.start(PojoCacheImpl.java:312)
... 2 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:597)
at
org.jboss.cache.util.reflect.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:144)
... 7 more
Caused by: org.jboss.cache.CacheException: java.io.InvalidClassException: org.jboss.cache.pojo.test.Person;
org.jboss.cache.pojo.test.Person; class invalid for deserialization
at org.jboss.cache.interceptors.InterceptorChain.invoke(InterceptorChain.java:277)
at org.jboss.cache.invocation.CacheInvocationDelegate.get(CacheInvocationDelegate.java:448)
at org.jboss.cache.loader.CacheLoaderManager.preload(CacheLoaderManager.java:352)
at org.jboss.cache.loader.CacheLoaderManager.preload(CacheLoaderManager.java:383)
at org.jboss.cache.loader.CacheLoaderManager.preload(CacheLoaderManager.java:383)
at org.jboss.cache.loader.CacheLoaderManager.preload(CacheLoaderManager.java:383)
at org.jboss.cache.loader.CacheLoaderManager.preload(CacheLoaderManager.java:383)
at org.jboss.cache.loader.CacheLoaderManager.preloadCache(CacheLoaderManager.java:325)
... 12 more
Caused by: java.io.InvalidClassException: org.jboss.cache.pojo.test.Person;
org.jboss.cache.pojo.test.Person; class invalid for deserialization
at java.io.ObjectStreamClass.checkDeserialize(ObjectStreamClass.java:713)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1733)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at org.jboss.cache.marshall.CacheMarshaller200.unmarshallObject(CacheMarshaller200.java:582)
at
org.jboss.cache.marshall.CacheMarshaller200.populateFromStream(CacheMarshaller200.java:800)
at
org.jboss.cache.marshall.CacheMarshaller200.unmarshallHashMap(CacheMarshaller200.java:763)
Regards,