Announcement Announcement Module
Collapse
No announcement yet.
Spring-aop and AspectJ Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    Hi,

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

    regards,
    Nadeem

    Comment


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

      Comment


      • #4
        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>

        Comment

        Working...
        X