这个问题纯属细节问题,但是错误提示太模糊所有找不好找.在命令行中查看异常信息会发现Unsatisfied dependency expressed through field 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource': Invocation of init method failed; nested exception is java.lang.NullPointerException 这个错误.

还有在启动日志中有ERROR 6616 --- [           main] com.alibaba.druid.pool.DruidDataSource   : {dataSource-1} init error.

我的理解是bean创建错误,所有一开始我以为是我这个方法哪里错了,但是怎么看都没问题,上网搜了一大堆找不到跟我类似的.后来我将数据源缓存commons-dbcp的,这提示明显了,提示要注入的bean找不到,上网搜了,就看了一个词才恍然大悟,[扫描].原来是没有将该类的包纳入到扫描器注解,将包加到扫描器,问题解决.数据源换成德鲁伊的也没问题了.

回想起来觉得看视频学习还是建议视频保持一致吧,我是看着视频做的,选择才想起来视频的老师是将扫描类放到前面去了(其他包都是它的子包),我一开始为了试试ComponentScan注解的basePackages参数所以将扫描类跟控制器分开了.视频中没见他配置扫描包,所以他做一切正常,就出问题.

springboot使用德鲁伊DruidDataSource数据源启动报Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0相关推荐

  1. ruoyi-cloud 服务器端idea启动报错Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:exec (defau

    ruoyi-cloud 服务器端idea启动报错Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:exec (defau ...

  2. 记录一次wagon报错Failed to execute goal org.codehaus.mojo:wagon-maven-plugin:1.0:upload-single

    记录一次wagon报错Failed to execute goal org.codehaus.mojo:wagon-maven-plugin:1.0:upload-single (default-cl ...

  3. Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0

    1.问题描述 利用maven导包,运行Mybatis案例的main函数时报错. [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven- ...

  4. Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0:exec (defau-cli) on project

    @[TOC](Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0:exec (defau-cli) on project) ...

  5. Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:exec (default-cli) on project

    Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:exec (default-cli) on project sp03- ...

  6. IDEA运行test出现 Failed to execute goal org.codehaus.mojo:exec-maven-plugin:16.0.0:exec (default-cli) on

    IDEA运行test出现 Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:exec (default-cli) on ...

  7. Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.1.0:exe问题解决

    解决:Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0:exec (default-cli) on project sp ...

  8. Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0:exec

    在划线处取消打勾,恢复正常. 要说也是搞笑,第一天出了org.springframework.boot.web.embedded.tomcat不存在的错误,把这个打勾给解决了,结果第二天项目又运行不起 ...

  9. mvn package 报Failed to execute goal

    pom.xml添加failOnNoGitDirectory false属性

最新文章

  1. 暗时间:开发效率为何如此低下
  2. 读书笔记《如何阅读一本书》之二
  3. List集合中两种遍历方式
  4. DataGrid 完全攻略之二(把数据导出到Excel)
  5. Codeforces Round #658 (Div. 2)
  6. 索尼等日系厂商集体推超低价笔记本
  7. Log4j.xml配置日志按级别过滤并将指定级别的日志发送到ActiveMQ
  8. 无惧海量并发,运维准点下班全靠它
  9. datatables 配套bootstrap样式使用小结(2) ajax篇
  10. OSPF:STUB与NSSA区别
  11. java编程窗口在哪里下载_EeJava下载
  12. 华为智慧屏云会议怎么操作_会议室预定系统有哪些?怎么操作
  13. 数组 spark_spark——rdd常用的转化和行动操作
  14. 关于java.lang.ClassNotFoundException
  15. HTML5查看CAD图纸,看cad图纸软件(DwgSee)怎么打印Cad图纸?
  16. 联想r720自带杜比驱动下载_5499起!联想YOGA家族四款新品预售开启!-联想 ——快科技(驱动之家旗下媒体)-...
  17. 项目工时估算PERT法
  18. Python网络爬虫:下载漫画的正确姿势
  19. Thunderbird 邮件签名三个实现方式
  20. 2022-12-05 新希望六和 一面笔试 (面经六)

热门文章

  1. Java 集合框架系列,总结性全文,解决你所有困惑
  2. android webview 刷新当前页面,Android WebView时重新加载导致页面刷新的问题
  3. 软考中级,【软件评测师】经验分享
  4. SVN服务端的安装配置(ubuntu18.01)
  5. 全球最赚钱的十款游戏,你玩过吗?
  6. 怎样才能画好动漫洛丽塔服装?
  7. python时间日期格式,python日期时间格式化
  8. 错觉图片生成实验 - 会动的吃豆人
  9. 老虎国际季报图解:营收5263万美元 持续国际化布局
  10. c语言程序设计 出圈游戏,出圈游戏程序及设计.doc