CrazySynthax
CrazySynthax

Reputation: 14988

JProfiler: why can't I attach to running JVM?

I just downloaded JProfiler and tried to connect to a remote JVM. enter image description here

When I click "OK" I get an error message saying: "Another application is listening on port 8888. Please check your port configuration".

I also succeeded to profile this machine with 8888 with Java Mission Control (JMC). However, JMC asked me for a username and password and only then allowed the connection.

Upvotes: 2

Views: 4312

Answers (2)

AFu
AFu

Reputation: 73

If you use the JProfiler in local Windows machine ,may be you can try run the jprofiler.exe and then click "session - Start center - Quick Attach ",then pick the Process Name that associated to your program.

Upvotes: 0

Ingo Kegel
Ingo Kegel

Reputation: 47965

JProfiler does not use JMX to connect to a profiled JVM, it uses its own protocol. Also, you can only use the attach mode in your screen shot if the profiling agent is already loaded. You would either have to start the profiled JVM with the -agentpath=... VM parameter as given by "Session->Integration Wizards->New Remote Integration" or run the command line tool bin/jpenable on the remote machine to prepare a selected process for profiling. This will tell you the port you have to connect to.

Alternatively, you can use the "quick attach" feature in the start center to connect to any remote unrprofiled JVM through SSH. Then you do not have to prepare the JVM for profiling.

Upvotes: 1

Related Questions