Spring Boot运行发生异常:Factory method 'dataSource' threw exception; nested exception is org.springframe

异常:

 Caused by: org.springframework.beans.BeanInstantiationException:
 Failed to instantiate [org.apache.tomcat.jdbc.pool.DataSource]: 
 Factory method 'dataSource' threw exception; 
 nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: 
 Cannot determine embedded database driver class for database type NONE. 
 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).


原因:

 maven依赖包冲突,有重复的依赖。


解决:

Spring Boot运行发生异常:Factory method 'dataSource' threw exception; nested exception is org.springframe_第1张图片

Spring Boot运行发生异常:Factory method 'dataSource' threw exception; nested exception is org.springframe_第2张图片

   在启动类的@EnableAutoConfiguration添加exclude = {DataSourceAutoConfiguration.class},排除此类的autoconfig。启动以后就可以正常运行。



 


你可能感兴趣的:(Spring,Boot)