Tomcat 意外关闭
Posted
技术标签:
【中文标题】Tomcat 意外关闭【英文标题】:Tomcat shutdown unexpectedly 【发布时间】:2016-04-02 09:33:27 【问题描述】:我一直在研究 xampp tomcat 服务器,我是新手。我对其进行了配置并启动了 xampp tomcat。它工作正常,我看到我配置的所有端口都完美,但 3 分钟后它显示了这个错误
"Error: Tomcat shutdown unexpectedly.
4:55:38 PM [Tomcat] This may be due to a blocked port, missing dependencies,
4:55:38 PM [Tomcat] improper privileges, a crash, or a shutdown by another method.
4:55:38 PM [Tomcat] Press the Logs button to view error logs and check
4:55:38 PM [Tomcat] the Windows Event Viewer for more clues
4:55:38 PM [Tomcat] If you need more help, copy and post this
4:55:38 PM [Tomcat] entire log window on the forums"
我打开 Catalina 日志以获取更多信息,我注意到这个 java 错误:
SEVERE: Failed to initialize connector [Connector[HTTP/1.1-8080]]
org.apache.catalina.LifecycleException: Failed to initialize component [Connector[HTTP/1.1-8080]]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106)
at org.apache.catalina.core.StandardService.initInternal(StandardService.java:559)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:814)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
at org.apache.catalina.startup.Catalina.load(Catalina.java:640)
at org.apache.catalina.startup.Catalina.load(Catalina.java:665)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:281)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)
Caused by: org.apache.catalina.LifecycleException: Protocol handler initialization failed
at org.apache.catalina.connector.Connector.initInternal(Connector.java:983)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
... 12 more
Caused by: java.net.BindException: Address already in use: JVM_Bind <null>:8080
at org.apache.tomcat.util.net.JIoEndpoint.bind(JIoEndpoint.java:406)
at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:610)
at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:429)
at org.apache.coyote.http11.AbstractHttp11JsseProtocol.init(AbstractHttp11JsseProtocol.java:119)
at org.apache.catalina.connector.Connector.initInternal(Connector.java:981)
... 13 more
Caused by: java.net.BindException: Address already in use: JVM_Bind
at java.net.DualStackPlainSocketImpl.bind0(Native Method)
at java.net.DualStackPlainSocketImpl.socketBind(DualStackPlainSocketImpl.java:106)
at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:382)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:190)
at java.net.ServerSocket.bind(ServerSocket.java:375)
at java.net.ServerSocket.<init>(ServerSocket.java:237)
at java.net.ServerSocket.<init>(ServerSocket.java:181)
at org.apache.tomcat.util.net.DefaultServerSocketFactory.createSocket(DefaultServerSocketFactory.java:49)
at org.apache.tomcat.util.net.JIoEndpoint.bind(JIoEndpoint.java:393)
... 17 more
【问题讨论】:
【参考方案1】:这就是原因:
原因:java.net.BindException:地址已在使用中:JVM_Bind :8080
这意味着服务器正在尝试绑定到端口8080
,但您的机器已经绑定了一些东西。确保您的其他进程之一没有占用该端口,或选择另一个(可能在server.xml
)来使用。
【讨论】:
【参考方案2】:见:
Caused by: java.net.BindException: Address already in use: JVM_Bind
Tomcat 配置使用的端口已被另一个应用程序使用。
关闭其他应用程序,或编辑您的server.xml
文件以使用另一个端口(默认端口为 8080)。
【讨论】:
以上是关于Tomcat 意外关闭的主要内容,如果未能解决你的问题,请参考以下文章
httpWebRequest请求错误,基础连接已经关闭: 连接被意外关闭