在idea运行springboot项目时,idea报错:Process finished with exit code 1,并且无任何提示
在这里插入图片描述
排错方法:
在启动类中加入try catch对错误进行拦截展示
在这里插入图片描述
代码如下

 public static void main(String[] args) {
        try {
        SpringApplication.run(xxxxApplication.class, args);
        } catch (Throwable e) {
            //异常级别越大越好,我之前测试的时候,用的是Exception,但是没有日志。
            e.printStackTrace();
        }

看到错误后便可根据对应的错误进行排查

Logo

一站式 AI 云服务平台

更多推荐