0 Replies Latest reply: Apr 13, 2010 7:50 AM by 843802 RSS

    Java Plugin failed to load a set of backported classes.

    843802
      Hi all,

      We have detected an strange behavior we would like to share here just in case anyone has experienced the same situation and got the clue.

      To fit some project needs, we have had to backport XML signature implementation from Java 1.6 to 1.5 version, in order to do such a thing, we have ported the necessary com.sun.org.apache.xml.internal.security classes that together with the xmldsign-1.0.jar give us the Xml Signature functionality needed. We have tested the backport using Java 1.5 through command line and everything worked right as we expected. The problem arises when we try to do the same on an applet based application, we have experienced three strange behaviors here: (the final involved jars are xmldsign-1.0.jar and our backport named xmlsec-backport-jdk6-1.6.0_15.jar, this behavior was experienced using Windows XP with Internet Explorer 8.0.6001.18702, the Java plugin used is [3]).

      1. When we have Java jre 1.5 and Java jre 1.6 installed and we select to use Java jre 1.5 from the Java Control Panel the applet indicates in the java console that Java 1.5 is being used and a test signature is performed right without failure.
      2. When we uninstall Java jre 1.6 or install jre 1.5 on a clean machine and try to repeat the same operation, a java.lang.ClassNotFoundException[1] is raised (both .jar files are correctly included in the archive attribute[2] of the applet tag used for its deployment)
      3. If we copy the file xmlsec-backport-jdk6-1.6.0_15.jar into the C:\Program Files\Java\jre1.5.0_17\lib\ext and try to do the test again using the applet, the signature is done right and the exception is not raised.

      Obviously, for a common deployment, situation 2 should work.

      Any help or clue on this issue will be appreciated I can give more details if needed or give an URL to test.

      Best Regards.
      Paúl.


      [1] Important data from exception:
      java.lang.ClassNotFoundException: com.sun.org.apache.xml.internal.security.transforms.implementations.TransformBase64Decode
      at java.net.URLClassLoader$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClassInternal(Unknown Source)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Unknown Source)
      at com.sun.org.apache.xml.internal.security.transforms.Transform.register(Transform.java:281)
      at com.sun.org.apache.xml.internal.security.Init.init(Init.java:235)
      at org.jcp.xml.dsig.internal.dom.DOMXMLSignature.<clinit>(DOMXMLSignature.java:62)
      at org.jcp.xml.dsig.internal.dom.DOMXMLSignatureFactory.newXMLSignature(DOMXMLSignatureFactory.java:49)
      at net.java.xades.security.xml.XAdES.XMLAdvancedSignature.sign(XMLAdvancedSignature.java:160)
      at es.uji.security.crypto.jxades.JXAdESSignatureFactory.formatSignature(JXAdESSignatureFactory.java:154)
      at es.uji.security.ui.applet.SignatureThread.run(SignatureThread.java:306)
      java.lang.ClassNotFoundException: com.sun.org.apache.xml.internal.security.transforms.implementations.TransformC14N
      [...]
      java.lang.ClassNotFoundException: com.sun.org.apache.xml.internal.security.transforms.implementations.TransformC14NWithComments
      [...]
      java.lang.ClassNotFoundException: com.sun.org.apache.xml.internal.security.transforms.implementations.TransformC14NExclusive
      [...]
      java.lang.ClassNotFoundException: com.sun.org.apache.xml.internal.security.transforms.implementations.TransformC14NExclusiveWithComments
      [...]
      java.lang.ClassNotFoundException: com.sun.org.apache.xml.internal.security.transforms.implementations.TransformXPath
      [...]
      java.lang.ClassNotFoundException: com.sun.org.apache.xml.internal.security.transforms.implementations.TransformEnvelopedSignature
      [...]
      java.lang.ClassNotFoundException: com.sun.org.apache.xml.internal.security.transforms.implementations.TransformXSLT
      [...]
      java.lang.ClassNotFoundException: com.sun.org.apache.xml.internal.security.transforms.implementations.TransformXPath2Filter
      [...]
      java.lang.ClassNotFoundException: com.sun.org.apache.xml.internal.security.transforms.implementations.TransformXPath2Filter
      [...]



      [2] Trace section regarding downloaded jar files (It shows file has been downloaded and catched):
      network: Conectando http://lab9052.inv.uji.es/~paul/test/v2.1/app/lib/xmldsign-1.0.jar con proxy=DIRECT
      network: Conectar http://lab9052.inv.uji.es/~paul/test/v2.1/app/lib/xmldsign-1.0.jar
      basic: Carga de http://lab9052.inv.uji.es/~paul/test/v2.1/app/lib/xmldsign-1.0.jar desde la antememoria
      basic: Reading cached JAR file from JRE 1.5 release
      basic: Los certificados para http://lab9052.inv.uji.es/~paul/test/v2.1/app/lib/xmldsign-1.0.jar se leen desde la antememoria JAR
      network: Conectando http://lab9052.inv.uji.es/~paul/test/v2.1/app/lib/xmlsec-backport-jdk6-1.6.0_15.jar con proxy=DIRECT
      network: Conectar http://lab9052.inv.uji.es/~paul/test/v2.1/app/lib/xmlsec-backport-jdk6-1.6.0_15.jar
      basic: Carga de http://lab9052.inv.uji.es/~paul/test/v2.1/app/lib/xmlsec-backport-jdk6-1.6.0_15.jar desde la antememoria
      basic: Reading cached JAR file from JRE 1.5 release
      basic: Los certificados para http://lab9052.inv.uji.es/~paul/test/v2.1/app/lib/xmlsec-backport-jdk6-1.6.0_15.jar se leen desde la antememoria JAR


      [3] The Java Plugin used:
      Archivo: NPJPI150_17.dll
      Versión: 5.0.170.4
      Java Plug-in 1.5.0_17 for Netscape Navigator (DLL Helper)

      Edited by: clauer on Apr 13, 2010 5:50 AM