We have a web application that's been running on Tomcat 7, we're moving to Tomcat 8 and are now depending on an internal microservice for the application as well. We use Netbeans.
I have made the necessary changes to configuration such that I can start the microservice app and then the web application on my machine from the command line. However, when I attempt to run the web app from within Netbeans, it tells me "Starting of Tomcat failed, the server port 8443 is already in use".
I don't know why that port is reported as in use when run from within Netbeans, but not if the same server with the same web application is run from the command line. Does anyone have any ideas on what to check?
A quick way to make progress is simply to use a port other than 8443 . That won't necessarily resolve the problem you are experiencing, but it will circumvent it. To do that:
netstat -aon | findstr 8447
09-Jan-2018 02:07:26.279 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"] 09-Jan-2018 02:07:26.285 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler [" https-openssl-apr-8447 "] 09-Jan-2018 02:07:26.290 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"] 09-Jan-2018 02:07:26.293 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 2585 ms
As a separate issue, once everything is working on port 8447 , run netstat -aon | findstr 8443 to see if port 8443 is still being used while Tomcat is running. If so then (on Windows) get the PID of the process that is still using that port, and then lookup that PID on the Details tab of Task Manager . Here's a screenshot showing that in my case port 8447 was used by PID 2340 which was an instance of java.exe for Tomcat:
If none of that resolves anything:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.