springboot启动自动停止

springboot启动自动停止,第1张

springboot项目启动后自动停止,也引入了jar包

<dependency>
   <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
</dependency>

但是启动仍然自动停止,怎么搞?
在启动类上增加捕获异常并打印日志

 public static void main(String[] args) {
        try{
            SpringApplication.run(CpspServiceApplication.class, args);
        }catch (Exception ex){
            log.info("启动报错{}",ex);
        }
    }

这样没有打印的错误信息就打印出来了

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/langs/721531.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-04-25
下一篇2022-04-25

发表评论

登录后才能评论

评论列表(0条)

    保存