Results 1 to 4 of 4

Thread: Spring-aop and AspectJ

  1. #1
    Join Date
    Dec 2011
    Posts
    14

    Question Spring-aop and AspectJ

    I have written a Spring-aop(v3.0.5) interceptor for profiling public methods, and this application is deployed in Weblogic 11g. Since spring-aop is dependent on aspectjrt.jar & aspectweaver.jar I have included these in the application classpath(to gether wiith all the spring jars). However when the spring application context is initialized an exception is thrown;
    Code:
    Caused by: java.lang.NoClassDefFoundError
    	at org.springframework.aop.aspectj.AbstractAspectJAdvice.class$(AbstractAspectJAdvice.java:64)
    	at org.springframework.aop.aspectj.AbstractAspectJAdvice.<clinit>(AbstractAspectJAdvice.java:64)
    	at java.lang.Class.forName0(Native Method)
    	at java.lang.Class.forName(Class.java:169)
    ............
    Caused by: java.lang.ClassNotFoundException: org.aspectj.lang.JoinPoint
    	at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    If the 2 jars aspectjrt.jar & aspectweaver.jar are placed in startWeblogic.cmd classpath everything works fine.

    AbstractAspectJAdvice.java:64 has the code
    Code:
    protected final static String JOIN_POINT_KEY = JoinPoint.class.getName();
    If I do the exact same line from my source code without including aspectj jars in startWeblogic.cmd classpath I get no errors, hance I am thinking the issue is with spring loading aspectj classes.
    Would like to know if anyone faced/resoled similar issues and how does spring-aop loads aspectj

  2. #2

    Default

    Hi,

    I have the same problem. Did you manage to fix this? If yes, how?

    regards,
    Nadeem

  3. #3
    Join Date
    Dec 2011
    Posts
    14

    Default

    Sorry, didn't spend enough time on this lately. Will let you know if Ifind something.

  4. #4
    Join Date
    Dec 2011
    Posts
    14

    Default

    Load spring libs through filtered class loader
    http://docs.oracle.com/cd/E15051_01/...html#wp1073491

    weblogic-application.xml

    <prefer-application-packages>
    <package-name>org.springframework.*</package-name>
    </prefer-application-packages>

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •