Recently I developed a java agent using byte buddy. The development in eclipse was fine, then I put the agent to production and the message:
No compatible attachment provider is available
along with some stacktraces originating from the lines
static {
ByteBuddyAgent.install();
}
After some debugging I found the problem. The message "No compatible attachment provider is not available" occurs if the agent was called with a jre instead of a jdk.
Unfortunately calling java -version
does not return whether java
is a jdk or a jre (the message is displaying Java runtime Environment
for both).
In my case (OS:Windows) it was tricky, because newer jsdk-installations attach C:\ProgramData\Oracle\Java\javapath
to the system path, which contains a jre and not a jdk. The formerly added entry %JAVA_HOME%/bin
got hidden through this modification. When I removed the entry C:\ProgramData\Oracle\Java\javapath
everything worked fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With