SpringBoot org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean wit

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/ming_ruo_xiao_xi/article/details/85229522

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘app’: Unsatisfied dependency expressed through field ‘mUserDOMapper’; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘userDOMapper’ defined in file [E:\SpringBootProject\test\target\classes\com\springbootproject\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 [E:\SpringBootProject\test\target\classes\mapping\UserPasswordDoMapper.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.springbootproject.dao.UserPasswordDoMapper.BaseResultMap

可能是因为 使用Mybatis-generator插件生成了重复的DoMapper.xml的代码,检查代码删掉即可

修改参考mybatis-generator重新生成代码时的SQL映射文件覆盖

猜你喜欢

转载自blog.csdn.net/ming_ruo_xiao_xi/article/details/85229522