我正在使用Windows命令来运行我的Spring Boot应用程序,并嵌入Tomcat。此外,我需要使用CommandlineRunner运行许多控制台应用程序。当然,我遇到了端口已被占用的问题。
***************************
APPLICATION FAILED TO START
***************************
Description:
Web server failed to start. Port 8080 was already in use.
Action:
Identify and stop the process that's listening on port 8080 or configure this application to listen on another port.
我可以在每个控制台应用程序中设置端口,但我需要同时运行至少10个控制台应用程序。
是否有任何配置或解决方案,使应用程序能够自动更改端口?
TCP/IP
模块。 - Faheem azaz BhanejIDE
自动处理。 - Faheem azaz BhanejSpring Boot
web 中定义服务器端口,并由IDE(Eclipse、Netbeans、IntelliJ)
处理,而不是由Java 运行环境
处理。 - Faheem azaz Bhanej