簡體   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