Mybatis-Plus 版本问题包引用问题导致 BeanDefinitionStoreException

详细异常内容:

nested exception is java.lang.IllegalStateException: Could not evaluate condition on de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration due to org/springframework/boot/bind/RelaxedPropertyResolver not found. Make sure your own configuration does not rely on that class. This can also happen if you are @ComponentScanning a springframework package (e.g. if you put a @ComponentScan in the default package by mistake)

博主 mybatis-plus 版本:3.1.2

网上大部分问题原因:

1.检查xml文件所在package名称 
2.xxxDao的方法在xxxDao.xml中没有,然后执行xxxxDao的方法会报此xxxDao的方法返回值是List,而select元素没有正确配置ResultMap,或者只配置ResultType! 如果你确认没有以上问题,请任意修改下对应的xml文件,比如删除一个空行,保存.问题解决。
3.看下mapper的XML配置路径是否正确

( 不建议去有xml,毕竟 mybatis-plus为简化开发存在 )

问题原因:

  1. 官方解释 代码import问题

详细说明:

问题1:
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
@Service
public class DemoServiceImpl...

问题2:
import com.baomidou.mybatisplus.mapper.BaseMapper;
public interface DemoMapper extends BaseMapper<Demo> { ....

问题3:
import com.baomidou.mybatisplus.service.IService;
public interface DemoService extends IService<Demo> {......

解决办法,去除引入supper类内的包,更新为以下代码:

解决1:
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@Service
public class DemoServiceImpl...

解决1:
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface DemoMapper extends BaseMapper<Demo> { ....

解决1:
import com.baomidou.mybatisplus.extension.service.IService;
public interface DemoService extends IService<Demo> {......

最后大家要注意,因为版本的升级需要修改默认method,例如:

selectOne 变更为: getOne
EntityWrapper 变更为: QueryWrapper
insert 变更为: save....
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值