Springboot Error parsing Mapper XML
記錄一下Springboot專案中的一些錯誤。
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'competitionController': Unsatisfied dependency expressed through field 'competitionService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'competitonServiceImpl': Unsatisfied dependency expressed through field 'competitionMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'competitionMapper' defined in file [/Users/apple/IdeaProjects/SpringBoot/online_course_judge/target/classes/com/nbu/online_course_judge/mapper/CompetitionMapper.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 [/Users/apple/IdeaProjects/SpringBoot/online_course_judge/target/classes/mapper/userMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'file [/Users/apple/IdeaProjects/SpringBoot/online_course_judge/target/classes/mapper/userMapper.xml]'. Cause: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for com.nbu.online_course_judge.mapper.UserMapper.isAccepted. please check file [/Users/apple/IdeaProjects/SpringBoot/online_course_judge/target/classes/mapper/userMapper.xml] and file [/Users/apple/IdeaProjects/SpringBoot/online_course_judge/target/classes/mapper/userMapper.xml]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:643) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:130) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1420) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:897) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:879) ~[spring-context-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551) ~[spring-context-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143) ~[spring-boot-2.3.3.RELEASE.jar:2.3.3.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758) [spring-boot-2.3.3.RELEASE.jar:2.3.3.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750) [spring-boot-2.3.3.RELEASE.jar:2.3.3.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.3.3.RELEASE.jar:2.3.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-2.3.3.RELEASE.jar:2.3.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237) [spring-boot-2.3.3.RELEASE.jar:2.3.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.3.3.RELEASE.jar:2.3.3.RELEASE]
at com.nbu.online_course_judge.OnlineCourseJudgeApplication.main(OnlineCourseJudgeApplication.java:13) [classes/:na]
原因是我在某一個mapper.xml中寫了兩個id相同的sql語句
相關文章
- Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause:...ApacheBATUIExceptionErrorSQLAPP
- 建立mapper.xml方法APPXML
- Mapper.xml中的trimAPPXML
- mapper.xml基礎內容APPXML
- 解決 eslint 的 Parsing error: Unexpected token 錯誤EsLintError
- mybatis mapper.xml批次刪除操作MyBatisAPPXML
- SpringBoot快速整合通用MapperSpring BootAPP
- Spring+Mybatis(一)無mapper.xml方式SpringMyBatisAPPXML
- XML DOM Parse Error 物件概述XMLError物件
- SpringBoot中幾種好用的程式碼生成器(基於Mybatis-plus生成entity、mapper、xml等)Spring BootMyBatisAPPXML
- mybatis中mapper.xml檔案引數問題MyBatisAPPXML
- Binary XML file line #2: Error inflatingXMLError
- IDEA如何使mapper直接跳轉到xml,超實用IdeaAPPXML
- springboot 自定義errorSpring BootError
- SpringBoot第六篇:整合通用MapperSpring BootAPP
- 求大佬幫助我!!!IDEA中Mybatis的mapper.xml和dao.xml出現問題!!!IdeaMyBatisAPPXML
- Mybatis 學習筆記(一)——配置檔案SqlMapConfig.xml和對映檔案Mapper.xmlMyBatis筆記SQLXMLAPP
- 最全MyBatis中XML對映檔案(Mapper)標籤分析及示例MyBatisXMLAPP
- 《手寫Mybatis》第4章:Mapper XML的解析和註冊使用MyBatisAPPXML
- IDEA -去除 mapper.xml 中的 SQL 語句黃色下劃線IdeaAPPXMLSQL
- SpringBoot 實戰 (十三) | 整合 MyBatis (XML 版)Spring BootMyBatisXML
- SpringBoot原始碼篇(一):深度分析SpringBoot如何省去web.xmlSpring Boot原始碼WebXML
- SpringBoot邊學邊用(二)SpringBoot 整合 Mybatis(xml檔案形式)Spring BootMyBatisXML
- pecl PHP Parse error: syntax error, unexpected 'new' (T_NEW) 以及 XML缺失解決辦法PHPErrorXML
- springboot請求controller返回Whitelabel Error PageSpring BootControllerError
- [IDEA]可以透過點選圖示找到mapper.java關聯的xml檔案IdeaAPPJavaXML
- springboot pom.xml 完整配置-v2.1.2.releaseSpring BootXML
- Parsing Direct3D shader bytecode3D
- SpringBoot快速整合Mybatis(去XML化+註解進階)Spring BootMyBatisXML
- 使用Intellij建立springboot專案Spring Initializr Error 403IntelliJSpring BootError
- Springboot 整合通用mapper和pagehelper展示分頁資料(附github原始碼)Spring BootAPPGithub原始碼
- [20191122]oracel SQL parsing function qcplgte.txtSQLFunction
- spring cloud分散式微服務-springboot省去web.xml配置Cloud分散式微服務Spring BootWebXML
- NotesAtRandom——通用MapperrandomAPP
- springBoot+mvc專案:unexpected error(type=Not Acceptable,stauts=-406)Spring BootMVCError
- Mybatis逆向工程的2種方法,一鍵高效快速生成Pojo、Mapper、XML,擺脫大量重複開發MyBatisPOJOAPPXML
- 精盡MyBatis原始碼分析 - MyBatis初始化(二)之載入 Mapper 介面與 XML 對映檔案MyBatis原始碼APPXML
- SpringBoot通過yml和xml檔案配置日誌輸出Spring BootXML