WebSphere Application Server & Liberty

WebSphere Application Server & Liberty

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  Websphere does not find AspectJ classes

    Posted 08/11/10 10:36 AM
    Websphere does not find AspectJ classes

    --------------------------------

    Hi

    I am using Websphere 7 and AspectJ 1.6.2 (included as jar in the WAR file).

    When a call to an AspectJ method is done I have NoSuchMethodError.
    java.lang.NoSuchMethodError: org/aspectj/runtime/internal/AroundClosure.linkClosureAndJoinPoint(I)Lorg/aspectj/lang/ProceedingJoinPoint;
    ...

    The very same WAR works perfectly in Tomcat 5.

    Could this be a class loading problem ?

    Would anyone have an idea? Any help would very gratefully appreciated.

    Cheers Markus

    --------------------------------

    Posted By: mosel194 at Mar 30 2009 10:05AM


  • 2.  Websphere does not find AspectJ classes

    Posted 08/11/10 10:44 AM
    I got this error for @Around but not @Before or @After. I fixed this by changing my my classloader mode and WAR classloader policy settings to,

    The first setting is done through the admin console. In the admin console, Servers -> Server Types -> WebSphere application servers -> server1 -> Configuration -> General Properties -> Server-specific Application Settings -> Classloader policy

    EAR classloader policy: Multiple

    I used Rational Application Developer to create my web application. In RAD, the remaining settings are set in the Application Deployment Descriptor -> Deployment -> Application

    EAR classloader mode: PARENT_FIRST
    WAR classloader policy: MODULE
    WAR classloader mode: PARENT_LAST

    --------------------------------

    Posted By: jamie.r.burns at May 28 2009 1:21AM


  • 3.  Websphere does not find AspectJ classes

    Posted 08/11/10 10:51 AM
    Hi

    Many thanks! In the meantime I found this solution. It's due to the fact that in WAS7 there is already a verion 1.5.0 of the AspectJ RT.

    Another, more elegant solution is to define a shared library with a separate classloader in WAS7 and associate this shared lib with your application. Like this it is not necessary to meddle with the class loading mechanisms in the application or container.

    Cheers
    Markus

    --------------------------------

    Posted By: mosel194 at May 28 2009 8:48AM


  • 4.  Websphere does not find AspectJ classes

    Posted 08/11/10 10:51 AM
    How do you do the shared library seperate classloader solution? Do you create a new class loader at Servers -> Server Types -> Application servers -> Java and Process Management -> Class loader ?

    --------------------------------

    Posted By: jamie.r.burns at May 28 2009 11:29PM


  • 5.  Websphere does not find AspectJ classes

    Posted 08/11/10 11:01 AM
    No.
    Simply create your shared lib under
    Environment -> Shared Libraries -> New ...

    At the bottom there is a section 'Class Loading' with a checkbox 'Use an isolated class loader for this shared library' which you select.

    Then in your application properties there is a link to 'Shared library references' where you can establish a ref to your new shared lib.

    --------------------------------

    Posted By: mosel194 at May 29 2009 9:57AM