简体   繁体   English

无法将VisualVM分析器与Maven Jetty插件一起使用

[英]Unable to use VisualVM profiler with Maven Jetty plugin

I'm attempting to profile a Java 7 application executed using mvn jetty:run with VisualVM 1.3.6. 我正在尝试分析使用mvn jetty:run执行的Java 7应用程序mvn jetty:run使用VisualVM 1.3.6 mvn jetty:run The CPU shows as unavailable, and the profile tab lists the following error: CPU显示为不可用,配置文件选项卡列出以下错误:

WARNING! Class sharing is enabled for this JVM. This can cause problems when profiling the application and eventually may crash it. Please see the VisualVM Troubleshooting Guide for more information and steps to fix the problem: https://visualvm.java.net/troubleshooting.html#xshare.

I am able to profile any other application normally. 我可以正常配置任何其他应用程序。

The VisualVM log shows the following error a number of times: VisualVM日志多次显示以下错误:

java.io.IOException: Unable to open socket file: target process not responding or HotSpot VM not loaded

Potentially relevant details: 潜在相关细节:
- OSX 10.8.3 - OSX 10.8.3
- Both app and VisualVM running under JDK 1.7u25 - 在JDK 1.7u25下运行的app和VisualVM

I can presume the downvotes are related to the fact that there is a documented bug related to this issue with advice to set Xshare:off , I'll include this link to the bug report, which lists it as fixed after 1.6u6. 我可以假设downvotes与这个问题有关,这个问题与设置Xshare:off建议Xshare:off ,我将把这个链接包含在bug报告中,该报告在1.6u6之后将其列为固定。 I am running 1.7u25, so this does not apply to me. 我正在运行1.7u25,所以这不适用于我。

For Mac try passing these VM args: -Xverify:none -Xshare:off 对于Mac,尝试传递这些VM args: -Xverify:none -Xshare:off

If you're working with JConsole and other JMX Tools also include: 如果您正在使用JConsole,其他JMX Tools还包括:

-Xcom.sun.management.jmxremote

Found via: http://brian.pontarelli.com/2009/10/21/fixing-java-tools-on-snow-leopard/ 发现: http//brian.pontarelli.com/2009/10/21/fixing-java-tools-on-snow-leopard/

在Mac上,尝试在Tomcat中配置Web应用程序并运行JDK 1.7,我不得不添加-Xverify:none标志以避免“无法打开套接字文件:目标进程未响应或HotSpot VM未加载”错误消息。

The link you include in your question ( https://visualvm.java.net/troubleshooting.html#xshare ) has some advice: 您在问题中包含的链接( https://visualvm.java.net/troubleshooting.html#xshare )有一些建议:

There is a known problem with dynamic attach which is used for profiling, it may cause target JVM to crash when class sharing is enabled. 动态连接存在一个已知问题,用于分析,它可能会导致目标JVM在启用类共享时崩溃。 To start an application without class sharing, provide -Xshare:off argument to the java command starting the application. 要在没有类共享的情况下启动应用程序,请为启动应用程序的java命令提供-Xshare:off参数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM