美文网首页
spring-boot启动错误

spring-boot启动错误

作者: 5163f7c9561e | 来源:发表于2017-05-11 17:02 被阅读45次

启动springboot时候报错,错误内容为:

org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Cannot determine embedded database driverclassfordatabase type NONE. If you want an embedded database pleaseputa supported oneontheclasspath. If you have database settingstobe loadedfroma particular profile you may needtoactiveit(no profiles are currently active).  

错误原因:
不知道使用什么数据库,需要在pom.xml标注使用什么数据库,如h2
解决思路:
1.修改pom.xml

<dependency>
    <groupId>com.h2database</groupId>
    <artifactId>h2</artifactId>
    <scope>runtime</scope>
</dependency>

2.在@SpringBootApplication中排除其注入


@SpringBootApplication(exclude={DataSourceAutoConfiguration.class,HibernateJpaAutoConfiguration.class})

相关文章

网友评论

      本文标题:spring-boot启动错误

      本文链接:https://www.haomeiwen.com/subject/owootxtx.html