springBoot应用启动时卡住不动

JAVA学习网 2020-10-19 23:34:01

  今天从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

 

阅读(2583) 评论(0)