-
Notifications
You must be signed in to change notification settings - Fork 86
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
Bug? NoClassDefFoundError when using around advice and LTW cache #314
Comments
Maybe this is somehow similar or related to #285. I can reproduce this behaviour back until at least 1.8.13, i.e. it is not a new thing and dates back to when I was just a simple AspectJ user, not a contributor to the project yet. Judging from this test configuration file, not using |
by refining and extending org.aspectj.systemtest.ajc171.NewFeatures, also considering around advice types and repeated weaving, actually re-using the cache. Signed-off-by: Alexander Kriegisch <[email protected]>
Please note my recent message to the aspectj-users and aspectj-announce mailing lists regarding my situation as an AspectJ maintainer. |
Not sure if related, but I'm getting this:
after upgrading from 1.9.21 to either 1.9.22 or 1.9.22.1, on Android 23 emulator and below. 24+ seems to be alright. |
@oakkitten, at first glance, this seems to be unrelated, because an AspectJ class does not seem to be found rather than a generated one. The |
If I get around to investigating, I will. However, AspectJ on Android seems to very rarely used, especially because of how increasingly hard it has became to plug weaving into the build pipeline. So perhaps it's just not worth the effort. Said that, 1.9.21 works fine, so maybe I can try bisecting at least. Will open a new issue if I find anything. (P.S. It's not different Android Studio versions, but different Android emulator versions, which run different versions of SDK API and Java API. Android 23 is quite old, from 2015) |
If you are interested in a future solution, it would be helpful for you to get around to it. Thanks.
I have no idea. All I know is that over the years I have answered multiple questions about related problems on Stack Overflow, and actually the problem was never AspectJ as such but rather its configuration, as far as I remember. Some people do seem to use it.
Is that so? I really have no idea. Is there anything the AspectJ project can or should do about it, or is that rather a problem of complex tooling in the Android build pipeline with Gradle or Maven?
Well, but you also said that 1.9.22.x seems to be problematic on certain emulator versions, not on others, including the latest one. So, the bisection result might point to a related AspectJ change making the emulator run out of whack in v23, but if it works again in v24, maybe it is really an emulator problem rather than an AspectJ one. But this is, of course, speculation.
Thank you so much, I appreciate your future input. |
in
src/MyAspect.aj
In
src/foo.java
In
classes/META-INF/aop.xml
Running the command
java -javaagent:path/to/aspectjweaver.jar -Dorg.aspectj.weaver.showWeaveInfo=true -Daj.weaving.cache.enabled=true -Daj.weaving.cache.dir=/tmp/aspectj-cache/ -cp classes Foo
twice will lead to the following error
However, if I set cache implementation to
shared
, then it will work as expected:java -javaagent:path/to/aspectjweaver.jar -Dorg.aspectj.weaver.showWeaveInfo=true -Daj.weaving.cache.enabled=true -Daj.weaving.cache.dir=/tmp/aspectj-cache/ -Daj.weaving.cache.impl=shared -cp classes Foo
Is this a bug? And what does this
-Daj.weaving.cache.impl=shared
shared implementation option do?The text was updated successfully, but these errors were encountered: