[jboss-user] [JBoss AOP] - VerifyError when using JBoss Cache AOP
Hi, We use an entity bean that contains a attribute of type java.util.Set. This bean has the following methods for this attribute: @OneToMany(fetch = FetchType.LAZY, mappedBy = parent) public Set getChilds() { return childs; } public void setChilds(Set childs) { this.childs = childs; } This bean has to be stored in a database and we use hibernate for it. This bean also has to be stored ina POJO cache. Don't ask why we just need it ;-) For that to work we have the @Replicable annotation at the class definition along side the @Entity annotation. We compile this bean using the aopc via an ant build script. If we now deploy the application containing this bean in JBoss 5.1 we get the following stack trace: 16:14:07,765 WARN [ClassLoaderManager] Unexpected error during load of:org.hibernate.collection.AOPClassProxy$1 java.lang.VerifyError: class org.hibernate.collection.AOPClassProxy$1 overrides final method getKey.()Ljava/io/Serializable; at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:621) at org.jboss.classloader.spi.base.BaseClassLoader.access$200(BaseClassLoader.java:63) at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:572) at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:532) at java.security.AccessController.doPrivileged(Native Method) at org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseClassLoader.java:530) at org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseClassLoader.java:507) at org.jboss.classloader.spi.base.BaseDelegateLoader.loadClass(BaseDelegateLoader.java:134) at org.jboss.classloader.spi.filter.FilteredDelegateLoader.loadClass(FilteredDelegateLoader.java:131) at org.jboss.classloader.spi.base.ClassLoadingTask$ThreadTask.run(ClassLoadingTask.java:452) at org.jboss.classloader.spi.base.ClassLoaderManager.nextTask(ClassLoaderManager.java:251) at org.jboss.classloader.spi.base.ClassLoaderManager.process(ClassLoaderManager.java:150) at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:265) at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:1119) at org.jboss.classloader.spi.base.BaseClassLoader.loadClassFromDomain(BaseClassLoader.java:798) at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:441) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at org.jboss.aop.asintegration.jboss5.ToClassInvoker.toClass(ToClassInvoker.java:88) at org.jboss.aop.classpool.jbosscl.JBossClDelegatingClassPool.toClass(JBossClDelegatingClassPool.java:81) at javassist.CtClass.toClass(CtClass.java:1094) at org.jboss.aop.instrument.TransformerCommon$ToClassAction$2.toClass(TransformerCommon.java:331) at org.jboss.aop.instrument.TransformerCommon.toClass(TransformerCommon.java:126) at org.jboss.aop.proxy.ClassProxyFactory.generateProxy(ClassProxyFactory.java:354) at org.jboss.aop.proxy.ClassProxyFactory.getProxyClass(ClassProxyFactory.java:112) at org.jboss.aop.proxy.ClassProxyFactory.newInstance(ClassProxyFactory.java:130) at org.jboss.aop.proxy.ClassProxyFactory.newInstance(ClassProxyFactory.java:124) at org.jboss.aop.proxy.ClassProxyFactory.newInstance(ClassProxyFactory.java:75) at org.jboss.aop.proxy.ClassProxyFactory.newInstance(ClassProxyFactory.java:70) at org.jboss.cache.pojo.collection.CollectionInterceptorUtil.getMethodMap(CollectionInterceptorUtil.java:86) at org.jboss.cache.pojo.interceptors.dynamic.CachedSetInterceptor.(CachedSetInterceptor.java:42) . . . . There is one discussion on the internet (hibernate forum) that states that you can compile the org.hibernate.collection.AbstractPersistentCollection class so the methods are no longer final and then the problem is over. I can not imagine that this would be the way to go. There probably is a very solid reason why these methods are final. So what to do next? Who can help us solve this annoying and for us blocking problem. Kind regards, Werner van Mook View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=4247826#4247826 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=4247826 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Clustering/JBoss] - Re: Caching, hybernate and using enums = no go
Hi, filed this as a bug (JASSIST-90). regards, Werner van Mook View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=4244652#4244652 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=4244652 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Clustering/JBoss] - Re: Caching, hybernate and using enums = no go
I have a solution for my problem. I replaced the switch statement in the Request class with an if() else statement. I am now able to deploy the application. Let this be a lesson for all: Do not use enum with javassist and switch statements together! Although if() else isn't beautiful programming it does the job and that's the most important thing! Thanks all that replied to my posting. Regards, Werner View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=4243642#4243642 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=4243642 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Clustering/JBoss] - Re: Caching, hybernate and using enums = no go
Well, This is exactly the problem. The object needs to be a entity hence the @entity annotation AND it needs to be in JBoss Cache. Don't ask why. It needs to be. In the meantime I figured out that the problem has to do with javassist. Something is going wrong there. View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=4243581#4243581 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=4243581 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Clustering/JBoss] - Caching, hybernate and using enums = no go
Hi, We have JBoss AS 5.1.0 and use hibernate to store our session beans in MySQL DB. Also pojo caching is used to make the objects available throughout the cluster. For both hibernate and caching we use annotations. @Replicable for classes that need to go into cache and @Entity for objects that need to be stored using hibernate. We compile everything and the @Replicable classes with aopc. If we deploy the created jar file and start JBoss we get a java.lang.VerifyError. This error originates from a switch statement that is using an enum to switch. The enum is defined in a @Replicable class called HelperClass the switch method is defined in the bean called Request Disabling hibernate OR @Replicable OR both there is no problem starting JBoss. I can not imagine that this is an unknown problem, one of you probably must have had the same problem. If so what was the solution? Kind regards, Werner van Mook | package entity; | | import org.jboss.cache.pojo.annotation.Replicable; | import org.jboss.cache.pojo.annotation.Transient; | | | @Replicable | public class HelperClass { | | private RuntimeStateRange runtimeState = RuntimeStateRange.RESTING; | | public static enum RuntimeStateRange { | OFFLINE, | CONNECTED, | PROBLEM, | PROBLEM_CONNECTING, | PROBLEM_SENDING, | INTERRUPTED, | STOPPED, | INVALID, | RESTING, | BUSY, | INITIALIZING }; | | public HelperClass() { | System.out.println(HelperClass created.); | } | | public int EnumgetRuntimeState() { | return this.runtimeState.ordinal(); | } | | public RuntimeStateRange getRuntimeStateRange(){ | return runtimeState; | } | } | package entity; | | import javax.persistence.Entity; | import javax.persistence.GeneratedValue; | import javax.persistence.Id; | | import org.jboss.cache.pojo.annotation.Replicable; | | import entity.HelperClass.RuntimeStateRange; | | @Entity | @Replicable | public class Request { | | private long id; | private String filename; | | | public Request(){ | } | | /** | * @return the id | */ | @Id | @GeneratedValue | public long getId() { | return id; | } | | /** | * @param id the id to set | */ | public void setId(long id) { | this.id = id; | } | | /** | * @return the filename | */ | public String getFilename() { | return filename; | } | | /** | * @param filename the filename to set | */ | public void setFilename(String filename) { | this.filename = filename; | } | | @Override | public String toString() { | return id: + id + filename: + filename; | } | | public void inform() { | HelperClass help = new HelperClass(); | informDeviceStateWhileHavingFullLock(help); | } | | private void informDeviceStateWhileHavingFullLock(HelperClass osDeviceState) { | // Thread.currentThread().setName(JMS Inform device + getName() + + osDeviceState.EnumgetRuntimeState().toString()); | switch (osDeviceState.getRuntimeStateRange()) { | case PROBLEM_CONNECTING: | System.out.println(osDeviceState.EnumgetRuntimeState()); | break; | case PROBLEM_SENDING: | System.out.println(osDeviceState.EnumgetRuntimeState()); | break; | case CONNECTED: | System.out.println(osDeviceState.EnumgetRuntimeState()); | break; | case INVALID: | System.out.println(osDeviceState.EnumgetRuntimeState()); | break; | case INTERRUPTED: | System.out.println(osDeviceState.EnumgetRuntimeState()); | break; | case STOPPED: | System.out.println(osDeviceState.EnumgetRuntimeState()); | break; | default: | System.out.println(Device state default is always ignored); | break; | } | } | | | } View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=4242384#4242384 Reply to the post :