java.lang.IllegalStateException: No typehandler found for property xxx


今天遇到一个很傻逼的问题,在一个功能点的mapper里插入以下代码后,另一个平行功能点报错,报错信息如下:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'BaseattachBusiness': Unsatisfied dependency expressed through field 'tbBaseAttachService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'TbBaseAttachService': Unsatisfied dependency expressed through field 'tbBaseAttachMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'tbBaseAttachMapper' defined in file [C:\Users\99043\Desktop\yunong-cloud\yunong-gap-common\target\classes\com\yun\cloud\gap\dao\TbBaseAttachMapper.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 [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.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 [C:\Users\99043\Desktop\yunong-cloud\yunong-gap-common\target\classes\mapper\TbEmployeeTrainingRecordMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalStateException: No typehandler found for property trainingUrls

一时间把我和我的小伙伴整蒙了,没办法我只能硬着头皮分析
image-20210802170347156

之后根据异常的嵌套关系,我定位到实际引发错误的是以下语句:java.lang.IllegalStateException: No typehandler found for property trainingUrls,并且产生bug的文件为[C:\Users\99043\Desktop\yunong-cloud\yunong-gap-common\target\classes\mapper\TbEmployeeTrainingRecordMapper.xml]。发现的确是trainingUrls字段在添加时出现了纰漏:

image-20210802170943740

于是我改为CHAR类型后点击debug,两手一摊准备抖jio,却不想问题并没有解决:

image-20210802171136779

显然,尽管我把trainingUrls字段的jdbcType改成了"CHAR",还并不能解决问题,那就肯定是Dto出了问题,果然,修改一下:

image-20210802173141379

问题解决。

image-20210802174723361


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM