5 Replies Latest reply on Apr 17, 2005 1:17 PM by Danai W.

    JBossAOP and static inner class loading

    Danai W. Newbie

      Hi All,

      I am unsuccessful in using JBossAOP1.1.2 to load static inner class. Below is a part of the error message:

      ...
      [Loaded org.bouncycastle.jce.provider.JCEBlockCipher]
      [Loaded org.bouncycastle.jce.provider.JCEBlockCipher$DESede]
      org.apache.ws.security.WSSecurityException: An unsupported signature or encryption algorithm was used; nested exception is:
       org.apache.xml.security.encryption.XMLEncryptionException: Cannot find any provider supporting DESede/CBC/ISO10126Padding
      ...


      If I run, "java -verbose -Djava.system.class.loader=org.jboss.aop.standalone.SystemClassLoader MyClass", I will get the error message as shown above.
      But if I run "java -verbose MyClass", everything works fine.

      I also verified that the inner class (JCEBlockCipher$DESede) is in the same jar as its outer class (JCEBlockCipher), and the jar is in the classpath.

      Here is the JCEBlockCipher snippet source code:
      package org.bouncycastle.jce.provider;
      
      public class JCEBlockCipher extends WrapCipherSpi
       implements PBE
      {
       // hiding outer class implementation
      
       /**
       * DESede
       */
       static public class DESede
       extends JCEBlockCipher
       {
       public DESede()
       {
       super(new DESedeEngine());
       }
       }// end inner class
      
      }
      

      (For the complete source code, please download http://www.bouncycastle.org/download/jce-jdk13-127.zip.)

      It seems to me that JBossAOP fails to load static inner class. Is there any way to work around this problem?

      I truely appreciate any comments and suggestions.

      -j

        • 1. Re: JBossAOP and static inner class loading
          Danai W. Newbie

          For more information, I'm using jdk1.4.2_06-b03.
          Also I believe that the class DESedeEngine and its related classes are already in the system classpath.

          • 3. Re: JBossAOP and static inner class loading
            Danai W. Newbie

            I run the following:

            java org.jboss.aop.hook.GenerateInstrumentedClassLoader C:\testaop

            Then I got C:\testaop\java\lang\ClassLoader.class

            Then I run (with all required already in classpath)
            java -Xbootclasspath/p:C:\testaop\java\lang\ClassLoader com.bar.MyClass


            I still got the same error. However, it seems to me that jdk5+jbossaop for jdk5 solve the error. It works fine as it's expected to be. I'd, at this time, move to jdk5.

            Kabir, Thank you very much for your suggestion.
            -j


            • 4. Re: JBossAOP and static inner class loading
              Kabir Khan Master

              Cool,

              However for JDK 1.4 your command line should be

              java -Xbootclasspath/p:C:\testaop com.bar.MyClass
              


              i.e. C:\testaop contains the java\lang\ directory structure.

              Also, make sure that C:\testaop is not the directory where your main classes are (otherwise they get added to the bootclasspath too)

              • 5. Re: JBossAOP and static inner class loading
                Danai W. Newbie

                Kabir,
                I have tried

                java -Xbootclasspath/p:C:\testaop com.bar.MyClass
                

                as well. But I got the error msg below:
                Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/aop/AspectManager
                 at java.lang.ClassLoader.defineClass(Unknown Source)
                 at java.security.SecureClassLoader.defineClass(Unknown Source)
                 at java.net.URLClassLoader.defineClass(Unknown Source)
                 at java.net.URLClassLoader.access$100(Unknown Source)
                 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)
                

                I believe that jboss-aop.jar is in the classpath. (I set it in both window environment and script environment.) I have no idea why it could not find org/jboss/aop/AspectManager.

                Thanks,
                -j