1 Reply Latest reply on May 3, 2004 8:00 AM by bill.burke

    JBossAOPized application NoClassDefFoundError: org/jboss/aop

    bensench

      Has anyone JBossAOPized any JBoss application and successfully on JBoss?

      I tried to JBossAOPized an application and run it on JBoss 3.0.6. I got the following error messages:

      javax.servlet.ServletException: Unexpected Error
      java.lang.NoClassDefFoundError: org/jboss/aop/AspectManager
      at xpetstore.services.petstore.ejb.PetstoreEJB.(Unknown Source)

      The original application was runnable on JBoss 3.0.6.

      What I did was:

      1. Created an jboss-aop.xml to include a MethodInterceptor to intercept any methods invoked
      on a session EJB, CustomerEJB.
      2. Compiled the MethodInterceptor and aopc the classses files as the example build.xml does.
      This step also AOPized another session EJB, PetstoreEJB which "utilizes" CustomerEJB.
      3. Built the Ear file of the application containing some JBossAOPized class files.
      4. Copied jboss-aop.xml to the lib directory of the JBoss application.
      5. Starts JBoss with the following command:
      run -c myapp
      6. Copied the application Ear file to the deploy directory.
      7. Accessed the application index.jsp using web browser.
      8. Clicked a link which sent request to PetstoreEJB. This step result a ServletException as
      mentioned above.

      I had the jboss-aop.jar in the lib directory of the application, ie, $(JBOSS_HOME}/server/myapp/lib

      Do I have to change the run.bat file? Since I pre-compiled the classes,
      I shouldn't have to specify the option:
      -Djava.system.class.loader=org.jboss.aop.standalone.SystemClassLoader
      Right?

      Thanks in advance.

      Ben C

        • 1. Re: JBossAOPized application NoClassDefFoundError: org/jboss
          bill.burke

          jboss aop requires these jars:

          jboss-aop.jar
          jboss-common.jar
          trove.jar
          concurrent.jar
          qdox.jar
          javasssist.jar

          The jboss-common.jar will be incompatible with JBoss 3.0.6's jar of the same name. This is a lack of foresight on my part and I need to remove the dependency on jboss-common.jar so that you can use the AOP stuff in older versions of JBoss. Ironically, you CAN use JBoss aop in other application servers, but not older versions of JBoss :(

          The next release of JBoss AOP will allow you to run in older versions of JBoss. I hope to release next week. What I'll do is repost to this forum and tell you what classes you need to remove from the JBOss AOP distributed jboss-common.jar and add them to jboss-aop.jar.

          Bill