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. 网页元素定位Position

     第九章: 网页元素定位Position position属性 static:默认值,没有定位 relative:相对定位 absolute:绝对定位 fixed:固定定位  (一般不用) stati ...

  2. 玲珑OJ1088【蜜汁尺取】

    前言(膜法): 早上10点多开始膜的,然后到中午交了一发,感觉膜法不对啊!然后就兴起小窗了一发管理员,然后管理员给我发了in,out数据...可是太大并没有什么可取性... 还是自己试,然后发现自己搞 ...

  3. POJ3737【数学】

    高中数学题?初中吧///然后注意一下POJ的double输出用%f.......... #include <iostream> #include <stdio.h> #incl ...

  4. Oculus Rift, HTC Vive, SONY PSVR的全面对比

    http://blog.csdn.net/xoyojank/article/details/50927572 这次有幸参加了GDC 2016, 终于把三大设备体验了个遍, 也试玩了很多不错的VR游戏. ...

  5. Node.js 自定义模块

    Node.js内置多个模块,也可以使用第三方模块,今天学习一下如何使用自己定义的模块 在同级目录下定义两个js文件 第一个:custom1.js "use strict"; fun ...

  6. IT兄弟连 JavaWeb教程 JSP语法

    在JSP页面中,脚本标识使用的最为频繁,因为他们能够方便.灵活地生成页面中的动态内容,特别是JSP程序代码块.JSP中的脚本标识包括3部分,即JSP声明区.JSP表达式和JSP程序代码块.通过这些标识 ...

  7. NSString 是否存在空格

    NSString *_string = [NSString stringWithFormat:@"123 456"]; NSRange _range = [_string rang ...

  8. 受保护的封装 protected

    补充内容:封装 私有化封装 private受保护的封装 protected公共的封装 public 注意:python目前不支持设定受保护的成员,但是开发者由约定的使用方式 受保护的封装:在成员名称前 ...

  9. iOS 利用模态视图实现带黑色蒙版的底部弹窗

    本demo仅适用于iOS8及以上系统. 本文将使用autolayout+storyboard来实现弹窗 第一步.storyboard创建界面 1.打开storyboard 拖一个UIViewcontr ...

  10. Cordova/Cordova.h file not found的解决方法

    参考http://stackoverflow.com/questions/10714600/cdvplugin-h-file-not-found-in-cordova-as-component-cle ...