Skip to content
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

"com.sun.tools.attach.AgentLoadException: Agent JAR not found or no Agent-Class attribute" using AdoptOpenJDK 16 #20

Open
Pieter12345 opened this issue Jul 19, 2021 · 4 comments

Comments

@Pieter12345
Copy link

Pieter12345 commented Jul 19, 2021

Using AdoptOpenJDK 16 on Windows 10, I'm getting the following exception after selecting the Java process that I wish to monitor:

Sampling set to stop in 5 seconds.
Starting a server on /0.0.0.0:23000...
Once the server starts (shortly), visit the URL in your browser.
Note: The longer you wait before using the output of that webpage, the more accurate the results will be.
com.sun.tools.attach.AgentLoadException: Agent JAR not found or no Agent-Class attribute
        at jdk.attach/sun.tools.attach.HotSpotVirtualMachine.loadAgent(HotSpotVirtualMachine.java:159)
        at jdk.attach/com.sun.tools.attach.VirtualMachine.loadAgent(VirtualMachine.java:538)
        at com.sk89q.warmroast.WarmRoast.connect(WarmRoast.java:122)
        at com.sk89q.warmroast.WarmRoast.main(WarmRoast.java:327)

Additional information:
AdoptOpenJDK 8 has a jre/lib/management-agent.jar whereas some Java versions later, this jre directory no longer exists and JAVA_HOME now points directly to the JDK directory that no longer contains such a management-agent.jar file. This is referenced here.

@Pieter12345 Pieter12345 changed the title ServiceConfigurationError: sun.tools.attach.WindowsAttachProvider not found using AdoptOpenJDK 16 "com.sun.tools.attach.AgentLoadException: Agent JAR not found or no Agent-Class attribute" using AdoptOpenJDK 16 Jul 19, 2021
@ProsperCraft
Copy link

I think this may be the same, I am getting this with OpenJDK 64-Bit Server VM 21.9 (build 17+35, mixed mode, sharing)

`
Attaching to PID 3679...
[0.438s][warning][os,thread] Failed to start thread - pthread_create failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 4k, detached.
[0.513s][warning][os,thread] Failed to start thread - pthread_create failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 0k, detached.

Starting a server on /0.0.0.0:22000...
Once the server starts (shortly), visit the URL in your browser.
Note: The longer you wait before using the output of that webpage, the more accurate the results will be.
com.sun.tools.attach.AgentLoadException: Agent JAR not found or no Agent-Class attribute
at jdk.attach/sun.tools.attach.HotSpotVirtualMachine.loadAgent(HotSpotVirtualMachine.java:160)
at jdk.attach/com.sun.tools.attach.VirtualMachine.loadAgent(VirtualMachine.java:538)
at com.sk89q.warmroast.WarmRoast.connect(WarmRoast.java:122)
at com.sk89q.warmroast.WarmRoast.main(WarmRoast.java:327)

`

@Pieter12345
Copy link
Author

@ProsperCraft This indeed is caused by the same issue, being that a jar file that is being depended on is no longer available on JDK 16. Developers haven't responded for months now, so he only solution I see is to use another JVM profiler/sampler that is compatible with the more recent versions of Java. I do however like the simplicity of Warmroast, so I do plan on switching back if they do a compatibility update.

@ProsperCraft
Copy link

Did you find a working alternative for headless linux?

@Pieter12345
Copy link
Author

Using Linux as a client, SSH'ing into your server with the -X option works to open the VisualVM GUI through SSH, but I haven't been able to get this working with a Windows machine as a client using WSL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants