前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >spring 解决 Cannot determine embedded database driver class for database type NONE

spring 解决 Cannot determine embedded database driver class for database type NONE

作者头像
潇洒
发布2023-10-20 12:24:03
1620
发布2023-10-20 12:24:03
举报
文章被收录于专栏:石头岛石头岛

问题

新项目搭建时,项目启不来,报了一个错。

Description: Cannot determine embedded database driver class for database type NONE Action: If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).

处理方式一: 排除两个默认配置

排除两个默认配置

代码语言:javascript
复制
@SpringBootApplication(exclude={DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class})
public class Application {

}

结论:没用

处理方式二:可行

网上说各种多于的依赖导至的问题,通过IDEA查看jar依赖,确实是。 由 pagehelper 这个依赖引起的。

代码语言:javascript
复制
<!--<dependency>-->
    <!--<groupId>org.hibernate</groupId>-->
    <!--<artifactId>hibernate-validator</artifactId>-->
    <!--<version>4.2.0.Final</version>-->
<!--</dependency>-->
<!--<dependency>-->
    <!--<groupId>org.mybatis.spring.boot</groupId>-->
    <!--<artifactId>mybatis-spring-boot-starter</artifactId>-->
    <!--<version>1.1.1</version>-->
<!--</dependency>-->

<!--pagehelper-->
<!--<dependency>-->
    <!--<groupId>com.github.pagehelper</groupId>-->
    <!--<artifactId>pagehelper-spring-boot-starter</artifactId>-->
    <!--<version>1.1.2</version>-->
<!--</dependency>-->
<!--<dependency>-->
    <!--<groupId>mysql</groupId>-->
    <!--<artifactId>mysql-connector-java</artifactId>-->
    <!--<version>5.1.21</version>-->
<!--</dependency>-->

总结

程序启动类不需要排除任务一个类,只需要去除引用却可。

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2018-05-24,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 问题
  • 处理方式一: 排除两个默认配置
  • 处理方式二:可行
  • 总结
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档