当前位置: 首页 > 知识库问答 >
问题:

无法使用Eclipse启动Tomcat:“地址已在使用中”

於德馨
2023-03-14

在这里,我发布了我的控制台错误:

 org.apache.catalina.core.AprLifecycleListener init
 INFO: The APR based Apache Tomcat Native library which allows optimal performance in
 production environments was not found on the java.library.path:
 C:\Program Files\Java\jdk1.7.0_21\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Users/Krzys/Desktop/eclipse-jee-juno-SR2-win32-x86_64/eclipse/jre/bin/server;C:/Users/Krzys/Desktop/eclipse-jee-juno-SR2-win32-x86_64/eclipse/jre/bin;C:/Users/Krzys/Desktop/eclipse-jee-juno-SR2-win32-x86_64/eclipse/jre/lib/amd64;;C:\Users\Krzys\Desktop\eclipse-jee-juno-SR2-win32-x86_64\eclipse;;.
 kwi 23, 2013 3:53:21 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
 WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting
 property 'source' to 'org.eclipse.jst.jee.server:Lab5' did not find a matching property.
 kwi 23, 2013 3:53:21 PM org.apache.coyote.AbstractProtocol init
 INFO: Initializing ProtocolHandler ["http-bio-8080"]
 kwi 23, 2013 3:53:21 PM org.apache.coyote.AbstractProtocol init
 SEVERE: Failed to initialize end point associated with ProtocolHandler ["http-bio-8080"]
 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)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    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:633)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:658)
    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:601)
    at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:281)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)
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:96)
    at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376)
    at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:175)
    at java.net.ServerSocket.bind(ServerSocket.java:376)
    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

 kwi 23, 2013 3:53:21 PM org.apache.catalina.core.StandardService initInternal
 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:633)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:658)
    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:601)
    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:96)
    at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376)
    at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:175)
    at java.net.ServerSocket.bind(ServerSocket.java:376)
    at java.net.ServerSocket.(ServerSocket.java:237)
    at java.net.ServerSocket.(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

 kwi 23, 2013 3:53:21 PM org.apache.coyote.AbstractProtocol init
 INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
 kwi 23, 2013 3:53:21 PM org.apache.coyote.AbstractProtocol init
 SEVERE: Failed to initialize end point associated with ProtocolHandler ["ajp-bio-8009"]
 java.net.BindException: Address already in use: JVM_Bind <null>:8009
    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.catalina.connector.Connector.initInternal(Connector.java:981)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    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:633)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:658)
    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:601)
    at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:281)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)
 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:96)
    at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376)
    at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:175)
    at java.net.ServerSocket.bind(ServerSocket.java:376)
    at java.net.ServerSocket.(ServerSocket.java:237)
    at java.net.ServerSocket.(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)
    ... 16 more

 kwi 23, 2013 3:53:21 PM org.apache.catalina.core.StandardService initInternal
 SEVERE: Failed to initialize connector [Connector[AJP/1.3-8009]]
 org.apache.catalina.LifecycleException: Failed to initialize component [Connector[AJP/1.3-8009]]
    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:633)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:658)
    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:601)
    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>:8009
    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.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:96)
    at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376)
    at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:175)
    at java.net.ServerSocket.bind(ServerSocket.java:376)
    at java.net.ServerSocket.(ServerSocket.java:237)
    at java.net.ServerSocket.(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)
    ... 16 more

 kwi 23, 2013 3:53:21 PM org.apache.catalina.startup.Catalina load
 INFO: Initialization processed in 1271 ms
 kwi 23, 2013 3:53:21 PM org.apache.catalina.core.StandardService startInternal
 INFO: Starting service Catalina
 kwi 23, 2013 3:53:21 PM org.apache.catalina.core.StandardEngine startInternal
 INFO: Starting Servlet Engine: Apache Tomcat/7.0.39
 kwi 23, 2013 3:53:23 PM org.apache.catalina.startup.HostConfig deployDirectory
 INFO: Deploying web application directory C:\Users\Krzys\Desktop\eclipse-jee-juno-SR2-win32-x86_64\eclipse\apache-tomcat-7.0.39\webapps\docs
 kwi 23, 2013 3:53:23 PM org.apache.catalina.startup.HostConfig deployDirectory
 INFO: Deploying web application directory C:\Users\Krzys\Desktop\eclipse-jee-juno-SR2-win32-x86_64\eclipse\apache-tomcat-7.0.39\webapps\examples
 kwi 23, 2013 3:53:24 PM org.apache.catalina.core.ApplicationContext log
 INFO: ContextListener: contextInitialized()
 kwi 23, 2013 3:53:24 PM org.apache.catalina.core.ApplicationContext log
 INFO: SessionListener: contextInitialized()
 kwi 23, 2013 3:53:24 PM org.apache.catalina.core.ApplicationContext log
 INFO: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache@737d54dd')
 kwi 23, 2013 3:53:24 PM org.apache.catalina.startup.HostConfig deployDirectory
 INFO: Deploying web application directory C:\Users\Krzys\Desktop\eclipse-jee-juno-SR2-win32-x86_64\eclipse\apache-tomcat-7.0.39\webapps\host-manager
 kwi 23, 2013 3:53:24 PM org.apache.catalina.startup.HostConfig deployDirectory
 INFO: Deploying web application directory C:\Users\Krzys\Desktop\eclipse-jee-juno-SR2-win32-x86_64\eclipse\apache-tomcat-7.0.39\webapps\manager
 kwi 23, 2013 3:53:24 PM org.apache.catalina.startup.HostConfig deployDirectory
 INFO: Deploying web application directory C:\Users\Krzys\Desktop\eclipse-jee-juno-SR2-win32-x86_64\eclipse\apache-tomcat-7.0.39\webapps\ROOT
 kwi 23, 2013 3:53:24 PM org.apache.catalina.startup.Catalina start
 INFO: Server startup in 3028 ms kwi 23, 2013 3:53:24 PM
 org.apache.catalina.core.StandardServer await
 SEVERE: StandardServer.await: create[localhost:8080]:
 java.net.BindException: Address already in use: JVM_Bind
    at java.net.DualStackPlainSocketImpl.bind0(Native Method)
    at java.net.DualStackPlainSocketImpl.socketBind(DualStackPlainSocketImpl.java:96)
    at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376)
    at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:175)
    at java.net.ServerSocket.bind(ServerSocket.java:376)
    at java.net.ServerSocket.<init>(ServerSocket.java:237)
    at org.apache.catalina.core.StandardServer.await(StandardServer.java:427)
    at org.apache.catalina.startup.Catalina.await(Catalina.java:766)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:712)
    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:601)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:322)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:456)

 kwi 23, 2013 3:53:24 PM org.apache.coyote.AbstractProtocol pause
 INFO: Pausing ProtocolHandler ["http-bio-8080"]
 kwi 23, 2013 3:53:24 PM org.apache.coyote.AbstractProtocol pause
 INFO: Pausing ProtocolHandler ["ajp-bio-8009"]
 kwi 23, 2013 3:53:24 PM org.apache.catalina.core.StandardService stopInternal
 INFO: Stopping service Catalina
 kwi 23, 2013 3:53:24 PM org.apache.catalina.core.ApplicationContext log
 INFO: SessionListener: contextDestroyed()
 kwi 23, 2013 3:53:24 PM org.apache.catalina.core.ApplicationContext log
 INFO: ContextListener: contextDestroyed()
 kwi 23, 2013 3:53:24 PM org.apache.coyote.AbstractProtocol stop
 INFO: Stopping ProtocolHandler ["http-bio-8080"]
 kwi 23, 2013 3:53:24 PM org.apache.coyote.AbstractProtocol destroy
 INFO: Destroying ProtocolHandler ["http-bio-8080"]
 kwi 23, 2013 3:53:24 PM org.apache.coyote.AbstractProtocol stop
 INFO: Stopping ProtocolHandler ["ajp-bio-8009"]
 kwi 23, 2013 3:53:24 PM org.apache.coyote.AbstractProtocol destroy
 INFO: Destroying ProtocolHandler ["ajp-bio-8009"]

