Mybatis-Plus3.5.3.1 + SpringBoot3.1.0 遇到的问题

在Springboot3项目中使用Mybatis-Plus时遇到找不到mapper的问题,错误信息提示sqlSessionFactory或sqlSessionTemplate缺失。解决方案是通过自定义sqlSessionTemplate临时解决,或者添加mybatis-spring-boot-starter依赖至pom.xml。

springbooot3 + Mybatis-Plus出现的问题

找不到对应的mapper

sqlSessionFactory’ or ‘sqlSessionTemplate’ are required

Error creating bean with name ‘loraController’ defined in file [C:\Users\yanglechen\Desktop\code\tagUI\target\classes\com\ylc\tagui\controller\LoraController.class]: Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name ‘loraMapper’ defined in file [C:\Users\yanglechen\Desktop\code\tagUI\target\classes\com\ylc\tagui\mapper\LoraMapper.class]: Property ‘sqlSessionFactory’ or ‘sqlSessionTemplate’ are required

解决办法,可以自己实现 sqlSessionTemplate暂时解决一下。等支持了去掉就好了
或者在prm.xml中加入

        <dependency>
           <groupId>org.mybatis.spring.boot</groupId>
           <artifactId>mybatis-spring-boot-starter</artifactId>
           <version>3.0.0</version>
       </dependency>
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值