12 Replies Latest reply on Sep 23, 2004 11:42 AM by bill.burke

    java.lang.ClassNotFoundException: org.jboss.aspects.security

    c96mud

      I'm trying to setup JBoss AOP with JBoss 3.2.4 AS, but run into this problem:

      java.lang.ClassNotFoundException: org.jboss.aspects.security.SecurityClassMetaDataLoader

      In jboss-service.xml I have
      ...
      true
      ...

      The required jar-files (jboss-aop.jar, javassist.jar, trove.jar and jboss-aspects.jar) are in my JBOSS_HOME/server/xxx/lib directory.

      The class SecurityClassMetaDataLoader is available in jboss-aspects.jar but is not loaded for some reason. Other classes in the same jar (ex: AspectManagerService) are loaded just fine.

      Any suggestions?

      rgds /Markus

        • 1. Re: java.lang.ClassNotFoundException: org.jboss.aspects.secu
          c96mud

          (corrects previous post)

          In my jboss-service.xml I have:

          ...
          <attribute name="EnableTransformer">true</attribute>
          ...
          


          • 2. Re: java.lang.ClassNotFoundException: org.jboss.aspects.secu
            c96mud

            Hmm... I would like to add that the reference to
            org.jboss.aspects.security.SecurityClassMetaDataLoader
            comes from base-aop.xml that I copied from the 4.0.0DR4 release to the /conf directory.

            However, if this file is removed entirely the startup complains about that too (Failed to obtain InputStream). If I remove the contents between the aop tags in base-aop.xml, I get another problem:

            java.lang.NoClassDefFoundError: org/jboss/web/ThreadPool$Worker

            ?!?!

            Anyone else that has seen this problem?

            rgds /Markus

            • 3. Re: java.lang.ClassNotFoundException: org.jboss.aspects.secu
              solo

              No I did the following (basically):

              * Downloaded Jboss 3.2.4
              * Copied the jar files (for aop and the aspects)
              * Modified the jboss-service.xml
              * Added the base-aop.xml to the conf dir

              ... And deployed my aop app.. worked...

              /mario

              ---- jboss-service.xml --------------
              <!-- Aspect service manager -->

              false
              <!-- only relevant when EnableTransformer is true -->
              true
              <!-- only relevant when Enabletransformer is true. Optimization is optional only just in case there is a bug in it -->
              true
              true


              <!-- Aspect deployer -->

              • 4. Re: java.lang.ClassNotFoundException: org.jboss.aspects.secu
                c96mud

                Hi, thanks for replying...

                I think the problem has got to do with the fact that I need to use the customized classloader approach...

                In my aspect configuration of jboss-service.xml I use

                <attribute name="EnableTransformer">true</attribute>
                


                to enable this. I noticed that you had not done that in the XML you pasted in your reply...

                Any other ideas?

                /Markus

                • 5. Re: java.lang.ClassNotFoundException: org.jboss.aspects.secu
                  solo

                  Ooops sorry,
                  enabled it and it still works, though I did need to increase the amount of memory for the JVM (Out of memory exceptions).

                  ...and a ugly startup "picture" while trying to instrument e.g. some tomcat classes....

                  My ear deployed ok with the ejb and aop and worked for invocation and webconsole did ok (haven't tried anything elese than my small hack).

                  /Mario

                  • 6. Re: java.lang.ClassNotFoundException: org.jboss.aspects.secu
                    bill.burke

                    I have somebody working on improving load-time transformation.

                    • 7. Re: java.lang.ClassNotFoundException: org.jboss.aspects.secu

                      Is there a way / workaround to overcome this error ? (I want to work with AOP on jboss-3.2.5 and I receive this exception when starting up jboss with the EnableTransformer=true...)

                      • 8. Re: java.lang.ClassNotFoundException: org.jboss.aspects.secu
                        bill.burke

                        which error are you seeing?

                        • 9. Re: java.lang.ClassNotFoundException: org.jboss.aspects.secu

                           

                          16:53:25,259 INFO [ServerInfo] Java VM: Java HotSpot(TM) Client VM 1.4.2_05-b04
                          ,Sun Microsystems Inc.
                          16:53:25,259 INFO [ServerInfo] OS-System: Windows 2000 5.0,x86
                          16:53:25,852 INFO [Server] Core system initialized
                          <b>java.lang.ClassNotFoundException: org.jboss.aspects.security.SecurityClassMetaDa
                          taLoader</b>
                          at org.jboss.mx.loading.UnifiedClassLoader.findClass(UnifiedClassLoader.
                          java:511)
                          at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
                          at org.jboss.mx.loading.UnifiedClassLoader.loadClassLocally(UnifiedClass
                          Loader.java:298)
                          at org.jboss.mx.loading.ClassLoadingTask$ThreadTask.run(ClassLoadingTask
                          .java:118)
                          at org.jboss.mx.loading.LoadMgr3.nextTask(LoadMgr3.java:360)


                          My configuration :

                          in server/configuration_name/lib I have these jars :
                          jboss-aspect-library.jar
                          javassist.jar
                          trove.jar
                          jboss-aop.jar

                          in server/configuration_name/conf/in jboss-service.xml EnableTransformer is true

                          and I have copied the base-aop.xml from the aop package I downloaded to my
                          server/configuration_name/conf directory...

                          I have tried both running from default configuration and by using the all configuration (-c all)

                          • 10. Re: java.lang.ClassNotFoundException: org.jboss.aspects.secu
                            bill.burke

                            You must also have the jboss-aspect library within the lib/ directory.

                            Let me know if that fixes it.

                            Thanks,

                            Bill

                            • 11. Re: java.lang.ClassNotFoundException: org.jboss.aspects.secu

                              Hi

                              I saw no jboss-aspect.jar in jboss-aop-1.0RC1.zip nor in jboss-aspect-library-1.0RC1.zip (however there do exists jboss-aspect-library.jar that contains the class that was not found -org.jboss.aspects.security.SecurityClassMetaDataLoader. So the jar is there in my server/configuratoin_name/lib

                              The thing is that with EnableTransformer set to true I receive MANY classNotFoundException's for : org.jnp.interfaces.NamingContextFactory, org.jboss.invocation.http.server.HttpInvoker, org.jboss.resource.RARDeployer, org/apache/log4j/xml/DOMConfigurator (java.lang.NoClassDefFoundError: org/apache/log4j/xml/DOMConfigurator as for the rest and more...)
                              (with EnableTransformer set to false everything is fine).

                              When I included for example jboss-aspect-library.jar in my system classpath then I didnt receive ofcourse ClassNotFoundException for it...

                              Anything I can try ?

                              Thanks,

                              Tomer

                              • 12. Re: java.lang.ClassNotFoundException: org.jboss.aspects.secu
                                bill.burke

                                I have not tested RC1 yet with 3.2.5.