Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Are there conflicts using LTW and CTW in the same application?

I have a multi-module EAR application that is comprised of:
- EJB jar
- WAR
- aspect library
- supporting libs

My AspectJ library is designed to be used as LTW; it has pointcuts targetting some of the 3rd party libs.

I have now created a new jar module in which I would like to use CTW.  I have configured by build properly, and can see that all my jars in my new module have been properly woven during the build process.  However, when I include the new lib in my ear, I get the following error message:

16:43:39,689 ERROR [io.undertow.request] (default task-35) UT005023: Exception handling request to /webapp/updateUserAccount.do: java.lang.NoSuchMethodError: org.webapp.sso.keycloak.aspect.ClientErrorExceptionHandler.aspectOf()Lorg/webapp/sso/keycloak/aspect/ClientErrorExceptionHandler;
        at org.webapp.sso.keycloak.administration.AccountAdministrationImpl.updateUserPassword(AccountAdministrationImpl.java:1)
        at org.webapp.sso.keycloak.administration.AccountAdministrationImpl$Proxy$_$$_WeldClientProxy.updateUserPassword(Unknown Source)


However, when I look at the decompiled code for ClientErrorExceptionHandler, I see it contains the aspectOf() method:


@Aspect
public class ClientErrorExceptionHandler
{
  public static ClientErrorExceptionHandler aspectOf()
  {
    if (ajc$perSingletonInstance == null) {
      throw new NoAspectBoundException("org.webapp.sso.keycloak.aspect.ClientErrorExceptionHandler", ajc$initFailureCause);
    }
    return ajc$perSingletonInstance;
  }
  
  public static boolean hasAspect()
  {
    return ajc$perSingletonInstance != null;
  }
...
...

So I'm not sure what is happening.  Can this be some form of a race condition between the Load Time weaver and the Compile Time code?  My LTW aspects are in a completely different jar file, with their own aop.xml that have nothing to do with my current package.

I've also double checked that my new jar does not contain an aop.xml.

How can I further debug this issue? 

Thanks,

Eric






Back to the top