2011-03-18 48 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