记录一个关于@Mapper注解无效@MapperScan注解出错的问题

记录一个困扰我很久的问题

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'convertFileMapper' defined in file [D:\Documents\Desktop\ending\backstage-graduation\target\classes\com\fanr\graduation\mapper\ConvertFileMapper.class]: Invocation of init method failed; nested exception is java.lang.NullPointerException

这张数据库表是用easycode自动生成的各层代码,其中启动的时候就会报错

A component required a bean of type 'com.fanr.graduation.mapper.ConvertFileMapper' that could not be found.

这里提示的这个错是说扫描不到mapper包,但是我在convertFileMapper下已经使用了@Mapper注解,没有用,只能在启动类上加@MapperScan();

@MapperScan(value = {"com.fanr.graduation.mapper"})

这里应该是我的jar包版本冲突的问题,我没有深究,但是,现在就出现了根本的问题

Error creating bean with name 'convertFileMapper' defined in file [D:\Documents\Desktop\ending\backstage-graduation\target\classes\com\fanr\graduation\mapper\ConvertFileMapper.class]: Invocation of init method failed; nested exception is java.lang.NullPointerException

到此为止还是没有找到相应的解决办法,我现在尝试将这张表的各层代码都重写一遍,因为只有这张表出现了问题,还不确定有什么问题,

好烦呀!!!

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值