visualvm intellij "Failed to create JMX connection to target application" profiling not working
Asked Answered
S

4

20

I am trying to use visualVM for profiling a simple java application that I am debugging with Intellij. I start the application to debug, open visualVM, and I can see my application in the list. I can open it; however, I am unable to use sampling or profiling for my application. Other applications, such as Intellij, can be profiled just fine. When I check the visualVM logs I see:

INFO [com.sun.tools.visualvm.jmx.impl.JmxModelImpl]: connect(2749) com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file: target process not responding or HotSpot VM not loaded

more information: Operating System = Mac OS X version 10.9.1 running on x86_64 Java; VM; Vendor = 1.7.0_51; Java HotSpot(TM) 64-Bit Server VM 24.51-b03; Oracle Corporation Intellij IDEA = 13.0.2

if anyone has this working, please let me know how you got it. I would like to use the Intellij VisualVMLauncher as well if I can get it going.

Synecdoche answered 28/2, 2014 at 0:55 Comment(2)
I'm getting this issue as well, and none of the answers thus far have resolved it for me.Goliath
Here's my logfile from VisualVM: pastey.org/view/c579846c. @nashspence, could you grab your logfile from VisualVM->About->Logfile?Goliath
T
22

Maybe this helps:

java -Dcom.sun.management.jmxremote \
  -Dcom.sun.management.jmxremote.port=9010 \
  -Dcom.sun.management.jmxremote.local.only=false \
  -Dcom.sun.management.jmxremote.authenticate=false \
  -Dcom.sun.management.jmxremote.ssl=false \
  -jar xxx.jar
Troxler answered 9/4, 2014 at 9:12 Comment(0)
M
10

This looks the JDK bug #8023786. Until this is fixed in JDK 7u60, you can run the profiled application with -XX:+StartAttachListener. Some details about this bug are also in this email thread.

Macle answered 11/3, 2014 at 7:49 Comment(4)
Hey I'll try that when I get a chance. Been traveling. Thanks for the response.Synecdoche
im still having trouble getting this to work even starting my application using that flag. I find visualvm just starts to hang whenever I attempt to open the application for profiling. i intend to keep looking into the issue, but if you have any other recommendations they would be welcomeSynecdoche
Maybe it didn't help the OP, but it helped me. Thanks!Civilian
This didn't work for me, but Thomas' answer below did.Whereto
S
3

I had a similar issue earlier when running a standalone visualvm. Instead, try running the visualvm bundled with the same jdk used to run the application (in my case c:\jdk1.7.0\bin\jvisualvm.exe) and it may not need jmx in the first place.

Skittle answered 28/2, 2014 at 1:9 Comment(3)
this ended up solving this for you? As far as I can tell, I am using the jvisualvm from the same jdk that I am running the application on.Synecdoche
I also had this problem and in my case it was caused by the fact, that the app was running with a 32-bit JDK, but I used a 64-bit VisualVM.Dingo
Solved the problem for me in two different cases.Sporogony
T
0

If it may help anyone, a solution I found was to launch the application in IntelliJ via the VisualVM launcher plugin for IntelliJ . It worked for me with a web application on Glassfish.

Tericaterina answered 5/9, 2020 at 10:25 Comment(1)
This should be the best solution but the VisualVM Launcher buttons are never enabled for me.Subtractive

© 2022 - 2024 — McMap. All rights reserved.