spring boot启动的时候抛出如下异常:

dataSource' defined in class path resource [org/springframework/boot/autocon

 
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).

这是因为spring boot 会默认加载

org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration 这个类
 

DataSourceAutoConfiguration类使用了@Configuration注解向spring注入了dataSource bean。因为工程中没有关于dataSource相关的配置信息,当spring创建dataSource bean因缺少相关的信息就会报错。

解决办法发是:

在Application类上增加

@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})
 

dataSource' defined in class path resource [org/springframework/boot/autocon的更多相关文章

  1. Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method fail

    SpringBoot 单元测试报错 @RunWith(SpringRunner.class) @SpringBootTest public class ProductCategoryRepositor ...

  2. Error creating bean with name 'persistenceExceptionTranslationPostProcessor' defined in class path resource [org/springframework/boot/autoconfigure/dao/PersistenceExceptionTranslationAutoConfiguration

    dubbo 包和SpringBoot 冲突,注释就可以正常启动

  3. MyBatis笔记----(2017年)最新的报错:Cannot find class [org.apache.commons.dbcp.BasicDataSource] for bean with name 'dataSource' defined in class path resource [com/ij34/mybatis/applicationContext.xml]; nested e

    四月 05, 2017 4:56:11 下午 org.springframework.context.support.ClassPathXmlApplicationContext prepareRef ...

  4. Invalid bean definition with name 'dataSource' defined in class path resource [applicationContext.xml]

    启动tomcat,访问一个web项目失败,查看日志,发现异常信息: 18-Jul-2019 15:22:16.822 严重 [main] org.apache.catalina.core.Standa ...

  5. Cannot find class [org.apache.commons.dbcp.BasicDataSource] for bean with name 'dataSource' defined in class path resource [applicationContext.xml]

    Cannot find class [org.apache.commons.dbcp.BasicDataSource] for bean with name 'dataSource' defined ...

  6. A bean with that name has already been defined in class path resource [org/springframework/transaction/annotation/ProxyTransactionManagementConfiguration.class] and overriding is disabled

    2019-12-19 13:26:17.594 WARN [main] o.s.boot.web.servlet.context.AnnotationConfigServletWebServerApp ...

  7. 启动zuul时候报错:The bean 'proxyRequestHelper', defined in class path resource [org/springframework/cloud/netflix/zuul

    启动zuul时候报错:The bean 'proxyRequestHelper', defined in class path resource [org/springframework/cloud/ ...

  8. 报Error creating bean with name 'dataSource' defined in class path resource 报错解决办法

    在学习spring boot 的数据库操作的时候,报了一串错误 对于初学spring boot的我来说,英语水平低,看不懂报错的信息,给我造成了很大的麻烦,花了我一天的时间,经过不懈的努力后终于让我找 ...

  9. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [app2.xml]: Instantiation of bean failed; nested exception is org.spr

    在学习spring整合hubernate时遇到的问题.c3p0遇到了一个问题,老连不上,显示java.lang.NoClassDefFoundError:com.mchange.v2.ser.Indi ...

随机推荐

  1. WebService完成文件上传下载

    由于开发需要使用webservice,第一个接触的工具叫axis2.项目开发相关jar下载. service端: 启动类: import java.net.InetAddress; import ja ...

  2. PDF上添加水印

    1.整合jar: itext-asian-5.2.0.jar,itextpdf-5.5.10.jar,iTextAsianCmaps.jar 下载:itext的整合jar包 2.使用方法: publi ...

  3. set和multiset容器

    set和multiset容器的能力 set 和multiset容器的内部结构通常由平衡二叉树(balanced binary tree)来实现.当元素放入容器中时,会按照一定的排序法则自动排序,默认是 ...

  4. c++中stl----vector

    1 vector是啥玩意 (1)可以使用下标访问个别的元素 (2)迭代器可以按照不同的方式遍历 (3)可以在容器的末尾增加或者删除元素 2 容器大小和容器的容量区别 (1)大小是元素的个数,容量是分配 ...

  5. 多叉树结构:JSON数据解析(二)

    多叉树结构:JSON数据解析(二) 在上篇文章中提到了JSON数据解析的基本方法,但是方法效率太低,这里接着上篇文章写写如何利用多叉树结构,定义对象,实现JSON数据字段快速随机访问. JSON数据通 ...

  6. 3、webpack打包出的文件解析

    分析打包后的结果,看看打包后的结果是什么东西 把打包后的结果.注释什么的删删‘’ 当前是一个匿名函数. 默认的时候会执行,执行的时候会传一个对象,对象有几部分,第一部分是我们的key.第二部分是我们的 ...

  7. jquery操作select(option)的取值,设置和选中

    比如 <select class="selector"> <option value ="volvo">Volvo</option ...

  8. VC++11 编译中的一些问题的解决办法

    1.  vc++ 的编译器的错误往往定位在错误的那一处,但是那一处可能在库的底层,而我们知道库,一般都不会错. 这时候应该好好看看我们自己的头文件是否正确,有可能头文件中的一些错误引发了连锁反应. 2 ...

  9. uoj#269. 【清华集训2016】如何优雅地求和(数论)

    传送门 首先,如果\(f(x)=1\),那么根据二项式定理,有\(Q(f,n,k)=1\) 当\(f(x)=x\)的时候,有\[Q=\sum_{i=0}^ni\times \frac{n!}{i!(n ...

  10. C 语言实例 - 删除字符串中的特殊字符

    C 语言实例 - 删除字符串中的特殊字符 C 语言实例 C 语言实例 删除字符串中的除字母外的字符. 实例 #include<stdio.h> int main() { ]; int i, ...