springBoot應用啟動時卡住不動


  今天從gitee上拉取了一個springboot項目,啟動了一半發現一直卡着不動

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.0.0.RELEASE)

2020-10-19 15:37:23 INFO  [main] com.xxx.xxx.ErpApplication - Starting ErpApplication on DESKTOP-QARM8NJ with PID 11428 (E:\xxx\xxx\)
2020-10-19 15:37:23 DEBUG [main] com.xxx.xxx.ErpApplication - Running with Spring Boot v2.0.0.RELEASE, Spring v5.0.4.RELEASE
2020-10-19 15:37:23 INFO  [main] com.xxx.xxx.ErpApplication - No active profile set, falling back to default profiles: default
 _ _   |_  _ _|_. ___ _ |    _ 
| | |\/|_)(_| | |_\  |_)||_|_\ 
     /               |         
                        3.0.7.1 
2020-10-19 15:37:27 INFO  [main] com.xxx.xxx.ErpApplication - Started ErpApplication in 4.742 seconds (JVM running for 6.091)

 

  接着在啟動類的main方法中加入了這么一段代碼

1 public static void main(String[] args) {
2     System.out.println("---start---");
3     SpringApplication.run(ErpApplication.class, args);
4     System.out.println("---end---");
5 }

  

  輸出如下

---start---

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.0.0.RELEASE)

2020-10-19 15:53:39 INFO  [main] com.xxx.xxx.ErpApplication - Starting ErpApplication on DESKTOP-QARM8NJ with PID 183242020-10-19 15:53:39 DEBUG [main] com.xxx.xxx.ErpApplication - Running with Spring Boot v2.0.0.RELEASE, Spring v5.0.4.RELEASE
2020-10-19 15:53:39 INFO  [main] com.xxx.xxx.ErpApplication - No active profile set, falling back to default profiles: default
 _ _   |_  _ _|_. ___ _ |    _ 
| | |\/|_)(_| | |_\  |_)||_|_\ 
     /               |         
                        3.0.7.1 
2020-10-19 15:53:43 INFO  [main] com.xxx.xxx.ErpApplication - Started ErpApplication in 4.693 seconds (JVM running for 6.038)
---end---

 

  運行到這里說明程序是已經啟動了的,接着我在去訪問項目地址並成功的訪問到了,這里就先不貼圖了。

  問題原因:應該是日志配置的問題,隨后找到logback的xml文件,這里我起初也不是特別熟悉的,一點一點研究下來之后發現root標簽中的level級別是ERROR級別,隨后我更改為INFO級別之后重啟服務,問題得到解決,看到了啟動的一大堆日志輸出

  

  

  解決幫助來源於:https://blog.csdn.net/aero_duan/article/details/94595775

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM