2011-03-18 46 views
2

任何人都可以给我一个暗示我做错了什么?来自命令行的OpenJDK核心转储?

因此,在Redhat(亚马逊AMI实例)上,我试图获得正在运行的应用程序的核心转储。即使远程端口处于开放状态(并且JMX服务器已正确配置),我仍无法从jconsole.exe或jvisualvm.exe的windows框连接到JMX端口。我不知道为什么,所以我试图直接从JVM获得核心转储(Cntrl- \ did not work)。所以,这里是我如何设置的核心转储,但它不起作用,我不知道为什么。

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

因此,调试器运行后,我尝试创建一个使用此转储,但它失败:

[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 
+0

你见过http://stackoverflow.com/questions/151238/has-anyone-ever-got-a-remote-jmx-jconsole-to-work/3256207#3256207? – Will 2011-03-18 22:49:17

回答

4

请尝试将 '-F' 选项PID前:

jmap -dump:live,format=b,file=dump.t -F 2504