myEclipse中Tomcat启动报错问题

在myeclipse中启动tomcat报如下错误:

信息: Initializing ProtocolHandler ["http-nio-8080"]
Apr 15, 2018 5:01:20 PM org.apache.catalina.util.LifecycleBase handleSubClassException
严重: Failed to initialize component [Connector[HTTP/1.1-8080]]
org.apache.catalina.LifecycleException: Protocol handler initialization failed
    at org.apache.catalina.connector.Connector.initInternal(Connector.java:935)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
    at org.apache.catalina.core.StandardService.initInternal(StandardService.java:530)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
    at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:852)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:633)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:656)
    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:498)
    at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:306)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:491)
Caused by: java.net.BindException: Address already in use
    at sun.nio.ch.Net.bind0(Native Method)
    at sun.nio.ch.Net.bind(Net.java:433)
    at sun.nio.ch.Net.bind(Net.java:425)
    at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
    at org.apache.tomcat.util.net.NioEndpoint.initServerSocket(NioEndpoint.java:227)
    at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:202)
    at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:1043)
    at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:540)
    at org.apache.coyote.http11.AbstractHttp11Protocol.init(AbstractHttp11Protocol.java:74)
    at org.apache.catalina.connector.Connector.initInternal(Connector.java:932)
    ... 13 more
Apr 15, 2018 5:01:20 PM org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["ajp-nio-8009"]
Apr 15, 2018 5:01:21 PM org.apache.catalina.util.LifecycleBase handleSubClassException
严重: Failed to initialize component [Connector[AJP/1.3-8009]]
org.apache.catalina.LifecycleException: Protocol handler initialization failed
    at org.apache.catalina.connector.Connector.initInternal(Connector.java:935)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
    at org.apache.catalina.core.StandardService.initInternal(StandardService.java:530)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
    at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:852)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:633)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:656)
    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:498)
    at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:306)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:491)
Caused by: java.net.BindException: Address already in use
    at sun.nio.ch.Net.bind0(Native Method)
    at sun.nio.ch.Net.bind(Net.java:433)
    at sun.nio.ch.Net.bind(Net.java:425)
    at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
    at org.apache.tomcat.util.net.NioEndpoint.initServerSocket(NioEndpoint.java:227)
    at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:202)
    at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:1043)
    at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:540)
    at org.apache.catalina.connector.Connector.initInternal(Connector.java:932)
    ... 13 more
Apr 15, 2018 5:01:21 PM org.apache.catalina.startup.Catalina load
信息: Initialization processed in 988 ms
Apr 15, 2018 5:01:21 PM org.apache.catalina.core.StandardService startInternal
信息: Starting service [Catalina]
Apr 15, 2018 5:01:21 PM org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/9.0.7
Apr 15, 2018 5:01:21 PM org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory [/usr/local/ApacheTomcat/webapps/ppp]
Apr 15, 2018 5:01:21 PM org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory [/usr/local/ApacheTomcat/webapps/ppp] has finished in [40] ms
Apr 15, 2018 5:01:21 PM org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory [/usr/local/ApacheTomcat/webapps/docs]
Apr 15, 2018 5:01:21 PM org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory [/usr/local/ApacheTomcat/webapps/docs] has finished in [22] ms
Apr 15, 2018 5:01:21 PM org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory [/usr/local/ApacheTomcat/webapps/manager]
Apr 15, 2018 5:01:21 PM org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory [/usr/local/ApacheTomcat/webapps/manager] has finished in [62] ms
Apr 15, 2018 5:01:21 PM org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory [/usr/local/ApacheTomcat/webapps/examples]
Apr 15, 2018 5:01:22 PM org.apache.catalina.core.ApplicationContext log
信息: ContextListener: contextInitialized()
Apr 15, 2018 5:01:22 PM org.apache.catalina.core.ApplicationContext log
信息: SessionListener: contextInitialized()
Apr 15, 2018 5:01:22 PM org.apache.catalina.core.ApplicationContext log
信息: ContextListener: attributeAdded('StockTicker', 'async.Stockticker@2de23121')
Apr 15, 2018 5:01:22 PM org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory [/usr/local/ApacheTomcat/webapps/examples] has finished in [393] ms
Apr 15, 2018 5:01:22 PM org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory [/usr/local/ApacheTomcat/webapps/ROOT]
Apr 15, 2018 5:01:22 PM org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory [/usr/local/ApacheTomcat/webapps/ROOT] has finished in [20] ms
Apr 15, 2018 5:01:22 PM org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory [/usr/local/ApacheTomcat/webapps/host-manager]
Apr 15, 2018 5:01:22 PM org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory [/usr/local/ApacheTomcat/webapps/host-manager] has finished in [31] ms
Apr 15, 2018 5:01:22 PM org.apache.catalina.startup.Catalina start
信息: Server startup in 1098 ms
Apr 15, 2018 5:01:22 PM org.apache.catalina.core.StandardServer await
严重: StandardServer.await: create[localhost:8005]:
java.net.BindException: Address already in use (Bind failed)
    at java.net.PlainSocketImpl.socketBind(Native Method)
    at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:387)
    at java.net.ServerSocket.bind(ServerSocket.java:375)
    at java.net.ServerSocket.<init>(ServerSocket.java:237)
    at org.apache.catalina.core.StandardServer.await(StandardServer.java:422)
    at org.apache.catalina.startup.Catalina.await(Catalina.java:770)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:716)
    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:498)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:350)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492)

这说明已经有tomact在后台运行产生的绑定错误(你在控制台已经启动tomcat并没有关闭)

解决方法:手动关闭 tomcat

控制台中输入:

1.cd  /你的tomcat存放的文件夹/bin /

2. ./shutdown.sh

3.然后在myeclise中重新启动tomact不报错!!

阅读更多

没有更多推荐了,返回首页