aspectj-maven-plugin
aspectj-maven-plugin copied to clipboard
Randomly appearing RuntimeException key not found in wovenClassFile
Hi! I have a problem when sometimes my build fails with the following message:
[ERROR] Failed to execute goal org.codehaus.mojo:aspectj-maven-plugin:1.14.0:test-compile (default) on project core: AJC compiler errors:
[ERROR] abort ABORT -- (RuntimeException) key not found in wovenClassFile
[ERROR] key not found in wovenClassFile
[ERROR] java.lang.RuntimeException: key not found in wovenClassFile
On the next run the problem disappears but happens again randomly. The build is a part of an automatic pipeline so this problem is really annoying, googling does not give any clue, and I cannot reproduce it ad hoc. What can you advise, maybe to check or set some parameters in the plugin config?
This error message comes from AspectJ itself. The possibility is that this might be unrelated to the plugin as such. Please try to create an MCVE on GitHub, even if it does not always reproduce the problem. I can run it multiple times, if necessary. Then you can create an AspectJ issue. I would like to see a full, minimal project reproducing the issue. Full Maven POMs, additional error information (Maven debug log) etc. would also be helpful. Which JDK are you using? Etc.
@kriegaex I cannot reproduce it also, it happens very rarely but often enough to make trouble, and this is a client production code, it's almost impossible to make a MCVE, I hoped this error is something that has a specific set of known possible reasons..
MCVE != client code. You can minimise the code, strip off everything non-essential, rename all remaining packages, classes and methods and run it a thousand times on your client's Jenkins until you have the minimal project which still sometimes reproduces the problem. Sorry, I cannot debug invisible code.
same problem about 50%
AspectJ was able to resolve a similar issue: eclipse-aspectj/aspectj#245
@slachiewicz, in absence of any proof otherwise, I am assuming a build configuration problem similar to the ones discussed in https://github.com/eclipse-aspectj/aspectj/issues/245. I think, that this issue can be closed after one year without anyone having provided a reproducible example. The invalid AspectJ issue at least had one, if any of the readers here want to compare their own project with the one I fixed for the other person over there. Maybe it helps you fix your own projects.