[JBoss JIRA] Commented: (HIBERNATE-37) Problem in javassist instrumentation
by JBoss User (JIRA)
[ http://jira.jboss.com/jira/browse/HIBERNATE-37?page=comments#action_12339548 ]
JBoss User commented on HIBERNATE-37:
-------------------------------------
I get the same error when trying to implement the clone method:
public Object clone () {
//non-relevant code here...
Object o = super.clone();
return o;
}
> Problem in javassist instrumentation
> ------------------------------------
>
> Key: HIBERNATE-37
> URL: http://jira.jboss.com/jira/browse/HIBERNATE-37
> Project: Hibernate
> Issue Type: Bug
> Environment: JBoss 4.0.4.GA
> Hibernate 3.2 cr2
> JDK 1.5 compiler
> Reporter: Paolo Perrucci
> Assigned To: Steve Ebersole
>
> Given the following model:
> public interface I
> {
> public Long getId();
> public void setId(Long id);
> public Number m1();
> }
> public class A implements I
> {
> private Long id;
> public Long getId() { return id; }
> public void setId(Long id) { this.id = id; }
> public Integer m1() { return 0; }
> }
> <hibernate-mapping>
> <class name="A" table="as" dynamic-update="true" dynamic-insert="true">
> <id name="id" type="java.lang.Long">
> <generator class="native"/>
> </id>
> </class>
> </hibernate-mapping>
> When I deploy the har file to jboss I have the exceptions:
> 12:30:15,625 ERROR [BasicLazyInitializer] Javassist Enhancement failed: A
> java.lang.RuntimeException: duplicate method: m1
> 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.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.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.GeneratedMethodAccessor6.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.deploy(MainDeployer.java:808)
> at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
> at sun.reflect.GeneratedMethodAccessor14.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 $Proxy6.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$ScannerThread.loop(AbstractDeploymentScanner.java:274)
> at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
> Caused by: javassist.CannotCompileException: duplicate method: m1
> at javassist.bytecode.ClassFile.testExistingMethod(ClassFile.java:544)
> at javassist.bytecode.ClassFile.addMethod(ClassFile.java:528)
> at javassist.util.proxy.ProxyFactory.override(ProxyFactory.java:373)
> at javassist.util.proxy.ProxyFactory.overrideMethods(ProxyFactory.java:349)
> at javassist.util.proxy.ProxyFactory.make(ProxyFactory.java:277)
> at javassist.util.proxy.ProxyFactory.createClass(ProxyFactory.java:164)
> ... 59 more
> 12:30:15,671 WARN [PojoEntityTuplizer] could not create proxy factory for:A
> org.hibernate.HibernateException: Javassist Enhancement failed: A
> 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.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.GeneratedMethodAccessor6.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.deploy(MainDeployer.java:808)
> at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
> at sun.reflect.GeneratedMethodAccessor14.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 $Proxy6.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$ScannerThread.loop(AbstractDeploymentScanner.java:274)
> at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
> Caused by: java.lang.RuntimeException: duplicate method: m1
> at javassist.util.proxy.ProxyFactory.createClass(ProxyFactory.java:173)
> at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.getProxyFactory(JavassistLazyInitializer.java:141)
> ... 58 more
> Caused by: javassist.CannotCompileException: duplicate method: m1
> at javassist.bytecode.ClassFile.testExistingMethod(ClassFile.java:544)
> at javassist.bytecode.ClassFile.addMethod(ClassFile.java:528)
> at javassist.util.proxy.ProxyFactory.override(ProxyFactory.java:373)
> at javassist.util.proxy.ProxyFactory.overrideMethods(ProxyFactory.java:349)
> at javassist.util.proxy.ProxyFactory.make(ProxyFactory.java:277)
> at javassist.util.proxy.ProxyFactory.createClass(ProxyFactory.java:164)
> ... 59 more
> It seems that the problem is due to how the jdk 1.5 compiler create the class A.
> Using javap you can see that A.class contains this two method:
> public java.lang.Integer m1();
> public java.lang.Number m1();
> Actually the A.class contains the same method name twice.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
20 years
[JBoss JIRA] Updated: (JBPORTAL-914) munges URLs but doesn't handle the common case of reference's resources
by Roy Russo (JIRA)
[ http://jira.jboss.com/jira/browse/JBPORTAL-914?page=all ]
Roy Russo updated JBPORTAL-914:
-------------------------------
Affects Version/s: 2.6 Final
(was: 2.4 Final)
> munges URLs but doesn't handle the common case of reference's resources
> -----------------------------------------------------------------------
>
> Key: JBPORTAL-914
> URL: http://jira.jboss.com/jira/browse/JBPORTAL-914
> Project: JBoss Portal
> Issue Type: Sub-task
> Security Level: Public(Everyone can see)
> Components: Portal CMS
> Affects Versions: 2.6 Final
> Environment: ALL
> Reporter: Ezra Epstein
> Assigned To: Roy Russo
> Priority: Minor
> Fix For: 2.6 Final
>
>
> The CMS should work with standard content. If an html file would work in an Apache server or as static content in JBoss it should work in the CMS. Thus if there's an <img> tag in an .html file referencing a file images/pretty.jpeg and that .html files is uploaded and so is the image the image should be found. But, oops, it won't be. Why not? Because (by default) the relative URL for the image under the CMS system is actually default/images/pretty.jpeg and not the original images/pretty.jpeg. It's fine for CMS to do this, but then CMSPortlet, since it munges relative URLs anyway, should account for this.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
20 years
[JBoss JIRA] Updated: (JBPORTAL-885) Absolute paths in URL references (e.g., <a href=?>, <img src=?>, etc.) are munged. They should not be!
by Roy Russo (JIRA)
[ http://jira.jboss.com/jira/browse/JBPORTAL-885?page=all ]
Roy Russo updated JBPORTAL-885:
-------------------------------
Fix Version/s: 2.6 Final
(was: 2.4 Final)
Affects Version/s: 2.6 Final
(was: 2.2 Final)
> Absolute paths in URL references (e.g., <a href=?>, <img src=?>, etc.) are munged. They should not be!
> --------------------------------------------------------------------------------------------------------
>
> Key: JBPORTAL-885
> URL: http://jira.jboss.com/jira/browse/JBPORTAL-885
> Project: JBoss Portal
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Portal CMS
> Affects Versions: 2.6 Final
> Environment: Linux
> Reporter: Sandeep Pujar
> Assigned To: Roy Russo
> Priority: Minor
> Fix For: 2.6 Final
>
> Attachments: CMSPortlet.java
>
>
> BACKGROUND: CMS Portlet converts URL references in its content so those references correctly pull content into the CMS Portlet for display. The logic correctly checks to see if the url is fully qualified (e.g., starting with http://) and, if so, leaves the URL reference unchanged. The logic does not do a similar check for absolute, but unqualified, paths (e.g., starting just with /), but it should.
> For example, if one wants to link to a different page in the portal from within some CMS content one natural way to do it is with an absolute path. Since this doesn't work one is forced to use a full URL. But that's a problematic approach.
> We deploy 2 version of site, one in test and one in production. Each has a different domain so it is not appropriate to put a complete URL in our CMS content. But we definitely need our content to be able to include links to other parts of our site/portal that are not CMS content (e.g., links to other pages). The overly aggressive URL munging prevents this.
> FIX: The same logic needs to check whether the URL is an absolute path (starts with /) and if so, leave it unchanged as well. I.e., only relative URLs should be munged. All others should be left alone.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
20 years
[JBoss JIRA] Updated: (JBPORTAL-914) munges URLs but doesn't handle the common case of reference's resources
by Roy Russo (JIRA)
[ http://jira.jboss.com/jira/browse/JBPORTAL-914?page=all ]
Roy Russo updated JBPORTAL-914:
-------------------------------
Fix Version/s: 2.6 Final
(was: 2.4 Final)
Assignee: Roy Russo
> munges URLs but doesn't handle the common case of reference's resources
> -----------------------------------------------------------------------
>
> Key: JBPORTAL-914
> URL: http://jira.jboss.com/jira/browse/JBPORTAL-914
> Project: JBoss Portal
> Issue Type: Sub-task
> Security Level: Public(Everyone can see)
> Components: Portal CMS
> Affects Versions: 2.6 Final
> Environment: ALL
> Reporter: Ezra Epstein
> Assigned To: Roy Russo
> Priority: Minor
> Fix For: 2.6 Final
>
>
> The CMS should work with standard content. If an html file would work in an Apache server or as static content in JBoss it should work in the CMS. Thus if there's an <img> tag in an .html file referencing a file images/pretty.jpeg and that .html files is uploaded and so is the image the image should be found. But, oops, it won't be. Why not? Because (by default) the relative URL for the image under the CMS system is actually default/images/pretty.jpeg and not the original images/pretty.jpeg. It's fine for CMS to do this, but then CMSPortlet, since it munges relative URLs anyway, should account for this.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
20 years