jmap Exception in thread "main" java.io.IOException: 拒絕訪問。

環境:java

現有一個獨立運行的系統S(有獨立的jre,可是沒jdk),現想經過jmap導出其內存堆棧信息。因而另外安裝一個jdk。但是jdk的版本跟S系統的jre不能對應上。出了不少錯誤。linux

 

老是報錯:web

C:\Program Files\Java\jdk1.7.0_04\bin>jmap -dump:format=b,file=D:/test/test_mem.
bin 15112
Dumping heap to D:\test\test_mem.bin ...
Exception in thread "main" java.io.IOException: 拒絕訪問。
at sun.tools.attach.WindowsVirtualMachine.enqueue(Native Method)
at sun.tools.attach.WindowsVirtualMachine.execute(WindowsVirtualMachine.
java:96)
at sun.tools.attach.HotSpotVirtualMachine.executeCommand(HotSpotVirtualM
achine.java:217)
at sun.tools.attach.HotSpotVirtualMachine.dumpHeap(HotSpotVirtualMachine
.java:180)
at sun.tools.jmap.JMap.dump(JMap.java:242)
at sun.tools.jmap.JMap.main(JMap.java:140)app

 

 

C:\Users\Administrator>jmap -dump:format=b,file=test_mema.bin 10036
10036: Unable to attach to 64-bit processwebapp

 

 

linux:/opt/software/jdk1.7.0_09/bin # ./jmap -F -dump:format=b,file=test_mema.bin 8152
Attaching to process ID 8152, please wait...
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at sun.tools.jmap.JMap.runTool(JMap.java:197)
at sun.tools.jmap.JMap.main(JMap.java:128)
Caused by: sun.jvm.hotspot.runtime.VMVersionMismatchException: Supported versions are 23.5-b02. Target VM is 24.51-b03
at sun.jvm.hotspot.runtime.VM.checkVMVersion(VM.java:234)
at sun.jvm.hotspot.runtime.VM.<init>(VM.java:297)
at sun.jvm.hotspot.runtime.VM.initialize(VM.java:367)
at sun.jvm.hotspot.bugspot.BugSpotAgent.setupVM(BugSpotAgent.java:598)
at sun.jvm.hotspot.bugspot.BugSpotAgent.go(BugSpotAgent.java:493)
at sun.jvm.hotspot.bugspot.BugSpotAgent.attach(BugSpotAgent.java:331)
at sun.jvm.hotspot.tools.Tool.start(Tool.java:163)
at sun.jvm.hotspot.tools.HeapDumper.main(HeapDumper.java:77)
... 6 morejvm

 

 

Attaching to process ID 8152, please wait...
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0xf6934777, pid=10859, tid=2925202288
#
# JRE version: 6.0_29-b11
# Java VM: Java HotSpot(TM) Server VM (20.4-b02 mixed mode linux-x86 )
# Problematic frame:
# C [libsaproc.so+0x1777] long double restrict+0x1d
#
# An error report file with more information is saved as:
# /opt/software/jdk1.6.0_29/bin/hs_err_pid10859.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
Abortedsocket

 

8152: 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 respondingjsp

 

 

貌似 1.6 不支持F參數ide

 

後面換成了一個jdk1.7 64位的就ok了!rest

 

-----------  其實更簡單的作法是,。 將安裝好的jdk(jdk1.6以上版本),而後將其中jre覆蓋S系統的jre,重啓jre便可。

—— 不過在win7上仍是一直報第一個錯: "main" java.io.IOException: 拒絕訪問。。。。 

相關文章
相關標籤/搜索