繁体   English   中英

无法运行 spring 引导应用程序?

[英]Cant run spring boot application?

我正在与一个团队一起完成一项任务。 我的团队决定为应用程序使用 spring 引导。 但是由于某种原因,每当我运行应用程序时,我的终端上都会收到不同的消息,而我的队友在他们的终端上会收到不同的消息。 而不是“LiveReload 服务器正在端口 35729 上运行”,而是“使用端口 8081 (http) 初始化的 tomcat”。

我不确定到底该怎么做,因为我们所有人都在使用同一个项目,而且我已经按照他们告诉我的方式构建了它。

但是它仍然不适合我。 谁能告诉我如何修复它,以便我可以让它运行。 我以前从未使用过 maven 或 spring 引导。

这是我在终端上收到的消息

2020-06-13 23:05:35.538  INFO 34396 --- [  restartedMain] com.rest.WebApplication           : Starting WebApplication on DESKTOP-1M4A445 with PID 34396 (Directory\project\target\classes started by USER in Directory/project)


2020-06-13 23:05:35.543  INFO 34396 --- [  restartedMain] com.rest.WebApplication           : No active profile set, falling back to default profiles: default


2020-06-13 23:05:35.609  INFO 34396 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable


2020-06-13 23:05:36.520  INFO 34396 --- [  restartedMain] o.s.b.d.a.OptionalLiveReloadServer       : LiveReload server is running on port 35729


2020-06-13 23:05:36.550  INFO 34396 --- [  restartedMain] com.rest.WebApplication           : Started WebApplication in 1.452 seconds (JVM running for 2.035)

Process finished with exit code 0

太感谢了。

看来您在类路径中有spring-boot-devtools依赖项。 因此,您会看到LiveReload server is running on port 35729语句写入日志。

从您的日志来看,似乎 tomcat 根本没有启动。 验证您的属性文件并确保 web 环境未关闭

  • 对于 spring-boot 1.x,查找spring.main.web-environment=false属性
  • 对于 spring-boot 2.x,查找spring.main.web-application-type=none属性

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM