简体   繁体   English

错误:JMX连接器服务器通信错误:服务:jmx:rmi停止/关闭Tomcat时

[英]Error: JMX connector server communication error: service:jmx:rmi when stopping/shutdown Tomcat

Title says it all. 标题说明了一切。 Tomcat 8 (Java 8) is running on Linux. Tomcat 8(Java 8)在Linux上运行。 After the error message I see that java process is not killed. 在错误消息之后,我看到java进程没有被杀死。 Is it a problem with JMX configuration or what? 这是JMX配置的问题还是什么?

export JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=55001 -Dcom.sun.management.jmxremote.authenticate=false"
export JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.rmi.port=55002 -Djava.rmi.server.hostname=xxxxx -Dcom.sun.management.jmxremote.local.only=false"

Found the answer here : 这里找到答案:

There isn't. 没有。 The reason why this is happening is that when tomcat starts, port 5555 (in this example) is bound. 发生这种情况的原因是当tomcat启动时,端口5555(在此示例中)被绑定。

F or shutdown, another jvm is launched and gets the same jmx parameters. F 或关闭,启动另一个jvm并获取相同的jmx参数。 Therefore, it tries to bind to port 5555, too, fails and shuts the jvm down. 因此,它也尝试绑定到端口5555,失败并关闭jvm。 The shutdown procedure isn't executed and thus tomcat is still running. 不执行关闭过程,因此tomcat仍在运行。

The only fix I could think of is to introduce yet another variable that applies to start and run but not to stop. 我能想到的唯一解决方法是引入另一个适用于启动和运行但不停止的变量。

I had to set JMX parameters as CATALINA_OPTS and not as JAVA_OPTS and it worked. 我不得不将JMX参数设置为CATALINA_OPTS而不是JAVA_OPTS并且它有效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM