java -verbose 不会给出每个类的文件位置

发布于 2024-11-08 13:43:59 字数 469 浏览 3 评论 0原文

我们正在尝试调试 WAS(Websphere 应用程序服务器)实例的一些平均类加载器问题。

为此,我们提供了选项 -verbose:class 以便查看 WAS 正在从何处加载哪个类。

对于大多数类,我们会得到类似的输出

Loading class <some class> from <some jar file>

,但对于某些类(包括导致问题的类),只会

Loading class <some class>

打印出来。

这些是从哪里来的?让他们直接从地狱中加载,或者为什么 IBM 要保护他们的真实身份?

更新: 我们正在寻找的类是 javax.xml.ws.Service ,它实际上应该来自 rt.jar (我们在它上面得到了一个 java.lang.VerifyError )

We are trying to debug some mean classloader issues with our WAS (Websphere Application Server) instance.

For this we provided the option -verbose:class in order to see which class WAS is loading where from.

For most classes we get output like

Loading class <some class> from <some jar file>

But for some classes (including the one causing problems) only

Loading class <some class>

gets printed.

Where is do these come from? Get they loaded straight from hell or why is IBM protecting their real identity?

Update:
The class we are looking for is javax.xml.ws.Service which should really come from a rt.jar (we are getting a java.lang.VerifyError on it)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

江心雾 2024-11-15 13:43:59

如果您对 JVM 读取哪些文件感兴趣,可以使用 strace、dtrace 或 lsof 等操作系统工具来观察进程读取的文件。尽管这不会告诉您从该文件加载了哪些类。

您是否了解 IBM JDK 诊断指南? 它包含“类加载器诊断”一章。

If you are interested in which files are read by the JVM, you could use operating system tools like strace, dtrace, or lsof to observe the files read by a process. Though that won't tell you which classes where loaded from that file.

Are you aware of the IBM JDK Diagnostics Guide? It contains a chapter "Class-loader diagnostics".

橘虞初梦 2024-11-15 13:43:59

也许您要加载的类不是来自 jar?也许它是即时生成的?类的名称可能包含提示......

Maybe the class you want to load does not come from an jar? Maybe it's generated on the fly? The name of the class might contain a hint ...

幼儿园老大 2024-11-15 13:43:59

如果输出看起来像

[Loaded $Proxy2 by instance of java.lang.reflect.Proxy]

......那么你的类是自动生成的

If the output looks like

[Loaded $Proxy2 by instance of java.lang.reflect.Proxy]

... then your classes are autogenerated

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文