当我第一次在localhost中运行该应用程序时,它可以工作。但是我更改了代码并重新运行,它显示了此错误消息。当我终止所有进程并重新运行时。再次显示下面的messege。
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.4.1)
2021-01-15 13:25:06.321 INFO 7180 --- [ main] com.example.demo.SocialApiApplication : Starting SocialApiApplication using Java 15.0.1 on DESKTOP-TCH1T7S with PID 7180 (E:\springboot\SocialAPI\target\classes started by Samanthika in E:\springboot\SocialAPI)
2021-01-15 13:25:06.325 INFO 7180 --- [ main] com.example.demo.SocialApiApplication : No active profile set, falling back to default profiles: default
2021-01-15 13:25:07.193 INFO 7180 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8006 (http)
2021-01-15 13:25:07.205 INFO 7180 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2021-01-15 13:25:07.205 INFO 7180 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.41]
2021-01-15 13:25:07.298 INFO 7180 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2021-01-15 13:25:07.298 INFO 7180 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 918 ms
2021-01-15 13:25:07.487 INFO 7180 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2021-01-15 13:25:07.676 WARN 7180 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Failed to start bean 'webServerStartStop'; nested exception is org.springframework.boot.web.server.PortInUseException: Port 8006 is already in use
2021-01-15 13:25:07.677 INFO 7180 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor'
2021-01-15 13:25:07.683 INFO 7180 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2021-01-15 13:25:07.700 INFO 7180 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-01-15 13:25:07.714 ERROR 7180 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
Web server failed to start. Port 8006 was already in use.
Action:
Identify and stop the process that's listening on port 8006 or configure this application to listen on another port.
但是我在应用程序属性中更改了server.port。有用。但是我试图再次运行,但遇到了以上错误。当我一直运行时,我应该要更改application.properties中的服务器端口。有解决此问题的解决方案吗?
用于tomcat 8006的端口已在使用中。您需要终止该过程并重新运行您的项目
在您的cmd上使用它来获取进程的PID号:
netstat -ano | findstr :8006
然后使用以下命令终止此过程:
taskkill /PID <PID> /F
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句