我已经安装了 apache-tomcat-7 并且还在 /etc/init.d/tomcat 添加了一个可以启动/停止/重新启动 Apache Tomcat 7.0 的脚本。现在,当我启动 tomcat 服务时,它没有给出任何错误,但我无法看到它正在运行http://my-ip-address:8080/
而且,当我停止 tomcat 服务时,会显示一条异常消息:-
Using CATALINA_BASE: /usr/local/apache-tomcat7
Using CATALINA_HOME: /usr/local/apache-tomcat7
Using CATALINA_TMPDIR: /usr/local/apache-tomcat7/temp
Using JRE_HOME: /usr/lib/jvm/jre-1.7.0-openjdk.x86_64
Using CLASSPATH: /usr/local/apache-tomcat7/bin/bootstrap.jar:/usr/local/apache-tomcat7/bin/tomcat-juli.jar
Aug 09, 2013 7:03:23 AM org.apache.catalina.startup.Catalina stopServer
SEVERE: Could not contact localhost:8005. Tomcat may not be running.
Aug 09, 2013 7:03:23 AM org.apache.catalina.startup.Catalina stopServer
SEVERE: Catalina.stop:
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)
at java.net.Socket.connect(Socket.java:579)
at java.net.Socket.connect(Socket.java:528)
at java.net.Socket.<init>(Socket.java:425)
at java.net.Socket.<init>(Socket.java:208)
at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:500)
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:601)
at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:371)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:458)
此错误消息包含SEVERE: Could not contact localhost:8005. Tomcat may not be running.
可能表明服务器未启动的行。但我想知道,因为在此之前我也运行过命令service tomcat start
。
对不起,伙计们,我忘了提到我正在VPS
运行的 a 上执行此操作CentOs 6
。