SpringBoot項目啟動失敗,沒有任何錯誤資訊的解決方案
前言
參考連結:
https://blog.csdn.net/shangjianli/article/details/99681359解決方案
SpringBoot項目啟動失敗,控制台中沒有任何錯誤資訊提示,可以在 SpringBoot 啟動類中添加 try...catch 即可,
package top.simba1949;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* @Author Simba1949
* @Date 2019/11/29 16:29
*/
@Slf4j
@SpringBootApplication
public class Application {
public static void main(String[] args) {
try {
SpringApplication.run(Application.class, args);
} catch (Exception e) {
e.printStackTrace();
// (推薦)如果項目中存在日志架構,可以通過日志架構列印
log.debug("the exception is {}", e.getMessage(), e);
}
}
}