简体   繁体   English

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

[英]Cant run spring boot application?

I'm working on an assignment with a team.我正在与一个团队一起完成一项任务。 And my team decided to use spring boot for the application.我的团队决定为应用程序使用 spring 引导。 However for some reason whenever I run the application I get a different message on my terminal whereas my teammates have a different message on their terminal.但是由于某种原因,每当我运行应用程序时,我的终端上都会收到不同的消息,而我的队友在他们的终端上会收到不同的消息。 Instead of "LiveReload server is running on port 35729" They get "tomcat initialized with port(s) 8081 (http)".而不是“LiveReload 服务器正在端口 35729 上运行”,而是“使用端口 8081 (http) 初始化的 tomcat”。

I am not sure what exactly to do since all of us are using the same project and I have built it as they told me to do so.我不确定到底该怎么做,因为我们所有人都在使用同一个项目,而且我已经按照他们告诉我的方式构建了它。

However it is still not working for me.但是它仍然不适合我。 Can anybody tell me how to fix it so I could get it to run.谁能告诉我如何修复它,以便我可以让它运行。 I have never used maven or spring boot before.我以前从未使用过 maven 或 spring 引导。

This is the message I am getting on my terminal这是我在终端上收到的消息

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

Thank you so much.太感谢了。

It seems you have spring-boot-devtools dependency in the classpath.看来您在类路径中有spring-boot-devtools依赖项。 Because of this you see LiveReload server is running on port 35729 statement written to log.因此,您会看到LiveReload server is running on port 35729语句写入日志。

From your logs, it seems tomcat is not started at all.从您的日志来看,似乎 tomcat 根本没有启动。 Verify your properties files and make sure web environment is not turned off验证您的属性文件并确保 web 环境未关闭

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

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

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