SpringBoot项目启动遇到的问题记录

#先说结论:mapper.xml文件中,有两个select语句的id重复了!




G:\Java8\JDK\bin\java.exe -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true "-javaagent:D:\IntelliJ\IntelliJ IDEA 2018.3.5\lib\idea_rt.jar=6213:D:\IntelliJ\IntelliJ IDEA 2018.3.5\bin" -Dfile.encoding=UTF-8 -classpath G:\Java8\JDK\jre\lib\charsets.jar;G:\Java8\JDK\jre\lib\deploy.jar;G:\Java8\JDK\jre\lib\ext\access-bridge-64.jar;G:\Java8\JDK\jre\lib\ext\cldrdata.jar;G:\Java8\JDK\jre\lib\ext\dnsns.jar;G:\Java8\JDK\jre\lib\ext\jaccess.jar;G:\Java8\JDK\jre\lib\ext\jfxrt.jar;G:\Java8\JDK\jre\lib\ext\localedata.jar;G:\Java8\JDK\jre\lib\ext\nashorn.jar;G:\Java8\JDK\jre\lib\ext\sunec.jar;G:\Java8\JDK\jre\lib\ext\sunjce_provider.jar;G:\Java8\JDK\jre\lib\ext\sunmscapi.jar;G:\Java8\JDK\jre\lib\ext\sunpkcs11.jar;G:\Java8\JDK\jre\lib\ext\zipfs.jar;G:\Java8\JDK\jre\lib\javaws.jar;G:\Java8\JDK\jre\lib\jce.jar;G:\Java8\JDK\jre\lib\jfr.jar;G:\Java8\JDK\jre\lib\jfxswt.jar;G:\Java8\JDK\jre\lib\jsse.jar;G:\Java8\JDK\jre\lib\management-agent.jar;G:\Java8\JDK\jre\lib\plugin.jar;G:\Java8\JDK\jre\lib\resources.jar;G:\Java8\JDK\jre\lib\rt.jar;E:\Springs\springboot\springcloud\springcloud-provider-dept-8001\target\classes;E:\Springs\springboot\springcloud\springcloud-api\target\classes;E:\IntelliJ\maven-repository\org\projectlombok\lombok\1.16.10\lombok-1.16.10.jar;E:\IntelliJ\maven-repository\junit\junit\4.12\junit-4.12.jar;E:\IntelliJ\maven-repository\org\hamcrest\hamcrest-core\2.1\hamcrest-core-2.1.jar;E:\IntelliJ\maven-repository\org\hamcrest\hamcrest\2.1\hamcrest-2.1.jar;E:\IntelliJ\maven-repository\mysql\mysql-connector-java\5.1.47\mysql-connector-java-5.1.47.jar;E:\IntelliJ\maven-repository\com\alibaba\druid\1.1.10\druid-1.1.10.jar;E:\IntelliJ\maven-repository\ch\qos\logback\logback-core\1.2.3\logback-core-1.2.3.jar;E:\IntelliJ\maven-repository\org\mybatis\spring\boot\mybatis-spring-boot-starter\1.3.2\mybatis-spring-boot-starter-1.3.2.jar;E:\IntelliJ\maven-repository\org\springframework\boot\spring-boot-starter\2.2.5.RELEASE\spring-boot-starter-2.2.5.RELEASE.jar;E:\IntelliJ\maven-repository\org\springframework\boot\spring-boot-starter-logging\2.2.5.RELEASE\spring-boot-starter-logging-2.2.5.RELEASE.jar;E:\IntelliJ\maven-repository\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar;E:\IntelliJ\maven-repository\org\apache\logging\log4j\log4j-to-slf4j\2.12.1\log4j-to-slf4j-2.12.1.jar;E:\IntelliJ\maven-repository\org\apache\logging\log4j\log4j-api\2.12.1\log4j-api-2.12.1.jar;E:\IntelliJ\maven-repository\org\slf4j\jul-to-slf4j\1.7.30\jul-to-slf4j-1.7.30.jar;E:\IntelliJ\maven-repository\jakarta\annotation\jakarta.annotation-api\1.3.5\jakarta.annotation-api-1.3.5.jar;E:\IntelliJ\maven-repository\org\springframework\spring-core\5.2.4.RELEASE\spring-core-5.2.4.RELEASE.jar;E:\IntelliJ\maven-repository\org\springframework\spring-jcl\5.2.4.RELEASE\spring-jcl-5.2.4.RELEASE.jar;E:\IntelliJ\maven-repository\org\yaml\snakeyaml\1.25\snakeyaml-1.25.jar;E:\IntelliJ\maven-repository\org\springframework\boot\spring-boot-starter-jdbc\2.2.5.RELEASE\spring-boot-starter-jdbc-2.2.5.RELEASE.jar;E:\IntelliJ\maven-repository\com\zaxxer\HikariCP\3.4.2\HikariCP-3.4.2.jar;E:\IntelliJ\maven-repository\org\slf4j\slf4j-api\1.7.30\slf4j-api-1.7.30.jar;E:\IntelliJ\maven-repository\org\springframework\spring-jdbc\5.2.4.RELEASE\spring-jdbc-5.2.4.RELEASE.jar;E:\IntelliJ\maven-repository\org\springframework\spring-tx\5.2.4.RELEASE\spring-tx-5.2.4.RELEASE.jar;E:\IntelliJ\maven-repository\org\mybatis\spring\boot\mybatis-spring-boot-autoconfigure\1.3.2\mybatis-spring-boot-autoconfigure-1.3.2.jar;E:\IntelliJ\maven-repository\org\mybatis\mybatis\3.4.6\mybatis-3.4.6.jar;E:\IntelliJ\maven-repository\org\mybatis\mybatis-spring\1.3.2\mybatis-spring-1.3.2.jar;E:\IntelliJ\maven-repository\org\springframework\boot\spring-boot-test\2.2.5.RELEASE\spring-boot-test-2.2.5.RELEASE.jar;E:\IntelliJ\maven-repository\org\springframework\boot\spring-boot\2.2.5.RELEASE\spring-boot-2.2.5.RELEASE.jar;E:\IntelliJ\maven-repository\org\springframework\spring-context\5.2.4.RELEASE\spring-context-5.2.4.RELEASE.jar;E:\IntelliJ\maven-repository\org\springframework\boot\spring-boot-starter-web\2.2.5.RELEASE\spring-boot-starter-web-2.2.5.RELEASE.jar;E:\IntelliJ\maven-repository\org\springframework\boot\spring-boot-starter-json\2.2.5.RELEASE\spring-boot-starter-json-2.2.5.RELEASE.jar;E:\IntelliJ\maven-repository\com\fasterxml\jackson\core\jackson-databind\2.10.2\jackson-databind-2.10.2.jar;E:\IntelliJ\maven-repository\com\fasterxml\jackson\core\jackson-annotations\2.10.2\jackson-annotations-2.10.2.jar;E:\IntelliJ\maven-repository\com\fasterxml\jackson\core\jackson-core\2.10.2\jackson-core-2.10.2.jar;E:\IntelliJ\maven-repository\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.10.2\jackson-datatype-jdk8-2.10.2.jar;E:\IntelliJ\maven-repository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.10.2\jackson-datatype-jsr310-2.10.2.jar;E:\IntelliJ\maven-repository\com\fasterxml\jackson\module\jackson-module-parameter-names\2.10.2\jackson-module-parameter-names-2.10.2.jar;E:\IntelliJ\maven-repository\org\springframework\boot\spring-boot-starter-tomcat\2.2.5.RELEASE\spring-boot-starter-tomcat-2.2.5.RELEASE.jar;E:\IntelliJ\maven-repository\org\apache\tomcat\embed\tomcat-embed-core\9.0.31\tomcat-embed-core-9.0.31.jar;E:\IntelliJ\maven-repository\org\apache\tomcat\embed\tomcat-embed-el\9.0.31\tomcat-embed-el-9.0.31.jar;E:\IntelliJ\maven-repository\org\apache\tomcat\embed\tomcat-embed-websocket\9.0.31\tomcat-embed-websocket-9.0.31.jar;E:\IntelliJ\maven-repository\org\springframework\boot\spring-boot-starter-validation\2.2.5.RELEASE\spring-boot-starter-validation-2.2.5.RELEASE.jar;E:\IntelliJ\maven-repository\jakarta\validation\jakarta.validation-api\2.0.2\jakarta.validation-api-2.0.2.jar;E:\IntelliJ\maven-repository\org\hibernate\validator\hibernate-validator\6.0.18.Final\hibernate-validator-6.0.18.Final.jar;E:\IntelliJ\maven-repository\org\jboss\logging\jboss-logging\3.4.1.Final\jboss-logging-3.4.1.Final.jar;E:\IntelliJ\maven-repository\com\fasterxml\classmate\1.5.1\classmate-1.5.1.jar;E:\IntelliJ\maven-repository\org\springframework\spring-web\5.2.4.RELEASE\spring-web-5.2.4.RELEASE.jar;E:\IntelliJ\maven-repository\org\springframework\spring-beans\5.2.4.RELEASE\spring-beans-5.2.4.RELEASE.jar;E:\IntelliJ\maven-repository\org\springframework\spring-webmvc\5.2.4.RELEASE\spring-webmvc-5.2.4.RELEASE.jar;E:\IntelliJ\maven-repository\org\springframework\spring-aop\5.2.4.RELEASE\spring-aop-5.2.4.RELEASE.jar;E:\IntelliJ\maven-repository\org\springframework\spring-expression\5.2.4.RELEASE\spring-expression-5.2.4.RELEASE.jar;E:\IntelliJ\maven-repository\org\springframework\boot\spring-boot-starter-jetty\2.2.5.RELEASE\spring-boot-starter-jetty-2.2.5.RELEASE.jar;E:\IntelliJ\maven-repository\jakarta\servlet\jakarta.servlet-api\4.0.3\jakarta.servlet-api-4.0.3.jar;E:\IntelliJ\maven-repository\jakarta\websocket\jakarta.websocket-api\1.1.2\jakarta.websocket-api-1.1.2.jar;E:\IntelliJ\maven-repository\org\eclipse\jetty\jetty-servlets\9.4.26.v20200117\jetty-servlets-9.4.26.v20200117.jar;E:\IntelliJ\maven-repository\org\eclipse\jetty\jetty-continuation\9.4.26.v20200117\jetty-continuation-9.4.26.v20200117.jar;E:\IntelliJ\maven-repository\org\eclipse\jetty\jetty-http\9.4.26.v20200117\jetty-http-9.4.26.v20200117.jar;E:\IntelliJ\maven-repository\org\eclipse\jetty\jetty-util\9.4.26.v20200117\jetty-util-9.4.26.v20200117.jar;E:\IntelliJ\maven-repository\org\eclipse\jetty\jetty-io\9.4.26.v20200117\jetty-io-9.4.26.v20200117.jar;E:\IntelliJ\maven-repository\org\eclipse\jetty\jetty-webapp\9.4.26.v20200117\jetty-webapp-9.4.26.v20200117.jar;E:\IntelliJ\maven-repository\org\eclipse\jetty\jetty-xml\9.4.26.v20200117\jetty-xml-9.4.26.v20200117.jar;E:\IntelliJ\maven-repository\org\eclipse\jetty\jetty-servlet\9.4.26.v20200117\jetty-servlet-9.4.26.v20200117.jar;E:\IntelliJ\maven-repository\org\eclipse\jetty\jetty-security\9.4.26.v20200117\jetty-security-9.4.26.v20200117.jar;E:\IntelliJ\maven-repository\org\eclipse\jetty\jetty-server\9.4.26.v20200117\jetty-server-9.4.26.v20200117.jar;E:\IntelliJ\maven-repository\org\eclipse\jetty\websocket\websocket-server\9.4.26.v20200117\websocket-server-9.4.26.v20200117.jar;E:\IntelliJ\maven-repository\org\eclipse\jetty\websocket\websocket-common\9.4.26.v20200117\websocket-common-9.4.26.v20200117.jar;E:\IntelliJ\maven-repository\org\eclipse\jetty\websocket\websocket-api\9.4.26.v20200117\websocket-api-9.4.26.v20200117.jar;E:\IntelliJ\maven-repository\org\eclipse\jetty\websocket\websocket-client\9.4.26.v20200117\websocket-client-9.4.26.v20200117.jar;E:\IntelliJ\maven-repository\org\eclipse\jetty\jetty-client\9.4.26.v20200117\jetty-client-9.4.26.v20200117.jar;E:\IntelliJ\maven-repository\org\eclipse\jetty\websocket\websocket-servlet\9.4.26.v20200117\websocket-servlet-9.4.26.v20200117.jar;E:\IntelliJ\maven-repository\org\eclipse\jetty\websocket\javax-websocket-server-impl\9.4.26.v20200117\javax-websocket-server-impl-9.4.26.v20200117.jar;E:\IntelliJ\maven-repository\org\eclipse\jetty\jetty-annotations\9.4.26.v20200117\jetty-annotations-9.4.26.v20200117.jar;E:\IntelliJ\maven-repository\org\eclipse\jetty\jetty-plus\9.4.26.v20200117\jetty-plus-9.4.26.v20200117.jar;E:\IntelliJ\maven-repository\org\ow2\asm\asm\7.2\asm-7.2.jar;E:\IntelliJ\maven-repository\org\ow2\asm\asm-commons\7.2\asm-commons-7.2.jar;E:\IntelliJ\maven-repository\org\ow2\asm\asm-tree\7.2\asm-tree-7.2.jar;E:\IntelliJ\maven-repository\org\ow2\asm\asm-analysis\7.2\asm-analysis-7.2.jar;E:\IntelliJ\maven-repository\org\eclipse\jetty\websocket\javax-websocket-client-impl\9.4.26.v20200117\javax-websocket-client-impl-9.4.26.v20200117.jar;E:\IntelliJ\maven-repository\org\mortbay\jasper\apache-el\8.5.49\apache-el-8.5.49.jar;E:\IntelliJ\maven-repository\org\springframework\boot\spring-boot-devtools\2.2.5.RELEASE\spring-boot-devtools-2.2.5.RELEASE.jar;E:\IntelliJ\maven-repository\org\springframework\boot\spring-boot-autoconfigure\2.2.5.RELEASE\spring-boot-autoconfigure-2.2.5.RELEASE.jar com.example.springcloud.DeptProvider_8001 . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v2.2.5.RELEASE) Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2020-09-14 21:58:50.713 ERROR 6684 --- [ restartedMain] o.s.boot.SpringApplication : Application run failed org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'deptController': Unsatisfied dependency expressed through field 'deptService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'deptServiceImpl': Unsatisfied dependency expressed through field 'deptDao'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'deptDao' defined in file [E:\Springs\springboot\springcloud\springcloud-provider-dept-8001\target\classes\com\example\springcloud\Dao\DeptDao.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:\Springs\springboot\springcloud\springcloud-provider-dept-8001\target\classes\mybatis\mapper\DeptMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'file [E:\Springs\springboot\springcloud\springcloud-provider-dept-8001\target\classes\mybatis\mapper\DeptMapper.xml]'. Cause: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for com.example.springcloud.Dao.DeptDao.queryDept at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:643) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:130) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1422) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:879) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878) ~[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) ~[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) ~[spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) [spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) [spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE] at com.example.springcloud.DeptProvider_8001.main(DeptProvider_8001.java:11) [classes/:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_212] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_212] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_212] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_212] at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [spring-boot-devtools-2.2.5.RELEASE.jar:2.2.5.RELEASE] Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'deptServiceImpl': Unsatisfied dependency expressed through field 'deptDao'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'deptDao' defined in file [E:\Springs\springboot\springcloud\springcloud-provider-dept-8001\target\classes\com\example\springcloud\Dao\DeptDao.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:\Springs\springboot\springcloud\springcloud-provider-dept-8001\target\classes\mybatis\mapper\DeptMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'file [E:\Springs\springboot\springcloud\springcloud-provider-dept-8001\target\classes\mybatis\mapper\DeptMapper.xml]'. Cause: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for com.example.springcloud.Dao.DeptDao.queryDept at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:643) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:130) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1422) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1287) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1207) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:640) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] ... 24 common frames omitted Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'deptDao' defined in file [E:\Springs\springboot\springcloud\springcloud-provider-dept-8001\target\classes\com\example\springcloud\Dao\DeptDao.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:\Springs\springboot\springcloud\springcloud-provider-dept-8001\target\classes\mybatis\mapper\DeptMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'file [E:\Springs\springboot\springcloud\springcloud-provider-dept-8001\target\classes\mybatis\mapper\DeptMapper.xml]'. Cause: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for com.example.springcloud.Dao.DeptDao.queryDept at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1526) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1406) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1287) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1207) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:640) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] ... 37 common frames omitted Caused by: 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:\Springs\springboot\springcloud\springcloud-provider-dept-8001\target\classes\mybatis\mapper\DeptMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'file [E:\Springs\springboot\springcloud\springcloud-provider-dept-8001\target\classes\mybatis\mapper\DeptMapper.xml]'. Cause: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for com.example.springcloud.Dao.DeptDao.queryDept at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:656) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:636) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1338) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1177) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:557) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1287) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1207) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1511) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] ... 48 common frames omitted Caused by: 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:\Springs\springboot\springcloud\springcloud-provider-dept-8001\target\classes\mybatis\mapper\DeptMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'file [E:\Springs\springboot\springcloud\springcloud-provider-dept-8001\target\classes\mybatis\mapper\DeptMapper.xml]'. Cause: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for com.example.springcloud.Dao.DeptDao.queryDept at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:651) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] ... 61 common frames omitted Caused by: org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [E:\Springs\springboot\springcloud\springcloud-provider-dept-8001\target\classes\mybatis\mapper\DeptMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'file [E:\Springs\springboot\springcloud\springcloud-provider-dept-8001\target\classes\mybatis\mapper\DeptMapper.xml]'. Cause: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for com.example.springcloud.Dao.DeptDao.queryDept at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:523) ~[mybatis-spring-1.3.2.jar:1.3.2] at org.mybatis.spring.SqlSessionFactoryBean.afterPropertiesSet(SqlSessionFactoryBean.java:380) ~[mybatis-spring-1.3.2.jar:1.3.2] at org.mybatis.spring.SqlSessionFactoryBean.getObject(SqlSessionFactoryBean.java:547) ~[mybatis-spring-1.3.2.jar:1.3.2] at org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration.sqlSessionFactory(MybatisAutoConfiguration.java:153) ~[mybatis-spring-boot-autoconfigure-1.3.2.jar:1.3.2] at org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration$$EnhancerBySpringCGLIB$$4bb2dfc0.CGLIB$sqlSessionFactory$0(<generated>) ~[mybatis-spring-boot-autoconfigure-1.3.2.jar:1.3.2] at org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration$$EnhancerBySpringCGLIB$$4bb2dfc0$$FastClassBySpringCGLIB$$d2f5869b.invoke(<generated>) ~[mybatis-spring-boot-autoconfigure-1.3.2.jar:1.3.2] at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) ~[spring-core-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331) ~[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration$$EnhancerBySpringCGLIB$$4bb2dfc0.sqlSessionFactory(<generated>) ~[mybatis-spring-boot-autoconfigure-1.3.2.jar:1.3.2] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_212] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_212] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_212] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_212] at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] ... 62 common frames omitted Caused by: org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'file [E:\Springs\springboot\springcloud\springcloud-provider-dept-8001\target\classes\mybatis\mapper\DeptMapper.xml]'. Cause: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for com.example.springcloud.Dao.DeptDao.queryDept at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:120) ~[mybatis-3.4.6.jar:3.4.6] at org.apache.ibatis.builder.xml.XMLMapperBuilder.parse(XMLMapperBuilder.java:92) ~[mybatis-3.4.6.jar:3.4.6] at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:521) ~[mybatis-spring-1.3.2.jar:1.3.2] ... 75 common frames omitted Caused by: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for com.example.springcloud.Dao.DeptDao.queryDept at org.apache.ibatis.session.Configuration$StrictMap.put(Configuration.java:872) ~[mybatis-3.4.6.jar:3.4.6] at org.apache.ibatis.session.Configuration$StrictMap.put(Configuration.java:844) ~[mybatis-3.4.6.jar:3.4.6] at org.apache.ibatis.session.Configuration.addMappedStatement(Configuration.java:668) ~[mybatis-3.4.6.jar:3.4.6] at org.apache.ibatis.builder.MapperBuilderAssistant.addMappedStatement(MapperBuilderAssistant.java:302) ~[mybatis-3.4.6.jar:3.4.6] at org.apache.ibatis.builder.xml.XMLStatementBuilder.parseStatementNode(XMLStatementBuilder.java:109) ~[mybatis-3.4.6.jar:3.4.6] at org.apache.ibatis.builder.xml.XMLMapperBuilder.buildStatementFromContext(XMLMapperBuilder.java:135) ~[mybatis-3.4.6.jar:3.4.6] at org.apache.ibatis.builder.xml.XMLMapperBuilder.buildStatementFromContext(XMLMapperBuilder.java:128) ~[mybatis-3.4.6.jar:3.4.6] at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:118) ~[mybatis-3.4.6.jar:3.4.6] ... 77 common frames omitted Process finished with exit code 0

最后发现是在mapper.xml文件中,有两个select语句的id重复了!

posted @ 2020-09-14 22:03  一去二三浪里小白龙  阅读(477)  评论(0编辑  收藏  举报
//增加一段JS脚本,为目录生成使用