Unsatisfieddependencyexpressedthroughmethodsh。。。最近在sprootboot的项⽬中将使⽤mybatisplus框架中的代码⽣成模块中,执⾏完代码⽣成程序以后,运⾏程序后报⼀下错误:
springframework jar包下载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/mingq
i/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
NestedIOException: Failed to parse mapping resource: 'file
[D:\work\Service\target\classes\l]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'file [D:\work\Service\target\classes\l]'. Cause: java.lang.IllegalStateException: No typehandler found for property batchcontext
刚开始⼀直以为是⽂件名和框架jar包中封装类的名字重复了或者是类的名称和mapper中的xml的⽂件不⼀致导致的,检查了⼀遍⼜⼀遍,还是没有发现问题。最后知道⽆意间看到了Cause: java.lang.IllegalStateException: No typehandler found for property batchcontext 这句话,⼤致的意思是说不到属性的类型处理程序,然后我就在l这个⽂件中到了batchcontext 这个属性:
去对应的ReviewtitleTalBatch 实体类中看了⼀下他的类型为:Blob,如下图(该类型由代码⽣成器⾃动⽣成的,为oracle数据库中的⼤字段的类型):
在Java中没有这个类型,尝试将该类型修改为String,同时修改对应的get和set⽅法,然后重新启动项⽬,启动成功。

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。