[JBoss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: Javassist errors with latest jboss
Well, like I said, using generics can cause this error, because it generates 2 different methods in runtime. Your example use the same principle of generics: u are redefining the returning type of a method to a subtype of original, and this produces the same two methods, one volatile, other concrete. Your code doesnt compile in JDK1.4 because there's no support to generics in it. My javassist mode will resolve your problem too. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3950678#3950678 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3950678 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: Javassist errors with latest jboss
I am getting the same error. I just wanted to add a little bit of information. For me my code worked fine with jboss-4.0.4.GA using the ejb3-clustered configuration. As soon as I updated to jboss-4.0.4-Patch1 with the same configuration and code, I began getting the errors described above. Similarily to the code listed by penczek I am using an inheritance hierarchy that inherits from a @MappedSuperclass, in which the getID method is defined, although my classes are not defined using generics a the class level. It seems as if the duplicate method error is always occurring on the member function that is annotated with the @Id annotation. It looks as if that is the case for penczek as well. Does this mean that the use of inheritance hierarchies with mapped superclasses is completely broken for this jboss release?? Is there any bug that was filed for this issue yet that anyone knows of?? View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3949961#3949961 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3949961 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: Javassist errors with latest jboss
I believe I figured out what the underlying issue is. see this post: http://www.jboss.com/index.html?module=bbop=viewtopict=84174 Apparently, when entities use inheritance and have a return type for an overridden method that is different form the base class the duplicate method exception occurrs. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3949964#3949964 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3949964 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Persistence,JBoss/CMP, Hibernate, Database] - Re: Javassist errors with latest jboss
We have produce the same error. In our case we have an entity called Contract which implements an interface where methods are defined which entity must implement. I think that javassist has problems enhancing entity object which implement an interface. Silvo Koren View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3945361#3945361 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3945361 --- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Persistence,JBoss/CMP, Hibernate, Database] - Re: Javassist errors with latest jboss
I have the exactly same problem here. I identified this error when my subclass extends other with generics, restricting the parameters. Example: --- | PersistentObject.java | | public interface PersistentObjectU, V extends java.io.Serializable { | public U getOid(); | public void setOid(U oid); | public V getVersion(); | public void setVersion(V version); | } | --- | BasePersistentObjectImpl.java | | public abstract class BasePersistentObjectImplOID, VERSION implements PersistentObjectOID, VERSION { | protected OID oid; | protected VERSION version; | public void setOid(OID oid) { | this.oid = oid; | } | public void setVersion(VERSION version) { | this.version = version; | } | } | --- | OIDPersistentObjectImpl.java | | import javax.persistence.*; | | @MappedSuperclass | public abstract class OIDPersistentObjectImplOID extends CharSequence, VERSION extends BasePersistentObjectImplOID, VERSION { | @Id | @GeneratedValue | public OID getOid() { | return oid; | } | @Version | public VERSION getVersion() { | return version; | } | } | --- | PersonVo.java | | public interface PersonVo extends PersistentObjectString, Integer { | public String getName(); | public void setName(String name); | } | --- | PersonVoImpl.java | | import javax.persistence.Entity; | | @Entity | public class PersonVoImpl extends OIDPersistentObjectImplString, Integer implements PersonVo { | private String name; | public String getName() { | return this.name; | } | public void setName(String name) { | this.name = name; | } | } | --- This example gives the following error: 12:15:40,372 ERROR [BasicLazyInitializer] Javassist Enhancement failed: test.PersonVoImpl | java.lang.RuntimeException: duplicate method: getOid | at javassist.util.proxy.ProxyFactory.createClass(ProxyFactory.java:173) | at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.getProxyFactory(JavassistLazyInitializer.java:141) | at org.hibernate.proxy.pojo.javassist.JavassistProxyFactory.postInstantiate(JavassistProxyFactory.java:42) | at org.hibernate.tuple.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:159) | at org.hibernate.tuple.AbstractEntityTuplizer.init(AbstractEntityTuplizer.java:131) | at org.hibernate.tuple.PojoEntityTuplizer.init(PojoEntityTuplizer.java:50) | at org.hibernate.tuple.TuplizerLookup.create(TuplizerLookup.java:64) | at org.hibernate.tuple.EntityMetamodel.init(EntityMetamodel.java:256) | at org.hibernate.persister.entity.AbstractEntityPersister.init(AbstractEntityPersister.java:418) | at org.hibernate.persister.entity.SingleTableEntityPersister.init(SingleTableEntityPersister.java:108) | at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55) | at org.hibernate.impl.SessionFactoryImpl.init(SessionFactoryImpl.java:223) | at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1213) | at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:631) | at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:760) | at org.hibernate.ejb.Ejb3Configuration.createContainerEntityManagerFactory(Ejb3Configuration.java:350) | at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:119) | at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:264) | 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.ejb3.ServiceDelegateWrapper.startService(ServiceDelegateWrapper.java:99) | 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
[JBoss-user] [Persistence,JBoss/CMP, Hibernate, Database] - Re: Javassist errors with latest jboss
Ok, some steps of debug later, i found that Jboss 4.0.4.ga.patch1 use javassist 3.2.0.cr2, and the production (stable) version of javassist is 3.1. Well, i tried to put the stable version in new Jboss and voilá, nothing happens, the error continued to occur. I think that the stable version of javassist, associated with the 3.1.beta version of hibernate annotations/entitymanager, the position of the Moon, Mars and Pluto was influencing this error. The error of duplicated method occurs because Sun has implemented generics in a very awful way: a unique generic method produces 2 method in runtime, with the same signature, one volatile returning Object, and other the correct. This was confusing my javassist, and making some mods I could correct the bizarre duplicated method error. Do something like that in class ProxyFactory: javassist.util.proxy.ProxyFactory | | ... | | private static boolean isVisible(int mod, String from, Member meth) { | // this allow generics | if ((mod Modifier.VOLATILE) != 0) | return false; | else if ((mod Modifier.PRIVATE) != 0) | return false; | else if ((mod (Modifier.PUBLIC | Modifier.PROTECTED)) != 0) | return true; | else { | String p = getPackageName(from); | String q = getPackageName(meth.getDeclaringClass().getName()); | if (p == null) | return q == null; | else | return p.equals(q); | } | } | } | | ... In this way, any volatile method isn't added to the class, avoiding the duplicated error. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3945510#3945510 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3945510 --- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid0709bid3057dat1642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Persistence,JBoss/CMP, Hibernate, Database] - Re: Javassist errors with latest jboss
Full stacktrace and the details of the deployment are needed to try to reproduce this. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3944561#3944561 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3944561 --- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Persistence,JBoss/CMP, Hibernate, Database] - Re: Javassist errors with latest jboss
Its hard to reproduce everything since its already a complete application A simple example is the Company class, mapped as | class name=Company table=company | id name=id type=integer | generator class=native / | /id | property name=name / | property name=enabled type=boolean / | | set name=applications table=app inverse=true | key column=company / | one-to-many class=Application/ | /set | | /class | the stack trace is | 2006-05-18 16:52:20,670 WARN [org.hibernate.tuple.PojoEntityTuplizer] could not create proxy factory for:Company | org.hibernate.HibernateException: Javassist Enhancement failed: Company | at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.getProxyFactory(JavassistLazyInitializer.java:149) | at org.hibernate.proxy.pojo.javassist.JavassistProxyFactory.postInstantiate(JavassistProxyFactory.java:42) | at org.hibernate.tuple.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:159) | at org.hibernate.tuple.AbstractEntityTuplizer.init(AbstractEntityTuplizer.java:131) | at org.hibernate.tuple.PojoEntityTuplizer.init(PojoEntityTuplizer.java:50) | at org.hibernate.tuple.TuplizerLookup.create(TuplizerLookup.java:64) | at org.hibernate.tuple.EntityMetamodel.init(EntityMetamodel.java:256) | at org.hibernate.persister.entity.AbstractEntityPersister.init(AbstractEntityPersister.java:418) | at org.hibernate.persister.entity.SingleTableEntityPersister.init(SingleTableEntityPersister.java:108) | at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55) | at org.hibernate.impl.SessionFactoryImpl.init(SessionFactoryImpl.java:223) | at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1213) | at org.jboss.hibernate.jmx.Hibernate.buildSessionFactory(Hibernate.java:231) | at org.jboss.hibernate.jmx.Hibernate.startService(Hibernate.java:155) | at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289) | at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245) | at sun.reflect.GeneratedMethodAccessor2.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:1007) | at org.jboss.deployment.MainDeployer.start(MainDeployer.java:997) | at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:808) | at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771) | at sun.reflect.GeneratedMethodAccessor55.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