情景:更新web程序,关闭了tomcat。 更新后,删除了tomcat的catalina.out日志及导出了catalina.sh文件,开启了tomcat startup.sh 后。不能正常访问程序。然后再次shutdown.sh 后报错
java.net.ConnectException:Connection refused: connect
atjava.net.DualStackPlainSocketImpl.connect0(Native Method)
atjava.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
atjava.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
atjava.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
atjava.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
atjava.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
atjava.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
atjava.net.Socket.connect(Socket.java:579)
atjava.net.Socket.connect(Socket.java:528)
atjava.net.Socket.
atjava.net.Socket.
atorg.apache.catalina.startup.Catalina.stopServer(Catalina.java:500)
atsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
atjava.lang.reflect.Method.invoke(Method.java:606)
atorg.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:371)
atorg.apache.catalina.startup.Bootstrap.main(Bootstrap.java:458)
catalina.out日志:
八月 03, 2018 9:48:22 上午 org.apache.catalina.startup.Catalina start
严重: The required Server component failed to start so Tomcat is unable to start.
org.apache.catalina.LifecycleException: Failed to start component [StandardServer[8005]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)
at org.apache.catalina.startup.Catalina.start(Catalina.java:705)
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:606)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:428)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardService[Catalina]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:758)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
... 7 more
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:444)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
... 9 more
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1249)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:300)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
... 11 more
反反复复开启关闭几次tomcat。还是不行
立刻网上找解决办法:
【1】杀进程,可能是tomcat第一次没有真正的关闭
【2】修改防火墙
【3】更该jdk文件
大概就是这几种办法。但是还是不行!!!
没办法,只得删除了tomcat后,重新安装。第一次安装后更改了xml还是不行
今天再次重新安装,没有更改任何xml文件后开启访问ip。可以正常访问了,然后在去修改各xml文件。
不过很奇怪,还是不明白到底是哪里出了问题。期待大神的解决方案。
不过我发现每次更改完server.xml就会这样,应该是server.xml里面的配置写的有问题导致的。