在本地主机上运行springboot应用程序时出现错误

萨曼蒂卡·拉贾帕克萨(Samanthika Rajapaksa)

当我第一次在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] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

Node.js应用程序在本地主机上运行良好,但在Heroku上部署时显示错误

节点应用程序在本地主机上运行但不在 Heroku 上运行?

应用程序在 Teams 内运行,但不在本地主机上运行

php sql应用程序不在网站上运行,而是在本地主机上运行

将本地主机站点转换为应用程序时出现空白屏幕

运行springboot应用程序时出现错误

laravel 应用程序不会出现在本地主机上

在本地主机中运行Spring Boot应用程序时出错

如何在没有IntelliJ的本地主机上运行Spring应用程序?

Heroku 应用程序不会像在本地主机上运行时那样重定向

Koajs,不在本地主机上运行的简单应用程序

如何在Ruby on Rails应用程序的本地主机上运行SSL证书?

如何在本地主机上运行laravel和reactjs应用程序(xampp)

如何在本地主机上运行多个express / Nodejs应用程序?

从浏览器访问在本地主机上运行的SignalR应用程序

在本地主机上运行的金字塔应用程序未打开 SQLAlchemy 创建的 JSON

覆盖我的Flask应用程序的Anaconda Launcher是否在本地主机上运行?

Facebook测试应用程序无法在本地主机上运行

在本地主机上开箱即用的 Angular 应用程序?

本地主机上的Mvc Facebook应用程序调试

尝试在本地主机上安装joomla时显示应用程序实例化错误

尝试打开Web应用程序时,Heroku给我503,可在本地主机上使用

-bash:错误的解释器:尝试在本地主机中运行flask应用程序时,没有此类文件或目录

将应用程序部署到Heroku会引发错误{path =“ /” path =“ / favicon.ico”}。但是在本地主机上运行

从移动设备访问时,在本地主机上运行的应用程序无法启用摄像头麦克风

Express JS-使用服务器端JS检查应用程序是否在本地主机上运行

在本地主机上运行时,我的C#应用程序间歇性地挂起

Django应用程序在Travis CI中失败:服务器未在本地主机上运行

grails应用程序不再允许我在本地主机上发送电子邮件