attempted to return null from_unable to process jar entry

大家好,又见面了,我是你们的朋友全栈君。

**

Springboot启动时报错 If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.

产生这个错误的原因是springboot的自动配置,如果你没有配置DataSource就会导致下图这个错误

如果你是要连数据库的话那就在yml或properties文件下配置数据库的账户密码地址

不想连接数据库的话有以下解决方案
解决方案1

@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)//排除自动配置
public class ErukaServerMain { 
   
    public static void main(String[] args) { 
   
        SpringApplication.run(ErukaServerMain.class,args);
    }
}

解决方案2
如果以上方法不行那就,将pom文件带有数据库相关的删除,例如:jdbc、mysql-connect等等

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/190495.html原文链接:https://javaforall.cn

未经允许不得转载:木盒主机 » attempted to return null from_unable to process jar entry

赞 (0)

相关推荐

    暂无内容!