当前位置:
首页 >
行业知识 >
解决SpringBoot+MyBatisPlus 报错Property ‘sqlSessionFactory‘ or ‘sqlSessionTemplate‘ are required
行业知识
解决SpringBoot+MyBatisPlus 报错Property ‘sqlSessionFactory‘ or ‘sqlSessionTemplate‘ are required
2026-11-03 05:59:48
来源:互联网转载
报错原因:SpringBoot 与 MyBatis Plus版本不匹配!
解决方法:
把SpringBoot版本改为v3.1.6 同时 MyBatis Plus版本改为3.5.3!
1. 打开项目的pom.xml文件。修改springboot的版本号,如下图:
2. 修改MyBatis Plus及其相关组件的版本号,如图:
3. 附上我的pom.xml代码:
4.0.0org.springframework.bootspring-boot-starter-parent3.1.6 com.examplesmartmine0.0.1-SNAPSHOTsmartmineDemo project for Spring Boot17org.springframework.bootspring-boot-starter-weborg.springframework.bootspring-boot-starter-web-servicescom.mysqlmysql-connector-jruntime com.baomidou mybatis-plus-boot-starter 3.5.3 com.baomidoumybatis-plus3.5.3com.baomidoumybatis-plus-generator3.3.0org.apache.velocityvelocity-engine-core2.3org.springframework.bootspring-boot-starter-testtest com.alibaba fastjson 1.2.59 org.projectlombok lombok true org.springframework.bootspring-boot-maven-plugin org.projectlombok lombok src/main/java **/*.yml **/*.properties **/*.xml false src/main/resources **/*.yml **/*.properties **/*.xml false lib **/*.jar
上一篇:期货开户套利都有哪些类型
下一篇:电脑怎么连接网络的服务器?