java -verbose 不会给出每个类的文件位置
我们正在尝试调试 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您对 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".
也许您要加载的类不是来自 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 ...
如果输出看起来像
......那么你的类是自动生成的
If the output looks like
... then your classes are autogenerated