【发布时间】:2015-03-27 00:04:46
【问题描述】:
我正在尝试在我的系统中使用 VisualVM 来监控在 EC2 上运行的 Tomcat 实例。我尝试了多个博客中提供的有关如何配置它的步骤,但是当我尝试运行 tomcat 时仍然出现以下错误。
./catalina.sh: 5: /home/gvr/apache-tomcat-8.0.18/bin/setenv.sh: -Dcom.sun.management.jmxremote: not found
我在server.xml中添加了以下语句
<listener classname="org.apache.catalina.mbeans.JmxRemoteLifecycleListener"
rmiregistryportplatform="10001"
rmiserverportplatform="10002"
uselocalports="true" />
而我的setenv.sh如下
CATALINA_OPTS="-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
-Djava.rmi.server.hostname=ec2-xx-xxx-xx-xx.ap-southeast-1.compute.amazonaws.com"
$CATALINA_OPTS
除此之外,我在tomcat的lib目录中添加了catalina-jmx-remote.jar
谁能给我一些提示,可能出了什么问题。我尝试了所有与配置 VisualVM 相关的方法
我在 ubuntu 上运行 Tomcat 8.0.18、java 8
【问题讨论】:
标签: java tomcat amazon-web-services amazon-ec2 visualvm