为了账号安全,请及时绑定邮箱和手机立即绑定

启动报错 Error creating bean with name 'myBatisCRUDController'

2020-12-20 17:15:58.592  WARN 12008 --- [  restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'myBatisCRUDController': Unsatisfied dependency expressed through field 'userService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userServiceImpl': Unsatisfied dependency expressed through field 'userMapper'; nested exception is

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sysUserMapper' defined in file [F:\xiangmu3\Xin\FuQiang\Springboot_1\download_resource\SpringbootDemo\demo\demo\target\classes\com\example\demo\mapper\SysUserMapper.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 [tk/mybatis/mapper/autoconfigure/MapperAutoConfiguration.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 [F:\xiangmu3\Xin\FuQiang\Springboot_1\download_resource\SpringbootDemo\demo\demo\target\classes\mapper\AaaMapper.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.example.demo.mapper.AaaMapper.BaseResultMap
2020-12-20 17:15:58.599  INFO 12008 --- [  restartedMain] com.alibaba.druid.pool.DruidDataSource   : {dataSource-1} closed
2020-12-20 17:15:58.605  INFO 12008 --- [  restartedMain] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2020-12-20 17:15:58.628  INFO 12008 --- [  restartedMain] ConditionEvaluationReportLoggingListener :

...
Disconnected from the target VM, address: '127.0.0.1:14700', transport: 'socket'

Process finished with exit code 0

正在回答

1 回答

问题已经解决,自己在generatorConfig.xml 中配置了两个不同的table,一个不用的table  生成了pojo,mapper以及*mapper.xml,但是项目中没有引用无用的table,所以报错,在  generatorConfig.xml 除去那个无用的table即可。

除去:

<table tableName="aaa"></table>


0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
SpringBoot开发常用技术整合
  • 参与学习       102149    人
  • 解答问题       507    个

SpringBoot 极简开发的框架整合利器

进入课程

启动报错 Error creating bean with name 'myBatisCRUDController'

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信