The aspect missing the aspectOf() is part of the CTW. All Aspects are annotation based (@Aspect). The LTW was built using ajc. Without the CTW aspects, everything runs smoothly; all I have done was add in an additional jar with CTW aspect/classes. The LTW still seems to be working, although I would have to do more in-depth tests to validate that they are still being triggered where they need to be.
My application is running under JBoss EAP 7/Wildfly 10, so I'm honestly not entirely sure if they are all using the same classloader. Given that the CTW classes are in the ear/lib folder, as are the LTW aspects (both jars are found in ear/lib), I suspect that they both are in the same classloader, but I'm really not sure. I know that WF has done a lot of work, separating classloaders by module (so that the different modules in an EAR each have different classloaders), but I suspect there must be a common one for all classes in the ear/lib folder.
and interestingly enough, in the _before folder, I see the problematic Aspect class properly woven, but in the after class, it reappears in its original non-woven form. As the LTW overweaver has reverted the class. And even more interesting, I cannot seem to find the pointcut in my LTW aspects that would have picked out this class in the first place. Most of my pointcuts are "execution" pointcuts pointing to completely different pkgs. There are a couple of "call" pointcuts as well as one cflow(), but in all cases, none should be picking out this Aspect.
If I check the server.log file, I see the following being logged, which I don't particularly understand:
2018-06-12 10:21:51,708 ERROR [stderr] [ModuleClassLoader@2d758982] info processing reweavable type org.webapp.sso.keycloak.administration.SessionAdministrationImpl: org\webapp.sso\keycloak\administration\SessionAdministrationImpl.java
2018-06-12 10:21:51,711 ERROR [stderr] [ModuleClassLoader@2d758982] error aspect 'org.webapp.sso.keycloak.aspect.ClientErrorExceptionHandler' woven into 'org.webapp.sso.keycloak.administration.SessionAdministrationImpl' must be defined to the weaver (p
laced on the aspectpath, or defined in an aop.xml file if using LTW).
2018-06-12 10:21:51,802 ERROR [stderr] [ModuleClassLoader@2d758982] debug weaving 'org.webapp.sso.keycloak.administration.UserServiceImpl'
2018-06-12 10:21:51,834 ERROR [stderr] [ModuleClassLoader@2d758982] debug weaving 'org.webapp.sso.keycloak.administration.SessionAdministration'
2018-06-12 10:21:51,861 ERROR [stderr] [ModuleClassLoader@2d758982] debug weaving 'org.webapp.sso.keycloak.administration.AccountAdministrationImpl'
2018-06-12 10:21:51,877 ERROR [stderr] [ModuleClassLoader@2d758982] info processing reweavable type org.webapp.sso.keycloak.administration.AccountAdministrationImpl: org\webapp.sso\keycloak\administration\AccountAdministrationImpl.java
2018-06-12 10:21:51,877 ERROR [stderr] [ModuleClassLoader@2d758982] error aspect 'org.webapp.sso.keycloak.aspect.ClientErrorExceptionHandler' woven into 'org.webapp.sso.keycloak.administration.AccountAdministrationImpl' must be defined to the weaver (p
laced on the aspectpath, or defined in an aop.xml file if using LTW).
2018-06-12 10:21:51,896 ERROR [stderr] [ModuleClassLoader@2d758982] debug weaving 'org.webapp.sso.keycloak.administration.UserService'
2018-06-12 10:21:51,932 ERROR [stderr] [ModuleClassLoader@2d758982] debug weaving 'org.webapp.sso.keycloak.config.KeycloakConfigBean'
2018-06-12 10:21:51,968 ERROR [stderr] [ModuleClassLoader@2d758982] debug weaving 'org.keycloak.admin.client.Keycloak'
2018-06-12 10:21:51,973 ERROR [stderr] [ModuleClassLoader@2d758982] debug weaving 'org.keycloak.admin.client.resource.UserResource'
2018-06-12 10:21:51,975 ERROR [stderr] [ModuleClassLoader@2d758982] debug weaving 'org.webapp.sso.keycloak.administration.AccountAdministration'
2018-06-12 10:21:52,011 ERROR [stderr] [ModuleClassLoader@2d758982] debug weaving 'org.webapp.sso.keycloak.administration.UserService'
2018-06-12 10:21:52,026 ERROR [stderr] [ModuleClassLoader@2d758982] debug weaving 'org.webapp.sso.keycloak.aspect.ClientErrorExceptionHandler'
2018-06-12 10:21:52,046 ERROR [stderr] [ModuleClassLoader@2d758982] info processing reweavable type org.webapp.sso.keycloak.aspect.ClientErrorExceptionHandler: org\webapp.sso\keycloak\aspect\ClientErrorExceptionHandler.java
2018-06-12 10:21:52,046 ERROR [stderr] [ModuleClassLoader@2d758982] error aspect 'org.webapp.sso.keycloak.aspect.ClientErrorExceptionHandler' woven into 'org.webapp.sso.keycloak.aspect.ClientErrorExceptionHandler' must be defined to the weaver (placed
on the aspectpath, or defined in an aop.xml file if using LTW).
2018-06-12 10:21:52,079 ERROR [stderr] [ModuleClassLoader@2d758982] debug weaving 'org.webapp.sso.keycloak.aspect.ClientErrorExceptionHandler'
2018-06-12 10:21:52,093 ERROR [stderr] [ModuleClassLoader@2d758982] info processing reweavable type org.webapp.sso.keycloak.aspect.ClientErrorExceptionHandler: org\webapp.sso\keycloak\aspect\ClientErrorExceptionHandler.java
2018-06-12 10:21:52,093 ERROR [stderr] [ModuleClassLoader@2d758982] error aspect 'org.webapp.sso.keycloak.aspect.ClientErrorExceptionHandler' woven into 'org.webapp.sso.keycloak.aspect.ClientErrorExceptionHandler' must be defined to the weaver (placed
on the aspectpath, or defined in an aop.xml file if using LTW).
For some reason, the LTW thinks it should be weaving my ClientErrorExceptionHandler (the aspect) even though it isn't part of my aop.xml? Is there a way to enable pointcut matching/debugging so I can see which pointcut is triggering the reweaving/rewriting of this @Aspect class?