springboot使用德鲁伊DruidDataSource数据源启动报Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0
这个问题纯属细节问题,但是错误提示太模糊所有找不好找.在命令行中查看异常信息会发现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相关推荐
- 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 ...
- 记录一次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 ...
- 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- ...
- 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) ...
- 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- ...
- 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 ...
- 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 ...
- Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0:exec
在划线处取消打勾,恢复正常. 要说也是搞笑,第一天出了org.springframework.boot.web.embedded.tomcat不存在的错误,把这个打勾给解决了,结果第二天项目又运行不起 ...
- mvn package 报Failed to execute goal
pom.xml添加failOnNoGitDirectory false属性
最新文章
- 暗时间:开发效率为何如此低下
- 读书笔记《如何阅读一本书》之二
- List集合中两种遍历方式
- DataGrid 完全攻略之二(把数据导出到Excel)
- Codeforces Round #658 (Div. 2)
- 索尼等日系厂商集体推超低价笔记本
- Log4j.xml配置日志按级别过滤并将指定级别的日志发送到ActiveMQ
- 无惧海量并发,运维准点下班全靠它
- datatables 配套bootstrap样式使用小结(2) ajax篇
- OSPF:STUB与NSSA区别
- java编程窗口在哪里下载_EeJava下载
- 华为智慧屏云会议怎么操作_会议室预定系统有哪些?怎么操作
- 数组 spark_spark——rdd常用的转化和行动操作
- 关于java.lang.ClassNotFoundException
- HTML5查看CAD图纸,看cad图纸软件(DwgSee)怎么打印Cad图纸?
- 联想r720自带杜比驱动下载_5499起!联想YOGA家族四款新品预售开启!-联想 ——快科技(驱动之家旗下媒体)-...
- 项目工时估算PERT法
- Python网络爬虫:下载漫画的正确姿势
- Thunderbird 邮件签名三个实现方式
- 2022-12-05 新希望六和 一面笔试 (面经六)