• 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:workService argetclassesmapperReviewtitleTalBatchMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'file [D:workService argetclassesmapperReviewtitleTalBatchMapper.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方法,然后重新启动项目,启动成功。

  • 相关阅读:
    SpringBoot入门
    VUE 监听局部滚动 设置ICON的位置跟随
    手机端页面调试工具-vconsole使用
    js获取字符串字节的位数
    判断数据为[] {} /空数组或空对象
    Vue axios 上传图片
    Vue触发input选取文件点击事件
    腾讯地图添加多个Marker
    VUE-CLI 设置页面title
    小程序wxml文件引用方式
  • 原文地址:https://www.cnblogs.com/mingqi-420/p/14706523.html
Copyright © 2020-2023  润新知