Hi
I am using PojoCache to store Pojo Objects created by Hibernate.
I want to use the replication mode with this cache, so I pre-compile with aopc (ant task) my classes.
[b][u]But when I call PojoCache.putObject with an Object (which contains collections) loaded by Hibernate, I have the following exception :
I correct this by recompile the class org.hibernate.collection.AbstractPersistentCollection without final method.
Is there any better method to solve this problem? Would there be any implication of changing the methods of the class to non-final? [/u][/b]
I got the solution in jboss-pojo-cache forum from another user having similar problem. So I wanted to be sure if this would affect the functionality.
Kindly note that in our project we do not want to use Jboss cache as hibernate's second level cache for certain reasons. We want hibernate to be thin and need to use the cache in front of it.
The hibernate version used is: hibernate-3.1.3.
[u]EXCEPTION[/u]
----------------------------------------------------
Caused by: org.jboss.cache.CacheException: failure creating proxy
at org.jboss.cache.aop.CollectionClassHandler.collectionObjectPut(CollectionClassHandler.java:124)
at org.jboss.cache.aop.TreeCacheAopDelegate._putObject(TreeCacheAopDelegate.java:213)
at org.jboss.cache.aop.TreeCacheAopDelegate._regularPutObject(TreeCacheAopDelegate.java:468)
at org.jboss.cache.aop.TreeCacheAopDelegate._putObject(TreeCacheAopDelegate.java:206)
at org.jboss.cache.aop.PojoCache._putObject(PojoCache.java:731)
at org.jboss.cache.aop.PojoCache.putObject(PojoCache.java:462)
at org.jboss.cache.aop.PojoCache.putObject(PojoCache.java:423)
at com.gltrade.manager.cache.PojoCacheManagerImpl.put(PojoCacheManagerImpl.java:75)
... 12 more
Caused by: java.lang.RuntimeException: javassist.CannotCompileException: by java.lang.VerifyError: class AOPClassProxy$0 overrides final method .Û8Ý*h'+
at org.jboss.cache.aop.collection.CollectionInterceptorUtil.getMethodMap(CollectionInterceptorUtil.java:74)
at org.jboss.cache.aop.collection.CachedMapInterceptor.(CachedMapInterceptor.java:33)
at org.jboss.cache.aop.collection.CollectionInterceptorUtil.createMapProxy(CollectionInterceptorUtil.java:50)
at org.jboss.cache.aop.CollectionClassHandler.collectionObjectPut(CollectionClassHandler.java:122)
... 19 more
Caused by: javassist.CannotCompileException: by java.lang.VerifyError: class AOPClassProxy$0 overrides final method .Û8Ý*h'+
at javassist.ClassPool.toClass(ClassPool.java:906)
at javassist.ClassPool.toClass(ClassPool.java:846)
at org.jboss.aop.AOPClassPool.toClass(AOPClassPool.java:181)
at javassist.ClassPool.toClass(ClassPool.java:804)
at javassist.CtClass.toClass(CtClass.java:1037)
at org.jboss.aop.proxy.ClassProxyFactory.generateProxy(ClassProxyFactory.java:290)
at org.jboss.aop.proxy.ClassProxyFactory.getProxyClass(ClassProxyFactory.java:67)
at org.jboss.aop.proxy.ClassProxyFactory.newInstance(ClassProxyFactory.java:79)
at org.jboss.aop.proxy.ClassProxyFactory.newInstance(ClassProxyFactory.java:52)
at org.jboss.aop.proxy.ClassProxyFactory.newInstance(ClassProxyFactory.java:47)
at org.jboss.cache.aop.collection.CollectionInterceptorUtil.getMethodMap(CollectionInterceptorUtil.java:72)
... 22 more
Caused by: java.lang.VerifyError: class AOPClassProxy$0 overrides final method .Û8Ý*h'+
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.lang.ClassLoader.defineClass(ClassLoader.java:465)
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 javassist.ClassPool.toClass(ClassPool.java:898)
... 32 more
|