Cannot determine embedded database driver class for database type NONE
今天有个小程序打算用spring boot重构,从其他项目复制过来配置后,启动报错
***************************
APPLICATION FAILED TO START
***************************
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).
看报错,是没有数据库DataSource配置了,但是哪里会调用呢,检查后发现是pom文件里,依赖了mybatis
<dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>${mybatis.version}</version> </dependency>把mybatis依赖删除,更新项目后 ,再次启动,成功。具体原因后续研究,可能启动spring boot的时候,mybatis会初始化数据库连接吧