jconsole 可以与 Java EE 一起使用吗?
我看到的所有示例都是通过在命令行传递 JAR 文件来实现 Java SE 应用程序的。 JConsole 能否附加到 WAR 或 EAR 并监控应用程序性能?
All the examples I see are for Java SE applications by passing your JAR file at the command line. Can JConsole attach to a WAR or EAR and monitor application performance?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
JConsole 用于监视 JVM。 我假设您想监视应用程序服务器的性能。 为此,您必须在初始化应用程序服务器时设置 com.sun.management.jmxremote 属性。
例如,在 Tomcat 中(我知道这不是一个完整的 Java EE 容器),您可以按如下方式启动容器:
然后您可以将 JConsole 作为独立应用程序启动
,然后将 jconsole 附加到运行 Tomcat 的 Java 进程。
类似的步骤适用于其他应用程序服务器。
JConsole is for monitoring JVMs. I'm assuming that you would like to monitor the performance of your application server. To do so, you'll have to set the com.sun.management.jmxremote property, when initializing your application server.
For example, in Tomcat (I know this is not a complete Java EE container), you would start the container as:
You could then start JConsole as a standalone application
and then attach jconsole to the Java process that is running Tomcat.
Similar steps apply to other application servers.
如果您使用 Tomcat,您应该尝试 lambda 探针。 这是一个 war 文件,一旦安装在 tomcat 上,就可以使 Web 应用程序具有与 jconsole 类似的监控功能。
在 lambdaprobe web 上也有 JBoss 下载,但我只在 tomcat 上进行了测试。
If you are using Tomcat you should try lambda probe. It's a war file that once installed on tomcat enables a web-app with similar monitoring capabilities as jconsole.
On the lambda probe web there is also a JBoss download, but I only tested on tomcat.
正如已经提到的,jconsole 监视 JVM,即整个应用程序服务器实例,而不是部署为 war 或 Ear 的特定 Web 应用程序。
如果您正在寻找更细粒度的 Web 应用程序性能监控,您可以尝试查看 JAMon 等工具。
As already mentioned jconsole monitors JVM, i.e. the whole application server instance and not specific web application deployed as war or ear.
If you are looking for more fine grained web app performance monitoring you could try to look at tools like JAMon .