本文主要是介绍已解决:org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
解决了困扰一天的问题
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'app': Unsatisfied dependency expressed through constructor parameter 0;
nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userDoMapper' defined in file [D:\javaworkspace\record\target\classes\com\recordproject\dao\UserDoMapper.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 [D:\javaworkspace\record\target\classes\mapping\UserDoMapper.xml]';
nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.recordproject.dao.UserDoMapper.BaseResultMap
解决方式:将mapping中自动生成的代码删掉,然后重新运行mybatis-generator生成新的代码即可解决问题
这篇关于已解决:org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!