2

Can anyone give me a hint to what I am doing wrong?

So, on Redhat (Amazon AMI Instance) , I am trying to get a core dump of my running application. I am unable to connect to the JMX port from jconsole.exe or jvisualvm.exe from a windows box even though the remote port is wide open (and JMX server is properly configured). I don't know why, and so I am trying to get a core dump from the JVM directly (Cntrl-\ didnt work). So, here is how I set things up to get the core dump, but it doesn't work and I don't know why.

[ec2-user bin]$
jsadebugd 2504 -F Attaching to process
ID 2504 and starting RMI services,
please wait... Debugger attached and
RMI services started.

So, after the debugger is running, I try to create the dump using this, but it fails:

[ec2-user ~]$ jmap -dump:live,format=b,file=dump.t 2504 
2504: Unable to open socket file:
target process not responding or
HotSpot VM not loaded The -F option
can be used when the target process is
not responding

[ec2-user ~]$ jmap -dump:live,format=b,file=dump.t 2504 -F 
Attaching to core -F from 
executable 2504, please wait... Error
attaching to core file: Can't attach
to the core file
djangofan
  • 28,471
  • 61
  • 196
  • 289
  • Have you seen http://stackoverflow.com/questions/151238/has-anyone-ever-got-a-remote-jmx-jconsole-to-work/3256207#3256207? – Will Mar 18 '11 at 22:49

1 Answers1

5

Try placing the '-F' option before PID:

jmap -dump:live,format=b,file=dump.t -F 2504
Strudel
  • 809
  • 4
  • 10
  • 18