Tomcat意外关闭

时间:2015-12-28 14:12:46

标签: java tomcat xampp

我一直在研究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 eror:

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

2 个答案:

答案 0 :(得分:2)

这是原因:

  

引起:java.net.BindException:地址已在使用中:JVM_Bind:8080

这意味着服务器正在尝试绑定到端口8080,但您的计算机已经绑定了一些东西。确保您的其他进程没有占用该端口,或选择另一个进程(可能在server.xml中)以供使用。

答案 1 :(得分:1)

见:

Caused by: java.net.BindException: Address already in use: JVM_Bind

Tomcat配置使用的端口已被其他应用程序使用。

关闭其他应用程序,或编辑server.xml文件以使用其他端口(默认端口为8080)。