[jboss-jira] [JBoss JIRA] Commented: (JASSIST-28) javassist enhancement failed on deserializing hibernate proxies

Shigeru Chiba (JIRA) jira-events at jboss.com
Thu Oct 19 12:29:41 EDT 2006


    [ http://jira.jboss.com/jira/browse/JASSIST-28?page=comments#action_12345512 ] 
            
Shigeru Chiba commented on JASSIST-28:
--------------------------------------

Thank you for the test case.

We (Muga Nishizawa and I) found that the problem is due to a difference in their caching scheme
between Cglib and Javassist.  Cglib records all proxy classes that have been generated but Javassist
does not for saving memory consumption (or avoiding memory leak).  Since your test code repeatedly 
creates the same proxy class, Javassist creates the same class more than once and attempts to load them.  
The loading is rejected by the JVM and an exception is thrown.

We will fix this problem soon (when we find the best caching scheme for proxy classes).

Thank you for your bug report and help!


> javassist enhancement failed on deserializing hibernate proxies
> ---------------------------------------------------------------
>
>                 Key: JASSIST-28
>                 URL: http://jira.jboss.com/jira/browse/JASSIST-28
>             Project: Javassist
>          Issue Type: Bug
>         Environment: hibernate 3.2.0GA, javassist 3.3, jboss 4.0.4GA
>            Reporter: Armin Haaf
>         Assigned To: Shigeru Chiba
>         Attachments: TestJavassistSerializationPerformance.java
>
>
> on deserializing objects load by hibernate on a jbossas with uninitialized proxies we the following exception on a performance/concurrent testing:
> Exception in thread "Thread-7" org.hibernate.HibernateException: Javassist Enhancement failed: de.mueller.wms.base.model.impl.StorageImpl
> 	at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.getProxy(JavassistLazyInitializer.java:88)
> 	at org.hibernate.proxy.pojo.javassist.SerializableProxy.readResolve(SerializableProxy.java:54)
> 	at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at java.io.ObjectStreamClass.invokeReadResolve(ObjectStreamClass.java:1033)
> 	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1728)
> 	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
> 	at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1908)
> 	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1832)
> 	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
> 	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
> 	at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1908)
> 	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1832)
> 	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
> 	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
> 	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
> 	at org.jboss.aop.joinpoint.InvocationResponse.readExternal(InvocationResponse.java:122)
> 	at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1755)
> 	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1717)
> 	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
> 	at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1908)
> 	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1832)
> 	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
> 	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
> 	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
> 	at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.receiveObject(JavaSerializationManager.java:128)
> 	at org.jboss.remoting.marshal.serializable.SerializableUnMarshaller.read(SerializableUnMarshaller.java:66)
> 	at org.jboss.remoting.transport.socket.SocketClientInvoker.transport(SocketClientInvoker.java:279)
> 	at org.jboss.remoting.RemoteClientInvoker.invoke(RemoteClientInvoker.java:143)
> 	at org.jboss.remoting.Client.invoke(Client.java:525)
> 	at org.jboss.remoting.Client.invoke(Client.java:488)
> 	at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:55)
> 	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
> 	at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
> 	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
> 	at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:55)
> 	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
> 	at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:65)
> 	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
> 	at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:102)
> 	at $Proxy2.executeCommand(Unknown Source)
> 	at de.mueller.wms.base.service.JndiRemoteLookupDelegateImpl$CommandExecutionInvocationHandler.invoke(JndiRemoteLookupDelegateImpl.java:57)
> 	at $Proxy1.changeStock(Unknown Source)
> 	at de.mueller.wms.base.TestJBossPerformance$1.run(TestJBossPerformance.java:58)
> Caused by: java.lang.RuntimeException: by java.lang.LinkageError: duplicate class definition: de/mueller/wms/base/model/impl/StorageImpl_$$_javassist_1272
> 	at javassist.util.proxy.ProxyFactory.createClass(ProxyFactory.java:174)
> 	at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.getProxy(JavassistLazyInitializer.java:79)
> 	... 44 more
> Caused by: javassist.CannotCompileException: by java.lang.LinkageError: duplicate class definition: de/mueller/wms/base/model/impl/StorageImpl_$$_javassist_1272
> 	at javassist.util.proxy.FactoryHelper.toClass(FactoryHelper.java:167)
> 	at javassist.util.proxy.ProxyFactory.createClass(ProxyFactory.java:170)
> 	... 45 more
> Caused by: java.lang.LinkageError: duplicate class definition: de/mueller/wms/base/model/impl/StorageImpl_$$_javassist_1272
> 	at java.lang.ClassLoader.defineClass1(Native Method)
> 	at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
> 	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 javassist.util.proxy.FactoryHelper.toClass(FactoryHelper.java:159)
> 	... 46 more
>  
> The performance is also very bad in comparison with cglib proxies (in our performance test with cglib proxies the test runs 3x faster)

-- 
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

        



More information about the jboss-jira mailing list