啟動(dòng)報(bào)錯(cuò) 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
2020-12-20
問(wèn)題已經(jīng)解決,自己在generatorConfig.xml 中配置了兩個(gè)不同的table,一個(gè)不用的table? 生成了pojo,mapper以及*mapper.xml,但是項(xiàng)目中沒(méi)有引用無(wú)用的table,所以報(bào)錯(cuò),在? generatorConfig.xml 除去那個(gè)無(wú)用的table即可。
除去: