zoukankan      html  css  js  c++  java
  • SpringBoot项目启动遇到的问题记录

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




    G:Java8JDKinjava.exe -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true "-javaagent:D:IntelliJIntelliJ IDEA 2018.3.5libidea_rt.jar=6213:D:IntelliJIntelliJ IDEA 2018.3.5in" -Dfile.encoding=UTF-8 -classpath G:Java8JDKjrelibcharsets.jar;G:Java8JDKjrelibdeploy.jar;G:Java8JDKjrelibextaccess-bridge-64.jar;G:Java8JDKjrelibextcldrdata.jar;G:Java8JDKjrelibextdnsns.jar;G:Java8JDKjrelibextjaccess.jar;G:Java8JDKjrelibextjfxrt.jar;G:Java8JDKjrelibextlocaledata.jar;G:Java8JDKjrelibext ashorn.jar;G:Java8JDKjrelibextsunec.jar;G:Java8JDKjrelibextsunjce_provider.jar;G:Java8JDKjrelibextsunmscapi.jar;G:Java8JDKjrelibextsunpkcs11.jar;G:Java8JDKjrelibextzipfs.jar;G:Java8JDKjrelibjavaws.jar;G:Java8JDKjrelibjce.jar;G:Java8JDKjrelibjfr.jar;G:Java8JDKjrelibjfxswt.jar;G:Java8JDKjrelibjsse.jar;G:Java8JDKjrelibmanagement-agent.jar;G:Java8JDKjrelibplugin.jar;G:Java8JDKjrelib esources.jar;G:Java8JDKjrelib t.jar;E:Springsspringbootspringcloudspringcloud-provider-dept-8001 argetclasses;E:Springsspringbootspringcloudspringcloud-api argetclasses;E:IntelliJmaven-repositoryorgprojectlomboklombok1.16.10lombok-1.16.10.jar;E:IntelliJmaven-repositoryjunitjunit4.12junit-4.12.jar;E:IntelliJmaven-repositoryorghamcresthamcrest-core2.1hamcrest-core-2.1.jar;E:IntelliJmaven-repositoryorghamcresthamcrest2.1hamcrest-2.1.jar;E:IntelliJmaven-repositorymysqlmysql-connector-java5.1.47mysql-connector-java-5.1.47.jar;E:IntelliJmaven-repositorycomalibabadruid1.1.10druid-1.1.10.jar;E:IntelliJmaven-repositorychqoslogbacklogback-core1.2.3logback-core-1.2.3.jar;E:IntelliJmaven-repositoryorgmybatisspringootmybatis-spring-boot-starter1.3.2mybatis-spring-boot-starter-1.3.2.jar;E:IntelliJmaven-repositoryorgspringframeworkootspring-boot-starter2.2.5.RELEASEspring-boot-starter-2.2.5.RELEASE.jar;E:IntelliJmaven-repositoryorgspringframeworkootspring-boot-starter-logging2.2.5.RELEASEspring-boot-starter-logging-2.2.5.RELEASE.jar;E:IntelliJmaven-repositorychqoslogbacklogback-classic1.2.3logback-classic-1.2.3.jar;E:IntelliJmaven-repositoryorgapachelogginglog4jlog4j-to-slf4j2.12.1log4j-to-slf4j-2.12.1.jar;E:IntelliJmaven-repositoryorgapachelogginglog4jlog4j-api2.12.1log4j-api-2.12.1.jar;E:IntelliJmaven-repositoryorgslf4jjul-to-slf4j1.7.30jul-to-slf4j-1.7.30.jar;E:IntelliJmaven-repositoryjakartaannotationjakarta.annotation-api1.3.5jakarta.annotation-api-1.3.5.jar;E:IntelliJmaven-repositoryorgspringframeworkspring-core5.2.4.RELEASEspring-core-5.2.4.RELEASE.jar;E:IntelliJmaven-repositoryorgspringframeworkspring-jcl5.2.4.RELEASEspring-jcl-5.2.4.RELEASE.jar;E:IntelliJmaven-repositoryorgyamlsnakeyaml1.25snakeyaml-1.25.jar;E:IntelliJmaven-repositoryorgspringframeworkootspring-boot-starter-jdbc2.2.5.RELEASEspring-boot-starter-jdbc-2.2.5.RELEASE.jar;E:IntelliJmaven-repositorycomzaxxerHikariCP3.4.2HikariCP-3.4.2.jar;E:IntelliJmaven-repositoryorgslf4jslf4j-api1.7.30slf4j-api-1.7.30.jar;E:IntelliJmaven-repositoryorgspringframeworkspring-jdbc5.2.4.RELEASEspring-jdbc-5.2.4.RELEASE.jar;E:IntelliJmaven-repositoryorgspringframeworkspring-tx5.2.4.RELEASEspring-tx-5.2.4.RELEASE.jar;E:IntelliJmaven-repositoryorgmybatisspringootmybatis-spring-boot-autoconfigure1.3.2mybatis-spring-boot-autoconfigure-1.3.2.jar;E:IntelliJmaven-repositoryorgmybatismybatis3.4.6mybatis-3.4.6.jar;E:IntelliJmaven-repositoryorgmybatismybatis-spring1.3.2mybatis-spring-1.3.2.jar;E:IntelliJmaven-repositoryorgspringframeworkootspring-boot-test2.2.5.RELEASEspring-boot-test-2.2.5.RELEASE.jar;E:IntelliJmaven-repositoryorgspringframeworkootspring-boot2.2.5.RELEASEspring-boot-2.2.5.RELEASE.jar;E:IntelliJmaven-repositoryorgspringframeworkspring-context5.2.4.RELEASEspring-context-5.2.4.RELEASE.jar;E:IntelliJmaven-repositoryorgspringframeworkootspring-boot-starter-web2.2.5.RELEASEspring-boot-starter-web-2.2.5.RELEASE.jar;E:IntelliJmaven-repositoryorgspringframeworkootspring-boot-starter-json2.2.5.RELEASEspring-boot-starter-json-2.2.5.RELEASE.jar;E:IntelliJmaven-repositorycomfasterxmljacksoncorejackson-databind2.10.2jackson-databind-2.10.2.jar;E:IntelliJmaven-repositorycomfasterxmljacksoncorejackson-annotations2.10.2jackson-annotations-2.10.2.jar;E:IntelliJmaven-repositorycomfasterxmljacksoncorejackson-core2.10.2jackson-core-2.10.2.jar;E:IntelliJmaven-repositorycomfasterxmljacksondatatypejackson-datatype-jdk82.10.2jackson-datatype-jdk8-2.10.2.jar;E:IntelliJmaven-repositorycomfasterxmljacksondatatypejackson-datatype-jsr3102.10.2jackson-datatype-jsr310-2.10.2.jar;E:IntelliJmaven-repositorycomfasterxmljacksonmodulejackson-module-parameter-names2.10.2jackson-module-parameter-names-2.10.2.jar;E:IntelliJmaven-repositoryorgspringframeworkootspring-boot-starter-tomcat2.2.5.RELEASEspring-boot-starter-tomcat-2.2.5.RELEASE.jar;E:IntelliJmaven-repositoryorgapache omcatembed omcat-embed-core9.0.31 omcat-embed-core-9.0.31.jar;E:IntelliJmaven-repositoryorgapache omcatembed omcat-embed-el9.0.31 omcat-embed-el-9.0.31.jar;E:IntelliJmaven-repositoryorgapache omcatembed omcat-embed-websocket9.0.31 omcat-embed-websocket-9.0.31.jar;E:IntelliJmaven-repositoryorgspringframeworkootspring-boot-starter-validation2.2.5.RELEASEspring-boot-starter-validation-2.2.5.RELEASE.jar;E:IntelliJmaven-repositoryjakartavalidationjakarta.validation-api2.0.2jakarta.validation-api-2.0.2.jar;E:IntelliJmaven-repositoryorghibernatevalidatorhibernate-validator6.0.18.Finalhibernate-validator-6.0.18.Final.jar;E:IntelliJmaven-repositoryorgjbossloggingjboss-logging3.4.1.Finaljboss-logging-3.4.1.Final.jar;E:IntelliJmaven-repositorycomfasterxmlclassmate1.5.1classmate-1.5.1.jar;E:IntelliJmaven-repositoryorgspringframeworkspring-web5.2.4.RELEASEspring-web-5.2.4.RELEASE.jar;E:IntelliJmaven-repositoryorgspringframeworkspring-beans5.2.4.RELEASEspring-beans-5.2.4.RELEASE.jar;E:IntelliJmaven-repositoryorgspringframeworkspring-webmvc5.2.4.RELEASEspring-webmvc-5.2.4.RELEASE.jar;E:IntelliJmaven-repositoryorgspringframeworkspring-aop5.2.4.RELEASEspring-aop-5.2.4.RELEASE.jar;E:IntelliJmaven-repositoryorgspringframeworkspring-expression5.2.4.RELEASEspring-expression-5.2.4.RELEASE.jar;E:IntelliJmaven-repositoryorgspringframeworkootspring-boot-starter-jetty2.2.5.RELEASEspring-boot-starter-jetty-2.2.5.RELEASE.jar;E:IntelliJmaven-repositoryjakartaservletjakarta.servlet-api4.0.3jakarta.servlet-api-4.0.3.jar;E:IntelliJmaven-repositoryjakartawebsocketjakarta.websocket-api1.1.2jakarta.websocket-api-1.1.2.jar;E:IntelliJmaven-repositoryorgeclipsejettyjetty-servlets9.4.26.v20200117jetty-servlets-9.4.26.v20200117.jar;E:IntelliJmaven-repositoryorgeclipsejettyjetty-continuation9.4.26.v20200117jetty-continuation-9.4.26.v20200117.jar;E:IntelliJmaven-repositoryorgeclipsejettyjetty-http9.4.26.v20200117jetty-http-9.4.26.v20200117.jar;E:IntelliJmaven-repositoryorgeclipsejettyjetty-util9.4.26.v20200117jetty-util-9.4.26.v20200117.jar;E:IntelliJmaven-repositoryorgeclipsejettyjetty-io9.4.26.v20200117jetty-io-9.4.26.v20200117.jar;E:IntelliJmaven-repositoryorgeclipsejettyjetty-webapp9.4.26.v20200117jetty-webapp-9.4.26.v20200117.jar;E:IntelliJmaven-repositoryorgeclipsejettyjetty-xml9.4.26.v20200117jetty-xml-9.4.26.v20200117.jar;E:IntelliJmaven-repositoryorgeclipsejettyjetty-servlet9.4.26.v20200117jetty-servlet-9.4.26.v20200117.jar;E:IntelliJmaven-repositoryorgeclipsejettyjetty-security9.4.26.v20200117jetty-security-9.4.26.v20200117.jar;E:IntelliJmaven-repositoryorgeclipsejettyjetty-server9.4.26.v20200117jetty-server-9.4.26.v20200117.jar;E:IntelliJmaven-repositoryorgeclipsejettywebsocketwebsocket-server9.4.26.v20200117websocket-server-9.4.26.v20200117.jar;E:IntelliJmaven-repositoryorgeclipsejettywebsocketwebsocket-common9.4.26.v20200117websocket-common-9.4.26.v20200117.jar;E:IntelliJmaven-repositoryorgeclipsejettywebsocketwebsocket-api9.4.26.v20200117websocket-api-9.4.26.v20200117.jar;E:IntelliJmaven-repositoryorgeclipsejettywebsocketwebsocket-client9.4.26.v20200117websocket-client-9.4.26.v20200117.jar;E:IntelliJmaven-repositoryorgeclipsejettyjetty-client9.4.26.v20200117jetty-client-9.4.26.v20200117.jar;E:IntelliJmaven-repositoryorgeclipsejettywebsocketwebsocket-servlet9.4.26.v20200117websocket-servlet-9.4.26.v20200117.jar;E:IntelliJmaven-repositoryorgeclipsejettywebsocketjavax-websocket-server-impl9.4.26.v20200117javax-websocket-server-impl-9.4.26.v20200117.jar;E:IntelliJmaven-repositoryorgeclipsejettyjetty-annotations9.4.26.v20200117jetty-annotations-9.4.26.v20200117.jar;E:IntelliJmaven-repositoryorgeclipsejettyjetty-plus9.4.26.v20200117jetty-plus-9.4.26.v20200117.jar;E:IntelliJmaven-repositoryorgow2asmasm7.2asm-7.2.jar;E:IntelliJmaven-repositoryorgow2asmasm-commons7.2asm-commons-7.2.jar;E:IntelliJmaven-repositoryorgow2asmasm-tree7.2asm-tree-7.2.jar;E:IntelliJmaven-repositoryorgow2asmasm-analysis7.2asm-analysis-7.2.jar;E:IntelliJmaven-repositoryorgeclipsejettywebsocketjavax-websocket-client-impl9.4.26.v20200117javax-websocket-client-impl-9.4.26.v20200117.jar;E:IntelliJmaven-repositoryorgmortbayjasperapache-el8.5.49apache-el-8.5.49.jar;E:IntelliJmaven-repositoryorgspringframeworkootspring-boot-devtools2.2.5.RELEASEspring-boot-devtools-2.2.5.RELEASE.jar;E:IntelliJmaven-repositoryorgspringframeworkootspring-boot-autoconfigure2.2.5.RELEASEspring-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:Springsspringbootspringcloudspringcloud-provider-dept-8001 argetclassescomexamplespringcloudDaoDeptDao.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:Springsspringbootspringcloudspringcloud-provider-dept-8001 argetclassesmybatismapperDeptMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'file [E:Springsspringbootspringcloudspringcloud-provider-dept-8001 argetclassesmybatismapperDeptMapper.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:Springsspringbootspringcloudspringcloud-provider-dept-8001 argetclassescomexamplespringcloudDaoDeptDao.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:Springsspringbootspringcloudspringcloud-provider-dept-8001 argetclassesmybatismapperDeptMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'file [E:Springsspringbootspringcloudspringcloud-provider-dept-8001 argetclassesmybatismapperDeptMapper.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:Springsspringbootspringcloudspringcloud-provider-dept-8001 argetclassescomexamplespringcloudDaoDeptDao.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:Springsspringbootspringcloudspringcloud-provider-dept-8001 argetclassesmybatismapperDeptMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'file [E:Springsspringbootspringcloudspringcloud-provider-dept-8001 argetclassesmybatismapperDeptMapper.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:Springsspringbootspringcloudspringcloud-provider-dept-8001 argetclassesmybatismapperDeptMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'file [E:Springsspringbootspringcloudspringcloud-provider-dept-8001 argetclassesmybatismapperDeptMapper.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:Springsspringbootspringcloudspringcloud-provider-dept-8001 argetclassesmybatismapperDeptMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'file [E:Springsspringbootspringcloudspringcloud-provider-dept-8001 argetclassesmybatismapperDeptMapper.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:Springsspringbootspringcloudspringcloud-provider-dept-8001 argetclassesmybatismapperDeptMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'file [E:Springsspringbootspringcloudspringcloud-provider-dept-8001 argetclassesmybatismapperDeptMapper.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:Springsspringbootspringcloudspringcloud-provider-dept-8001 argetclassesmybatismapperDeptMapper.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重复了!

  • 相关阅读:
    VC++以及VS个版本比较 及 C++编译器比较
    这本书的封面
    json_encode(),json_deocde()用法说明
    循环匹配,一般用于多选列表选中状态
    js判断变量是否被定义
    js onload()事件调用方法
    js push使用方法
    iframe去掉边滚动条
    ajax上传文件(使用ajaxfileupload)
    基于url的权限控制
  • 原文地址:https://www.cnblogs.com/Guhongying/p/13669696.html
Copyright © 2011-2022 走看看