7
我在MAC OSX山獅的TomEE 1.5.1和VisualVM 1.7.0_09上遇到了一個非常奇怪的問題。VisualVM連接到本地TomEE非常緩慢,無法進行堆轉儲
TomEE加載了一些webapp後,使用VisualVM連接本地TomEE進程需要很長時間,連接後gc按鈕被禁用,我無法進行堆轉儲。 VisualVM的日誌顯示出一些錯誤。
com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file: target process not responding or HotSpot VM not loaded
at sun.tools.attach.BsdVirtualMachine.<init>(BsdVirtualMachine.java:90)
at sun.tools.attach.BsdAttachProvider.attachVirtualMachine(BsdAttachProvider.java:63)
at com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:213)
at com.sun.tools.visualvm.attach.AttachModelImpl.getVirtualMachine(AttachModelImpl.java:104)
Caused: java.io.IOException: Unable to open socket file: target process not responding or HotSpot VM not loaded
.java_pid<pid>
文件未在tmp文件夾中創建。
但是,如果在啓動它之後並且在加載任何webapps之前使用VisualVM連接TomEE,將會創建.java_pid<pid>
文件,並且VisualVM將立即連接到它,並且堆轉儲工作。
另一個解決方法是修改catalina.sh以將tools.jar添加到ClassPath並刪除openejb javaagent,然後在TomEE完全啓動後連接正常工作。
無法在ubuntu機器上重現。
你在使用JMS連接嗎?嘗試使用JMS。 –
嘗試jconsole,看看它是如何工作的 – javahaxxor