-
Notifications
You must be signed in to change notification settings - Fork 40.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AspectJ weaving logs nasty warnings on Spring Boot fat jar #7587
Comments
The problem is that the agent finds |
You can get rid of the distracting stack traces by moving @aclement Is there a more pleasant way to deal with this? |
Feels like if the classes were being moved into BOOT-INF/classes during jar packaging then the META-INF/aop.xml should have moved too, then it would all behave as expected. I can't think of a good reason to leave it behind (although it is a bit dirty as the folder is called 'classes', there is no BOOT-INF/resources is there). It works for the reasons Andy describes, as we can see from the verbose output, the AppClassLoader can't find the aspect. But the LaunchedURLClassLoader can and so it will weave the necessary types:
I might reduce that from a horrid exception to a regular message, for the AspectJ 1.8.10 I'm about to release. Somewhat related, I don't know if this impacts the discussion in that other bug ( #739 ), but we do now support programmatic attachment of the AspectJ weaver to a running JVM: http://www.eclipse.org/aspectj/doc/released/README-187.html |
OR we do this which I'd forgotten about. Instead of creating |
Something I observed whilst testing this. It looks to me like
when I launched the jar, it prints two identical references for each:
Is that intended? Am I crazy? |
Thanks, @aclement.
We deliberately leave
Nope and nope. It's a bug in |
The aspect is actually woven and seems to work at runtime, but the stack trace is sort of distracting, and maybe signals a problem (or something I don't understand).
Sample project: https://github.com/scratches/spring-boot-ltw (you have to set
-DskipTests
when you build it).The text was updated successfully, but these errors were encountered: