visualvm
visualvm copied to clipboard
"Not supported for this JVM" when using visualvm under Windows (Linux VM works)
I try to watch an application running in a Linux Tomcat under OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.292-b10, mixed mode). I use a jmx connection to watch that application from a remote host.
In a Linux VM (Debian 10.9), I used visualvm 1.4.2 which installed openjdk11, connected nicely and displayed results. However, screen space and performance are limited, also the version is rather old, so I tried visualvm 2.0.7 under Windows. I tried several JDKs, among them the exact same AdoptOpenjdk the Tomcat application is running on and the 11 which worked under Linux, but I always get "Not supported for this JVM" and no results. I can't change the OpenJDK the target application is running under (and it shouldn't be necessary, since it's proven to be usable, right?) but I can change a lot in the Windows environment. But no jdk I tried (1.8, 11, 16, Open, Adopt...) seems to do the job. I didn't find any hints that you can't use Windows visualvm.exe to debug Linux applications, but could that be a problem? Anything else I could try?
I don't think the problem is caused by JDK version. Can you please provide steps how do you get "Not supported for this JVM". Can you attach VisualVM log file?
The steps are simply
- under "Remote", add a remote host
- under the crated remote host, "add jmx connection"
- click said connection
These are the same steps I use with the working v 1.4.2 in a Linux vm on the same machine. I compared configs, they are identical. The vm is configured to use NAT, so they have the same network access.
However, while compiling this answer, I changed the proxy config to "no proxy" (it was set to using the system proxy config before, which should work?) and now I can connect fine!
The logfile also identifies network connection problems which shouldn't be present. I'll try to find out more about the proxy settings, but for the moment I can say:
- There's something fishy with the application of our proxy.pac by visualvm
- The message "Not supported for this VM" is misleading given the circumstances
Thanks for your help!
Oh yeah, there is this in the logfile:
WARNING [org.netbeans.core.network.proxy.ProxyAutoConfig]: There was a catastrophic error with the PAC script downloaded from http://proxyconf.ourdomain/proxy.pac. Will use dummy instead. Error was : org.netbeans.core.network.proxy.pac.PacParsingException: Cannot find secure PAC script engine. Allowed engines: GraalVM:js,Graal.js,Nashorn Found engines: Will not resolve proxy configuration.
And the result seems to be no network connectivity at all, not even the local net, which should work without any config.
I have exactly the same issue when trying to monitor GC on a remote RHEL. However, no issue with proxy PAC in my logs.
I got the same issue. @monolied suggestion (no proxy set) don´t work for me. I´m trying to monitor remotely from Windows 10 using VisualVM 2.1.2 a JBoss VM (AdoptOpenJDK 1.8.0_265-b01). I got successfull Remote Host connection, but JMX connection appears "grey" with message "Not supported for this JVM".
I got the same issue for the remote application. Works properly for the local applications. VisualVM 2.1.2 running on Mac OS Big Sur java version "1.8.0_311". Remote java application running on Linux, openjdk version "1.8.0_322"
I got successful remote connection but JMX connection shows "Not supported for this JVM"
Done with jstatd grant codebase "file:${java.home}/../lib/tools.jar" { permission java.security.AllPermission; };
nohup jstatd -J-Djava.security.policy=jstatd.all.policy &
java -Xms1g -Xmx2g -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8080 -Dcom.sun.management.jmxremote.rmi.port=8080 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.local.only=false -Djava.rmi.server.hostname=stg-atrstub101z.stg.jp.local -jar app.jar &
"Not supported for this JVM" only Overview tab is available.
Is this a bug then?
I'm connecting from VisualVM running on Windows 10 to openjdk:17
container running on WSL 2. JMX connection gives "Not supported for this JVM".
jstatd
doesn't work either because it fails with java.security.AccessControlException: access denied ("java.util.PropertyPermission" "java.rmi.server.ignoreSubClasses" "write")
. Policy file doesn't help.
Managed to connect! This SO answer helped: https://stackoverflow.com/a/71881475/1003113
I do the same job like @leojunior9799 issue, but this plug-in does not display the gc status of remote projects. What should I do?
Seems -Djava.rmi.server.hostname=localhost
& Dcom.sun.management.jmxremote.host=localhost
& -Djava.net.preferIPv4Stack=true
are importan here because Windows HyperV performs some port forwarding behind the scene and you'd better to stick to IPv4 ))
Anyway you can pass the port from remote machine (which WSL is) to your environment via SSH port forwarding. It is generic solution that doesn't require understanding of WSL/HyperV.