黑马 java.lang.IllegalArgumentException: Property ‘dataSource‘ is required
现象:
按照教程步骤做的,但连单元测试都无法通过,会出现java.lang.IllegalArgumentException: Property ‘dataSource’ is required这个错误。
原因:
通过看错误提示怀疑是properties文件没有被加载进来,仔细检测发现路径没有写错。后面发现是版本不一样导致的,我一不小心升级成了2021.3版本,创建javaEE的过程和视频中的不一样,工程结构也不一样。
解决办法:
在用Jdbc访问数据库时,视频中是将druid.properties文件配置到src文件夹下时;2021.3版本是放到src/main/resources文件夹下。这样才会在编译的时候在target文件夹下生成配置文件。
黑马 java.lang.IllegalArgumentException: Property ‘dataSource‘ is required的更多相关文章
- MyBatis与Spring MVC结合时,使用DAO注入出现:Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
错误源自使用了这个例子:http://www.yihaomen.com/article/java/336.htm,如果运行时会出现如下错误: Invocation of init method fai ...
- Caused by: java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required [ IDEA mybatis项目报错 ]
今天笔者用Springboot框架整合Mybatis做一个小小的项目: 代码写完,在运行项目时,IDEA给我报了3处错误: org.springframework.beans.factory.Unsa ...
- springboot整合mybatis的时候报错Caused by: java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
今天闲来无事,学习springboot整合mybatis,在bilibili看视频学的,视频中在dao层的interface上面加上org.apache.ibatis.annotations.Mapp ...
- 使用 Jenkins 打包成功后 运行 出现 Caused by: java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
linux 运行时 错误日志 Error starting ApplicationContext. To display the conditions report re-run your appli ...
- springmvc与mybatis整合时 java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required 异常
今天在整合springmvc与mybatis时,启动服务器遇到这样一个问题, by: java.lang.IllegalArgumentException: Property 'sqlSessionF ...
- springboot下Caused by: java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
已检查jar包是否引入 <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId ...
- java.lang.IllegalArgumentException: Attribute 'items' is required and must be a Collection, an Array or a Map
很有可能是涉及items的时候写成了item导致此错
- spring boot :error querying database. Cause: java.lang.IllegalArgumentException: dataSource or dataSourceClassName or jdbcUrl is required
配置多个数据源启动报错,error querying database. Cause: java.lang.IllegalArgumentException: dataSource or dataSo ...
- IDEA报错: Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'spring.datasource.url' in value "${spring.datasource.url}"
运行审核流模块: 在ActivitiServiceApplication模块日志报错: Error starting ApplicationContext. To display the auto-c ...
- java.lang.IllegalArgumentException: 'sessionFactory' or 'hibernateTemplate' is required
java.lang.IllegalArgumentException: 'sessionFactory' or 'hibernateTemplate' is required 严重: Exceptio ...
随机推荐
- unity 利用相机截图,可以截取UI,保存png格式,可用于签名抠图
public Camera cam; void Start() { StartCoroutine(CaptureAlphaCamera(cam,new Rect(0,0,1920,1080))); } ...
- mac上gitclone出现password: Permission denied, please try again.
问题在mac上拉取项目出现一下问题,然后我输入密码还是这样的提示. password: Permission denied, please try again.1分析解决情况1:git地址为http协 ...
- oss上传,阿里云上传oss,带缩略图
https://mp.weixin.qq.com/s/obL9JmzDYdkREEJIj_hVIQ 借用工具类 <dependency> <groupId>cn.xuyanwu ...
- liunx查看端口使用情况
netstat -ntlp //查看当前所有tcp端口
- LOOP GROUP BY 分组循环的使用方法小栗子
原文链接:https://blog.csdn.net/lmf496891416/article/details/111317377 1.格式: LOOP AT 内表 INTO DATA(工作区) GR ...
- Go实现KMP和Sunday算法
KMP 1 func KMP(str, substr string) int { 2 if substr == "" { 3 return 0 4 } 5 strLen := le ...
- 吴恩达老师机器学习课程chapter04——神经网络
吴恩达老师机器学习课程chapter04--神经网络 本文是非计算机专业新手的自学笔记,高手勿喷,欢迎指正与其他任何合理交流. 本文仅作速查备忘之用,对应吴恩达(AndrewNg)老师的机器学期课程第 ...
- Failed to download metadata for repo ‘appstream‘: Cannot prepare internal mirrorlist:...
大家都知道Centos8于2021年年底停止了服务,大家再在使用yum源安装时候,出现下面错误"错误:Failed to download metadata for repo 'AppStr ...
- Oracle.DataAccess使用问题汇总
1.使用参数化传参 先看一段sql select TABLE_COLUMN_NAME from CSV_PARA_MAPPING where TABLE_NAME = ':v_tabName' and ...
- notepad++ 编写html代码快捷键切换到浏览器查看
1.右键chrome属性,查看目标C:\Users\duanx\AppData\Local\Google\Chrome\Application\chrome.exe 2.然后notepad运行,输入如 ...