当spring boot 启动失败,返回信息只有
Process finished with exit code 0
我们可以在启动的main函数加上异常捕获
try {
SpringApplication.run(TiangongSpringBootDemoApplication.class, args);
} catch (Exception e) {
e.printStackTrace();
log.error("the exception is {}", e);
}
本文介绍了一种在SpringBoot应用启动失败时的解决方案,通过在main函数中添加异常捕获,可以有效获取到详细的错误信息,帮助开发者快速定位问题。
4634

被折叠的 条评论
为什么被折叠?



