Unsatisfied dependency expressed through method 'shirFilter' parameter 0 异常排查

 最近在sprootboot的项目中将使用mybatisplus框架中的代码生成模块中,执行完代码生成程序以后,运行程序后报一下错误:org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'shirFilter' defined in class path resource [com/mingqi/author/shiro/config/ShiroConfig.class]: Unsatisfied dependency expressed through method 'shirFilter' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'securityManager' defined in class path resource [com/mingqi/author/shiro/config/ShiroConfig.class]: Unsatisfied dependency expressed through method 'getDefaultWebSecurityManager' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'bdpUserRealm': Unsatisfied dependency expressed through field 'isAuUserService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.mingqi.author.service.impl.SAuUserServiceImpl': Unsatisfied dependency expressed through field 'baseMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'SAuUserMapper' defined in URL [jar:file:/D:/maven/repository/com/mingqi/framework/author/2.0.4/author-2.0.4.jar!/com/mingqi/author/dao/SAuUserMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [com/baomidou/mybatisplus/autoconfigure/MybatisPlusAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [D:\work\Service\target\classes\mapper\ReviewtitleTalBatchMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'file [D:\work\Service\target\classes\mapper\ReviewtitleTalBatchMapper.xml]'. Cause: java.lang.IllegalStateException: No typehandler found for property batchcontext

刚开始一直以为是文件名和框架jar包中封装类的名字重复了或者是类的名称和mapper中的xml的文件不一致导致的,检查了一遍又一遍,还是没有发现问题。最后知道无意间看到了Cause: java.lang.IllegalStateException: No typehandler found for property batchcontext 这句话,大致的意思是说找不到属性的类型处理程序,然后我就在ReviewtitleTalBatchMapper.xml这个文件中找到了batchcontext 这个属性:

 

 去对应的ReviewtitleTalBatch 实体类中看了一下他的类型为:Blob,如下图(该类型由代码生成器自动生成的,为oracle数据库中的大字段的类型):

 

 在Java中没有这个类型,尝试将该类型修改为String,同时修改对应的get和set方法,然后重新启动项目,启动成功。

 

posted @ 2021-04-27 16:39  心有玲曦遇奇缘  阅读(4652)  评论(0编辑  收藏  举报