感谢您的帮助!我已经查看了stackoverflow上所有相关的帖子,但没有一个能解决我的问题。
背景信息:
我使用的是MacBook Pro运行的MacOS Sierra 10.12.1,并在Parallels Desktop 12 for Mac Pro Edition 12.1.0虚拟Windows 10操作系统中运行Windows 10、Eclipse Neon.1 Release (4.6.1)和Tomcat支持以及Java 1。
当我启动Eclipse时一切正常。但是,当我点击Eclipse Tomcat启动按钮时,就会出现以下异常:
我使用TCPView查看运行在8080端口的内容,发现如下信息:
背景信息:
我使用的是MacBook Pro运行的MacOS Sierra 10.12.1,并在Parallels Desktop 12 for Mac Pro Edition 12.1.0虚拟Windows 10操作系统中运行Windows 10、Eclipse Neon.1 Release (4.6.1)和Tomcat支持以及Java 1。
当我启动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
当然,所有之前提到的异常仍然存在。
我尝试杀死其中一个8080进程,但它们都有相同的进程ID!实际上,上面显示的所有端口监听器都具有相同的PID。
对我来说更改端口不是一个选项。
任何帮助都将不胜感激。
非常感谢,
Terry Kilshaw