11 Replies Latest reply on Aug 2, 2006 10:10 AM by Magdalena Piller

    Javassist throws SecurityException on new 4.0.4GA

    Pieter-Jan Malfait Newbie

      i just switched to from 4.0.3SP1 with EJB3 RC5 to 4.0.4GA with EJB3 RC8.
      i develop a Swing application in Eclipse and deploy it using Java Webstart.

      The server-side ear is still deploying fine on 4.0.4GA.
      Running the client from inside my development environment (Eclipse) works great too!
      Problems arise when i deploy the application with java webstart. Javassist seems to have problems with classes having the wrong signature. I sign my client jar and all the necessary libraries with the same certificate, i tripled checked this (i get no classnotfound errors in Eclipse, so i guess i have all the client libs).

      The problem arises when i try to load a entity with some atributes lazy initialised. I get the following exception (i left out the MarshallException/RuntimeException part) :

      Caused by: org.hibernate.HibernateException: Javassist Enhancement failed: com.acme.entities.contact.Dummy
       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.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
       at java.io.ObjectStreamClass.invokeReadResolve(Unknown Source)
       at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
       at java.io.ObjectInputStream.readObject0(Unknown Source)
       at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
       at java.io.ObjectInputStream.readSerialData(Unknown Source)
       at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
       at java.io.ObjectInputStream.readObject0(Unknown Source)
       at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
       at java.io.ObjectInputStream.readSerialData(Unknown Source)
       at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
       at java.io.ObjectInputStream.readObject0(Unknown Source)
       at java.io.ObjectInputStream.readObject(Unknown Source)
       at java.util.ArrayList.readObject(Unknown Source)
       at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
       at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
       at java.io.ObjectInputStream.readSerialData(Unknown Source)
       at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
       at java.io.ObjectInputStream.readObject0(Unknown Source)
       at java.io.ObjectInputStream.readObject(Unknown Source)
       at org.jboss.aop.joinpoint.InvocationResponse.readExternal(InvocationResponse.java:122)
       at java.io.ObjectInputStream.readExternalData(Unknown Source)
       at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
       at java.io.ObjectInputStream.readObject0(Unknown Source)
       at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
       at java.io.ObjectInputStream.readSerialData(Unknown Source)
       at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
       at java.io.ObjectInputStream.readObject0(Unknown Source)
       at java.io.ObjectInputStream.readObject(Unknown Source)
       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)
       ... 18 more
      Caused by: java.lang.RuntimeException: by java.lang.SecurityException: class "com.acme.entities.contact.Dummy_$$_javassist_0"'s signer information does not match signer information of other classes in the same package
       at javassist.util.proxy.ProxyFactory.createClass(ProxyFactory.java:173)
       at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.getProxy(JavassistLazyInitializer.java:79)
       ... 56 more
      Caused by: javassist.CannotCompileException: by java.lang.SecurityException: class "com.acme.entities.contact.Dummy_$$_javassist_0"'s signer information does not match signer information of other classes in the same package
       at javassist.util.proxy.FactoryHelper.toClass(FactoryHelper.java:125)
       at javassist.util.proxy.ProxyFactory.createClass(ProxyFactory.java:169)
       ... 57 more
      Caused by: java.lang.SecurityException: class "com.acme.entities.contact.Dummy_$$_javassist_0"'s signer information does not match signer information of other classes in the same package
       at java.lang.ClassLoader.checkCerts(Unknown Source)
       at java.lang.ClassLoader.preDefineClass(Unknown Source)
       at java.lang.ClassLoader.defineClass(Unknown Source)
       at java.lang.ClassLoader.defineClass(Unknown Source)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
       at javassist.util.proxy.FactoryHelper.toClass(FactoryHelper.java:117)
       ... 58 more
      


      No jars in the ear or the ear itself are signed (it wasn't necessary in 4.0.3SP1)
      When i sign the .ear file, behaviour is tha same.
      When i try signing the particular jar inside the ear that contains these classes i get following exception on deployment:

      org.jboss.deployment.DeploymentException: Error in accessing application metadata: ; - nested throwable: (java.lang.SecurityException: SHA1 digest error for
       at org.jboss.deployment.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:53)
       at org.jboss.deployment.EARDeployer.init(EARDeployer.java:275)
       at org.jboss.deployment.MainDeployer.init(MainDeployer.java:861)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:798)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
       at sun.reflect.GeneratedMethodAccessor50.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 $Proxy8.deploy(Unknown Source)
       at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
       at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:610)
       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.SecurityException: SHA1 digest error for dummy-all.jar
       at sun.security.util.ManifestEntryVerifier.verify(ManifestEntryVerifier.java:196)
       at java.util.jar.JarVerifier.processEntry(JarVerifier.java:201)
       at java.util.jar.JarVerifier.update(JarVerifier.java:188)
       at java.util.jar.JarVerifier$VerifierStream.read(JarVerifier.java:403)
       at java.io.FilterInputStream.read(FilterInputStream.java:111)
       at java.io.FilterInputStream.read(FilterInputStream.java:90)
       at org.jboss.util.file.JarUtils.extractNestedJar(JarUtils.java:380)
       at org.jboss.deployment.EARDeployer.init(EARDeployer.java:211)
      


      anyone knows what could cause this problem ? am i doing something wrong ?

      thank you very much in advance!