SpringBoot+MyBatis整合报错Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
项目启动的时候报这个错误,这个问题我百度了一天,果然不出意外的还是没能解决,其中有一篇文章相对来说还是有点用的:https://blog.csdn.net/qq8693/article/details/86166953,但是上面的方法解决不了我的这个问题(我已经全部试过了)。
现在把我的解决方式贴出来分享一下:
其实很简单,就是把springboot的版本降下来
原本我的版本是这个:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
降版本后变成了:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.1.RELEASE</version>
<relativePath/>
</parent>
莫名就解决了这个问题,具体原因我也不太清楚,当然了降版本是会出现版本冲突的,所以需要将maven仓库将相应的springboot版本包删掉,我是把E:\maven\maven_store\org\springframework下面的全部删了,然后都重新maven update一次
项目启动的时候会报有些包找不到,就去相应的路径下删掉包,重新下,项目就可以成功启动了
SpringBoot+MyBatis整合报错Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required的更多相关文章
- spring boot 2.0.0 + mybatis 报:Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
spring boot 2.0.0 + mybatis 报:Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required 无法启动 ...
- springboot整合mybatis的时候报错Caused by: java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
今天闲来无事,学习springboot整合mybatis,在bilibili看视频学的,视频中在dao层的interface上面加上org.apache.ibatis.annotations.Mapp ...
- Caused by: java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required [ IDEA mybatis项目报错 ]
今天笔者用Springboot框架整合Mybatis做一个小小的项目: 代码写完,在运行项目时,IDEA给我报了3处错误: org.springframework.beans.factory.Unsa ...
- Springboot 2.0.4 整合Mybatis出现异常Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
在使用Springboot 2.0.4 整合Mybatis的时候出现异常Property 'sqlSessionFactory' or 'sqlSessionTemplate' are require ...
- springmvc与mybatis整合时 java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required 异常
今天在整合springmvc与mybatis时,启动服务器遇到这样一个问题, by: java.lang.IllegalArgumentException: Property 'sqlSessionF ...
- 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 ...
- 使用 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 ...
- Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'e ...
- spring和mybatis整合报错:org.springframework.beans.MethodInvocationException: Property 'dataSource' threw exception; nested exception is java.lang.NoClassDefFoundError
Exception in thread "main" org.springframework.beans.factory.UnsatisfiedDependencyExceptio ...
随机推荐
- 如何消灭飞机的“黑色十分钟”,AI来帮忙
近年来,“AI的应用和落地”逐渐成了具化的关键词,它和很多事物很多行业结合在一起,形成了奇妙的“化学反应”.例如,在日常生活中,AI可以推送我们喜欢的新闻或视频,可以在拍照的时候识别场景提升照片的美感 ...
- css中的名词
用到的单词 current 当前 hover 悬停 selected 挑选 disabled 禁用 focus 得到焦点 blur 失去焦点 checked 勾选 success 成功 error 出 ...
- raw目录的位置是D:\android_projects\qrscan\app\src\main\res\raw
D:\android_projects\qrscan\app\src\main\res\raw 这里可以放数据库文件和音频文件 文件名为sp.mp3 引用方法: MediaPlayer mp = Me ...
- Android实现QQ登录
https://www.jianshu.com/p/e59bc198e88f
- Tkinter经典写法
1.继承 tkinter.Frame 类,实现类的基本写法 2.创建主窗口及主窗口大小位置及标题 3.将需要添加的组件放入到类中进行创建, 继承的 Frame 类需要使用 master 参数作为父类的 ...
- Python List insert()方法
描述 insert() 函数用于将指定对象插入列表的指定位置.高佣联盟 www.cgewang.com 语法 insert()方法语法: list.insert(index, obj) 参数 inde ...
- PHP substr_compare() 函数
实例 比较两个字符串: <?php高佣联盟 www.cgewang.comecho substr_compare("Hello world","Hello worl ...
- 新手程序员求职简历缺少这 3 点!别说8k薪资,4K你可能都拿不到!
制作一份简历可能需要八百到千字,但HR看简历的时间只不过短短十秒,甚至可以说是一目十行. 我想针对想做程序员的刚毕业的学生分享着一点自己在求职招聘方面的感悟,不针对工作了多年的老同志了.快毕业那会儿, ...
- SpringBoot之多模块项目
SpringBoot之多模块项目 说明:我们通过maven的父子工程来搭建springboot的多模块项目** 项目的整体结构 本项目涉及了到了五个模块 framework-web模块主要是放置前端的 ...
- Jenkins总结2-部署maven项目
1. 部署Maven项目 1.1 新建项目 选择新建任务 输入任务名称,并选择构建一个Maven项目.如果你的页面没有看到“构建一个maven项目”,则需要安装Maven Integration插件. ...