项目紧张的时候,大部分单元测试都是后期补充的,最近一个客户管理中心的项目进行时发现一个报错
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘customerService’: Unsatisfied dependency expressed through field ‘baseMapper’; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘crmCustomerMapper’ defined in file [C:\Users\hamish-wu\IdeaProjects\wk_crm_single\crm\target\classes\com\kakarote\crm\mapper\CrmCustomerMapper.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.s

本文探讨了在Spring Boot项目中遇到的单元测试期间,由于不允许访问外部DTD而引发的MyBatis报错。通过配置jaxp.properties解决访问权限问题,以及针对不同JDK版本的处理策略,最终确定为单元测试环境差异导致。
最低0.47元/天 解锁文章
938

被折叠的 条评论
为什么被折叠?



