springboot项目启动不了卡住了

刘超 6天前 ⋅ 82 阅读   编辑

一、描述

  部署springboot项目,卡住了,如下

sdev@n-newads-test:~/software/dq/bin$ ./start-server.sh 
==========================================
Starting..., press `CRTL + C` to exit log
==========================================
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

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

2020-03-19 09:14:02.301  INFO 23336 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
2020-03-19 09:14:02.410  INFO 23336 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
2020-03-19 09:14:03.836  INFO 23336 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2020-03-19 09:14:03.836  INFO 23336 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet Engine: Apache Tomcat/8.5.32
2020-03-19 09:14:03.854  INFO 23336 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener   : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib]
2020-03-19 09:14:04.011  INFO 23336 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2020-03-19 09:14:04.076  INFO 23336 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]

  如上springboot项目没有启动完,这样持续好长时间啦

二、分析

  1、ps后,没找到启动后的进程,如下

sdev@n-newads-test:~/software/dq/bin$ ps -ef | grep dq
sdev     21872 21827  0 08:58 pts/6    00:00:00 tail -f /home/sdev/software/dq/logs/sys/dq.2020-03-19.log
sdev     23206 23161  0 09:12 pts/6    00:00:00 tail -f /home/sdev/software/dq/logs/sys/dq.2020-03-19.log
sdev     27074 16751  0 09:24 pts/6    00:00:00 grep --color=auto dq
sdev@n-newads-test:~/software/dq/bin$ 

  2、直接执行java -Dfile.encoding=UTF-8 -cp .:$DQ_HOME/lib/* dq.DQServerApplication命令,也不行

  3、在config中编写log4j-test.propertieslog4j-prod.properties

在application-test.properties文件中,指定log4j文件
  logging.config=
file:${DQ_HOME}/config/log4j-test.properties


在application-prod.properties文件中,指定log4j文件
  logging.config=file:${DQ_HOME}/config/log4j-prod.properties

  4、打印出来具体日志,知道是数据库连接问题,修改连接配置

三、解决方法

  先打印出具体日志,然后根据日志再做对应处理


注意:本文归作者所有,未经作者允许,不得转载

全部评论: 0

    我有话说: