Uploaded image for project: 'Javassist'
  1. Javassist
  2. JASSIST-28

javassist enhancement failed on deserializing hibernate proxies

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      hibernate 3.2.0GA, javassist 3.3, jboss 4.0.4GA

      Description

      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)

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                chiba Shigeru Chiba
                Reporter:
                arminhaaf Armin Haaf
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: