java Tomcat 意外关闭
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/34495137/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Tomcat shutdown unexpectedly
提问by Eyosiyas Tadele
I have been working on xampp tomcat server and I'm new for it. I configured it and starts the xampp tomcat. It works fine and I see all the ports I configured perfectly but after 3 minutes it shows me this error
我一直在研究 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"
I opened the Catalina log to get more info and I noticed this java eror:
我打开 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
回答by Arnaud
See :
看 :
Caused by: java.net.BindException: Address already in use: JVM_Bind
The port that Tomcat is configured to use, is already in use by another application.
Tomcat 配置使用的端口已被另一个应用程序使用。
Either shutdown the other application, or edit your server.xml
file to use another port (the default one is 8080).
关闭另一个应用程序,或编辑您的server.xml
文件以使用另一个端口(默认端口为 8080)。
回答by Todd
This is the cause:
这是原因:
Caused by: java.net.BindException: Address already in use: JVM_Bind :8080
引起:java.net.BindException:地址已在使用:JVM_Bind :8080
It means the server is trying to bind to port 8080
but your machine already has something bound there. Make sure one of your other processes isn't taking up that port, or select another one (probably in server.xml
) to use.
这意味着服务器正在尝试绑定到端口,8080
但您的机器已经绑定了一些东西。确保您的其他进程之一未占用该端口,或选择另一个进程(可能在 中server.xml
)使用。