Spring Boot 启动报错 Cannot determine embedded database driver class for database type NONE
来源:互联网 发布:mysql join on关键词 编辑:程序博客网 时间:2024/06/10 02:11
最近刚接触Spring Boot ,但是启动的时候总是报错,错误信息如下:
***************************APPLICATION FAILED TO START***************************Description:Cannot determine embedded database driver class for database type NONEAction: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).
在网上查了相关信息,说是:
springboot默认是需要datasource的,如果你没有配置datasource就会报上面的错误,可以考虑配置一个又或者可以在Appliation启动类去掉自动加载
的:
- 项目是否有用到数据库???
- 检查数据库配置;
- 检查数据库驱动程序;
需要在启动类的@EnableAutoConfiguration或@SpringBootApplication中添加exclude= {DataSourceAutoConfiguration.class},排除此类的autoconfig。
但是上述解决办法并不能解决我这次问题,项目中确实用到了数据库,数据库也正确配置,数据库驱动也正常引用:
pom:
<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-devtools</artifactId><optional>true</optional> </dependency> <dependency><groupId>org.mybatis.spring.boot</groupId><artifactId>mybatis-spring-boot-starter</artifactId><version>1.3.0</version></dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.38</version></dependency>
application.properties:
logging.path=./logslogging.level.com.favorites=DEBUGlogging.level.org.springframework.web=DEBUGlogging.level.org.hibernate=DEBUGlogging.level.com.apm.report.mapper=DEBUGspring.datasource.name=namespring.datasource.url=****spring.datasource.username=***spring.datasource.password=***spring.datasource.type=com.alibaba.druid.pool.DruidDataSourcespring.datasource.driver-class-name=com.mysql.jdbc.Driverspring.datasource.max-idle=10spring.datasource.max-wait=10000spring.datasource.min-idle=5spring.datasource.initial-size=5检查以上都没有问题,后来经过慢慢摸索,才发现项目发布的时候application.properties文件不能发布上去,在pom.xml文件中配置:
<build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId></plugin></plugins><resources><resource><directory>src/main/resources</directory></resource></resources></build>
之后,项目就能正常启动,在此做个记录,希望能帮到需要的人。
阅读全文
0 0
- Spring Boot启动报错:Cannot determine embedded database driver class for database type NONE
- Spring Boot 启动报错 Cannot determine embedded database driver class for database type NONE
- spriing boot 启动报错:Cannot determine embedded database driver class for database type NONE
- spriing boot 启动报错:Cannot determine embedded database driver class for database type NONE
- spriing boot 启动报错:Cannot determine embedded database driver class for database type NONE
- spriing boot 启动报错:Cannot determine embedded database driver class for database type NONE
- Spring boot 报错:Cannot determine embedded database driver class for database type NONE
- Spring Boot启动问题:Cannot determine embedded database driver class for database type NONE
- springBoot启动报错Cannot determine embedded database driver class for database type NONE
- springboot 启动报错:Cannot determine embedded database driver class for database type NONE
- SpringBoot启动报错Cannot determine embedded database driver class for database type NONE
- SpringBoot启动报错(Cannot determine embedded database driver class for database type NONE)
- springboot启动报错--Cannot determine embedded database driver class for database type NONE
- 深入Spring Boot:怎样排查 Cannot determine embedded database driver class for database type NONE
- SpringBoot常见问题(一)--启动报错(Cannot determine embedded database driver class for database type NONE)
- Cannot determine embedded database driver class for database type NONE
- Cannot determine embedded database driver class for database type NONE
- Cannot determine embedded database driver class for database type NONE
- JavaWeb设置服务器启动加载文件
- 以下是我学习和使用leaflet gis等看过的好文章或网站,特此记录一下
- 基础练习 矩形面积交
- validateJarFile jar not loaded
- nginx php-fpm file not found错误
- Spring Boot 启动报错 Cannot determine embedded database driver class for database type NONE
- IDEA搭建Springboot
- 用canvas实现鼠标拖动绘制矩形框
- 数据缺失的中文字符串
- 【数据平台】pandas按条件去重
- 通过先序和中序数组生成后序数组
- MBG(Mybatis generator)自动生成sql语句
- spring通过注解配置Bean
- 41. First Missing Positive