当我运行Tomcat服务器与创建VM选项中的“编辑配置”,它出现的错误:
/`Tomcat/apache-tomcat-9.0.14/bin/catalina.sh: -Dcom.sun.management.jmxremote=true: not found`
我找个地方在网络上的意见,在catalina.sh添加如下内容:
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=9010
-Dcom.sun.management.jmxremote.local.only=false
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
当我补充说,错误是在这个变化:
/Tomcat/apache-tomcat-9.0.14/bin/catalina.sh: 118: -Dcom.sun.management.jmxremote=true: not found
/Tomcat/apache-tomcat-9.0.14/bin/catalina.sh: 119: -Dcom.sun.management.jmxremote.port=9010: not found
/Tomcat/apache-tomcat-9.0.14/bin/catalina.sh: 120: -Dcom.sun.management.jmxremote.local.only=false: not found
/Tomcat/apache-tomcat-9.0.14/bin/catalina.sh: 121: -Dcom.sun.management.jmxremote.authenticate=false: not found
/Tomcat/apache-tomcat-9.0.14/bin/catalina.sh: 122: -Dcom.sun.management.jmxremote.ssl=false: not found
/Tomcat/apache-tomcat-9.0.14/bin/catalina.sh: 1: eval: -Dcom.sun.management.jmxremote=: not found
Addictionally出现黄色窗口:
Application Server was not connected before run configuration stop, reason:
Unable to ping server at localhost:1099
当我删除在Tomcat中配置“VM选项”我的连接查询,该服务器正常启动。
下面是运行/调试配置的a screenshot。
【解析】要做到这一点,你需要在catalina.sh写:
JAVA_OPTS="-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=12345
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false"
CATALINA_OPTS="-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=1099
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false"