gpt4 book ai didi

java - 在禁用 JMX 身份验证的情况下,由于缺少 jmxremote.access 文件,Tomcat 7 无法启动

转载 作者:搜寻专家 更新时间:2023-10-31 20:28:31 29 4
gpt4 key购买 nike

我的 tomcat 7(托管在 amazon-eu,java 1.7.0_51)无法启动,出现以下异常:

SEVERE: Catalina.start:org.apache.catalina.LifecycleException: Failed to start component [StandardServer[8005]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.startup.Catalina.start(Catalina.java:684)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:322)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:456)
Caused by: java.lang.IllegalArgumentException: jmxremote.access (No such file or directory)
at javax.management.remote.rmi.RMIConnectorServer.start(RMIConnectorServer.java:372)
at org.apache.catalina.mbeans.JmxRemoteLifecycleListener.createServer(JmxRemoteLifecycleListener.java:304)
at org.apache.catalina.mbeans.JmxRemoteLifecycleListener.lifecycleEvent(JmxRemoteLifecycleListener.java:258)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:347)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:725)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 7 more
Caused by: java.io.FileNotFoundException: jmxremote.access (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:137)
at java.io.FileInputStream.<init>(FileInputStream.java:96)
at com.sun.jmx.remote.security.MBeanServerFileAccessController.propertiesFromFile(MBeanServerFileAccessController.java:294)
at com.sun.jmx.remote.security.MBeanServerFileAccessController.<init>(MBeanServerFileAccessController.java:133)
at javax.management.remote.rmi.RMIConnectorServer.start(RMIConnectorServer.java:370)
... 15 more

JMX 已启用,因为我在/usr/share/tomcat7/conf/tomcat7.conf 中有以下行:

$CATALINA_OPTS=-Dcom.sun.management.jmxremote -Djava.rmi.server.hostname=ec2-<ip>.eu-west-1.compute.amazonaws.com -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false

以及/usr/share/tomcat7/conf/server.xml 中的以下内容:

<Listener className="org.apache.catalina.mbeans.JmxRemoteLifecycleListener"
rmiRegistryPortPlatform="9998" rmiServerPortPlatform="9998"/>

如果我评论这两行,一切都很好。

问题是:为什么在“authenticate”设置为 false 时需要 jmxremote.access。

最佳答案

你完全正确,如果你设置 com.sun.management.jmxremote.authenticate=false 你不应该需要 jmxremote.access 文件,我相信问题是 tomcat 没有获取 JMX 参数,据我所知,tomcat7.conf 不是 tomcat 的标准配置文件(check this),请尝试添加它们到 /usr/share/tomcat7/bin/catalina.sh,像这样:

CATALINA_OPTS="$CATALINA_OPTS -Dcom.sun.management.jmxremote -Djava.rmi.server.hostname=ec2-<ip>.eu-west-1.compute.amazonaws.com -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"

有关如何配置 tomcat 的更多信息 check this ,您会在 catalina.sh 的 header 中看到更多文档。

关于java - 在禁用 JMX 身份验证的情况下,由于缺少 jmxremote.access 文件,Tomcat 7 无法启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22027230/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com