在点击Tomcat的stop后,我在控制台中得到以下错误:

 kwi 23, 2013 4:27:38 PM org.apache.catalina.startup.Catalina stopServer
 SEVERE: Catalina.stop:
 java.net.ConnectException: connect: Address is invalid on local machine, or port is not valid on remote machine
    at java.net.DualStackPlainSocketImpl.connect0(Native Method)
    at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:69)
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:157)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)
    at java.net.Socket.connect(Socket.java:579)
    at java.net.Socket.connect(Socket.java:528)
    at java.net.Socket.<init>(Socket.java:425)
    at java.net.Socket.<init>(Socket.java:208)
    at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:499)
    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:601)
    at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:371)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:458)

共有1个答案

谭翰海
2023-03-14

默认情况下,Tomcat被配置为在端口8080上启动,但是您已经有一些东西绑定到该端口。它很可能是Tomcat web服务器的另一个实例。

地址已经在使用:JVM_Bind:8080在日志中表示您的计算机已经在端口8080上有一个侦听服务。使用netstat(命令行工具)或TCP视图(图形工具)找到它,关闭它,然后重新启动Tomcat。它应该会越过那个错误。

或者,通过双击Servers选项卡中的Tomcat vx.x Server at localhost行,将Eclipse中的Tomcat配置为在不同的端口上启动,并将窗口右侧显示的所有端口改为不同的端口。

 类似资料:
  • 我无法启动我的tomcat服务器。我几乎什么都试过了。切换位置没有帮助,作为服务器位置。我在Windows8上。 在这里我发布了我的控制台错误: 在点击Tomcat的stop后,我在控制台中收到以下错误:

  • 我有三个Quarkus 2.3.0。最终项目(所有项目均与AWS Lambda合作),直到最近效果良好。其中一个我已经几周没碰了,现在我注意到它不能再启动任何jUnit测试(下面是堆栈跟踪)。所有项目共享完全相同的库版本、相同的应用程序。属性,测试端口8081从未被占用(也包括8080或其他),但两个项目测试工作正常,一个项目甚至在尝试运行单个单元测试之前就失败了(我清理并重建了项目,没有用)。

  • 我是EE 7Java新手。 我有Netbeans 7.4和GlassFish 4.0以及Java EE 7。在64位Windows 8.1 Pro机器中。我想启动GlassFish 4.0服务器,所以我在Netbeans中单击了“服务”选项卡,然后在“服务器”选项中右键单击了GlassFish Server 4.0,然后单击了“启动”。 当我这样做时,我得到了以下消息:“无法启动GlassFish

  • 我想启动JBoss服务器时遇到问题。我正在使用Netbeans,我用

  • 问题内容: 我在Windows 7上运行Tomcat 5.5实例(端口:8089)。 如果我打开http:// localhost:8089 / ,服务器将正常运行,但是在http://192.168.1.100:8089/上却给我一个错误(连接被拒绝) 我以为这是防火墙问题…所以我禁用了它,但是我仍然没有运气。 提前致谢。 解决了: 在连接器字符串中添加了 地址=“ 0.0.0.0” ,就可以了

  • 我已经检查了netstat并且能够找到处于侦听状态端口8080 C:\users\administrator>netstat-ano findstr“8080” TCP 0.0.0.0:8080 0.0.0.0:0侦听540 如有任何帮助,我们将不胜感激。谢谢你。