nashspence
nashspence

Reputation: 220

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

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.

Upvotes: 20

Views: 14096

Answers (4)

marcor92
marcor92

Reputation: 547

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.

Upvotes: 0

Thomas Ahle
Thomas Ahle

Reputation: 31614

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

Upvotes: 22

Tomas Hurka
Tomas Hurka

Reputation: 6981

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.

Upvotes: 10

Ali Cheaito
Ali Cheaito

Reputation: 3856

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.

Upvotes: 3

Related Questions