springboot启动直接停止只打印Process finished with exit code 1

  新建了一个springboot项目,从其他项目拷贝代码后,启动发现直接停止,只打印Process finished with exit code 1。

  网上搜了一下,也有类似的情况:

try {
  SpringApplication.run(Application.class, args);
}catch(Exception e) {
  e.printStackTrace();
}

  依然没有任何输出,需要把Exception换成Throwable

try {
  SpringApplication.run(Application.class, args);
}catch(Throwable e) {
  e.printStackTrace();
}

  网上其他人碰到的原因是: 打印出来真正的错误了,是一个 ClassDefNotFoundError。

  关于Process finished with exit code 1,还有人说是yml格式的问题,pom的问题会引起等等。  

       我这边的问题具体原因忘记了,但是通过打印出的异常可以轻松解决问题 。

       

原文地址:https://www.cnblogs.com/lnlvinso/p/14176009.html