如何告诉visualvm在哪里找到我的源代码? [英] How do I tell visualvm where to find my source code?

查看:965
本文介绍了如何告诉visualvm在哪里找到我的源代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行VisualVM来分析一个简单的Java应用程序。当我双击分析窗格中的方法(希望获得更多详细信息)时,它会显示找不到类的源......。我知道消息来源在哪里。我如何告诉VisualVM在哪里看?

I'm running VisualVM to profile a simple Java application. When I double-click on a method in the profiling pane (hoping to get more details on it), then it says "No source found for class ....". I know where the source is. How do I tell VisualVM where to look?

推荐答案

我在显示错误对话框时进行了VisualVM进程的堆栈转储,似乎问题出在类 org.netbeans.modules.profiler.api.GoToSource ,方法 openSourceImpl

I took a stack dump of the VisualVM process while it was displaying that error dialog, and it seems that the problem lies in the class org.netbeans.modules.profiler.api.GoToSource, in the method openSourceImpl.

此方法尝试使用 GoToSourceProvider 服务提供程序接口的任何已注册实现加载源代码,如果没有人设法显示有问题的源代码,则显示错误消息。

This method tries to load the source using any registered implementations of the GoToSourceProvider service provider interface, and displays the error message if none of them manage to display the source code in question.

我的猜测是VisualVM的当前默认版本没有注册了任何 GoToSourceProviders ,因此无法查找源代码。

My guess is that the current, default version of VisualVM doesn't have any GoToSourceProviders registered, and therefore will always fail to look-up source code.

从包中名称似乎 GoToSourceProvider 是探测器模块的SPI,但我无法找到有关如何实现此SPI的任何文档,它似乎没有成为VisualVM扩展点的一部分。

From the package name it appears that GoToSourceProvider is an SPI for the profiler module, but I wasn't able to find any documentation on how to implement this SPI, and it doesn't seem to be part of the VisualVM extension points.

这篇关于如何告诉visualvm在哪里找到我的源代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