2014-02-25 69 views
5

我的Tomcat 7(亞馬遜歐盟主辦,JAVA 1.7.0_51)無法啓動,以下情況例外:的Tomcat 7無法啓動由於沒有jmxremote.access文件,而JMX認證功能

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"/> 

如果我評論這兩行,一切都很好。

問題是:爲什麼jmxremote.access在「authenticate」設置爲false時是必需的。

+0

維塔利,有任何答案適合你嗎?如果他們這樣做,請小心接受? –

回答

1

你是對的,如果你設置了com.sun.management.jmxremote.authenticate=false你不應該需要jmxremote.access文件,我相信問題是JMX參數沒有被tomcat拾起,因爲我知道,tomcat7.conf不是爲Tomcat標準配置文件(check this),嘗試加入他們,而不是到/usr/share/tomcat7/bin/catalina.sh,像這樣的:如何配置Tomcat check this

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" 

脫穎而出更多的信息,你會看到在catalina.sh頭些文檔。

0

嘗試在雙引號包圍的命令行參數,例如:

$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" 

我的猜測是,它只有在拍攝第一放慢參數進去,因爲缺少引號。