gpt4 book ai didi

eclipse - Tomcat 以 java.net.BindException : Address already in use exception 开头

转载 作者:行者123 更新时间:2023-12-04 17:55:44 28 4
gpt4 key购买 nike

在此先感谢您的帮助!

我查看了 stackoverflow 上的所有相关帖子,但没有一个回答我的问题。

上下文:

Windows 10、Eclipse Neon.1 Release (4.6.1),支持 Tomcat 和 Java 1。所有这些都在运行 MacOS Sierra 10.12.1 的 MacBook Pro 上运行,Parallels Desktop 12 for Mac Pro Edition 12.1.0 虚拟Windows 10。

当我启动 Eclipse 时一切正常。

当我单击 Eclipse Tomcat 启动按钮时,出现以下异常:

16-Nov-2016 10:55:10 AM 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\jre6\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files (x86)\Parallels\Parallels Tools\Applications;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk1.8.0_102;C:\Program Files (x86)\Skype\Phone\;C:\Program Files (x86)\Private Shell;C:\PROGRA~2\COMMON~1\Odbc\FILEMA~1;C:\Users\terry.QUANTECH\AppData\Local\Microsoft\WindowsApps;;.
16-Nov-2016 10:55:10 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
16-Nov-2016 10:55:10 AM org.apache.coyote.http11.Http11Protocol init
SEVERE: Error initializing endpoint
java.net.BindException: Address already in use: JVM_Bind <null>:8080
at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:563)
at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:181)
at org.apache.catalina.connector.Connector.initialize(Connector.java:1141)
at org.apache.catalina.core.StandardService.initialize(StandardService.java:703)
at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:843)
at org.apache.catalina.startup.Catalina.load(Catalina.java:538)
at org.apache.catalina.startup.Catalina.load(Catalina.java:562)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:261)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: java.net.BindException: Address already in use: JVM_Bind
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(Unknown Source)
at java.net.ServerSocket.bind(Unknown Source)
at java.net.ServerSocket.<init>(Unknown Source)
at java.net.ServerSocket.<init>(Unknown Source)
at org.apache.tomcat.util.net.DefaultServerSocketFactory.createSocket(DefaultServerSocketFactory.java:50)
at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:552)
... 12 more
16-Nov-2016 10:55:10 AM org.apache.catalina.core.StandardService initialize
SEVERE: Failed to initialize connector [Connector[HTTP/1.1-8080]]
LifecycleException: Protocol handler initialization failed: java.net.BindException: Address already in use: JVM_Bind <null>:8080
at org.apache.catalina.connector.Connector.initialize(Connector.java:1143)
at org.apache.catalina.core.StandardService.initialize(StandardService.java:703)
at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:843)
at org.apache.catalina.startup.Catalina.load(Catalina.java:538)
at org.apache.catalina.startup.Catalina.load(Catalina.java:562)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:261)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
16-Nov-2016 10:55:11 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8443
16-Nov-2016 10:55:11 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 583 ms
16-Nov-2016 10:55:11 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
16-Nov-2016 10:55:11 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.45
16-Nov-2016 10:55:11 AM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor gomenu.xml
16-Nov-2016 10:55:11 AM org.apache.catalina.startup.HostConfig deployDescriptor
WARNING: A docBase C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\gomenu inside the host appBase has been specified, and will be ignored
16-Nov-2016 10:55:11 AM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor gps.xml
16-Nov-2016 10:55:11 AM org.apache.catalina.startup.HostConfig deployDescriptor
WARNING: A docBase C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\gps inside the host appBase has been specified, and will be ignored

等等

我使用 TCPView 查找在端口 8080 上运行的程序并查看:

javaw.exe   1676    TCP TerryWin10onMac 8080    TerryWin10onMac 0   LISTENING                                       
javaw.exe 1676 TCPV6 terrywin10onmac.quantechsoftware.local 8080 terrywin10onmac.quantechsoftware.local 0 LISTENING

所以是 Java,大概是 Tomcat 两次抢占了 8080 端口。

我停止 Tomcat,关闭 Eclipse,然后看到 TCPView 中对端口 8080 的所有引用都消失了。

我启动 Eclipse。 TCPView 仍然没有显示对端口 8080 的引用。

我启动 Tomcat 并看到一大堆东西出现在 TCPView 中,其中两个指向端口 8009,两个指向 8080:

javaw.exe 7076  TCP TerryWin10onMac 8005  TerryWin10onMac 0 LISTENING                   
javaw.exe 7076 TCP TerryWin10onMac 8009 TerryWin10onMac 0 LISTENING
javaw.exe 7076 TCPV6 terrywin10onmac.quantechsoftware.local 8009 terrywin10onmac.quantechsoftware.local 0 LISTENING
javaw.exe 7076 TCP TerryWin10onMac 8080 TerryWin10onMac 0 LISTENING
javaw.exe 7076 TCPV6 terrywin10onmac.quantechsoftware.local 8080 terrywin10onmac.quantechsoftware.local 0 LISTENING
javaw.exe 7076 TCP TerryWin10onMac 8443 TerryWin10onMac 0 LISTENING
javaw.exe 7076 TCPV6 terrywin10onmac.quantechsoftware.local 8443 terrywin10onmac.quantechsoftware.local 0 LISTENING

当然,所有的异常(exception)情况都和以前一样。

我试图杀死其中一个 8080 进程,但它们都有相同的进程 ID!事实上,上面显示的所有端口监听器都具有相同的 PID。

我不能更改端口。

如有任何帮助,我们将不胜感激。

非常感谢,

特里·基尔肖

最佳答案

+1 以获得对您的研究的详细描述。

我建议您查看 <tomcat_home>\conf\server.xml文件并检查声明的所有端口。可能8080重复了。

并在 Eclipse 的服务器配置中执行相同的检查:看到没有重复的端口号。

关于eclipse - Tomcat 以 java.net.BindException : Address already in use exception 开头,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40640776/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com