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語句
相關文章
- Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection alreadyErrorAPPXMLJavaException
- Error parsing XML: An invalid XML character (Unicode:0x1f) was foundErrorXMLUnicode
- Parsing an XML Document with XPathXML
- Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause:...ApacheBATUIExceptionErrorSQLAPP
- com.badlogic.gdx.utils.SerializationException: Error parsing XML on line 1 nearExceptionErrorXML
- 建立mapper.xml方法APPXML
- Mapper.xml中的trimAPPXML
- mapper.xml基礎內容APPXML
- mybatis mapper.xml批次刪除操作MyBatisAPPXML
- Error parsing HTTP request header--400 bad requestErrorHTTPHeader
- JAXP 再述??Sun 的 Java API for XML Parsing,1.1 版(轉)JavaAPIXML
- SpringBoot快速整合通用MapperSpring BootAPP
- 解決 eslint 的 Parsing error: Unexpected token 錯誤EsLintError
- 急!!Error Parsing EJB file: Finder found in DD with no matching method.Error
- Spring+Mybatis(一)無mapper.xml方式SpringMyBatisAPPXML
- mybatis中mapper.xml檔案引數問題MyBatisAPPXML
- XML DOM Parse Error 物件概述XMLError物件
- XML ERROR 在咚懍斜XMLError
- SpringBoot中幾種好用的程式碼生成器(基於Mybatis-plus生成entity、mapper、xml等)Spring BootMyBatisAPPXML
- PARSING_USER_ID,PARSING_SCHEMA_ID,PARSING_SCHEMA_NAME in V$SQLSQL
- SpringBoot第六篇:整合通用MapperSpring BootAPP
- mybatis的mapper.xml用條件判斷做轉譯MyBatisAPPXML
- IDEA如何使mapper直接跳轉到xml,超實用IdeaAPPXML
- springboot 自定義errorSpring BootError
- 求大佬幫助我!!!IDEA中Mybatis的mapper.xml和dao.xml出現問題!!!IdeaMyBatisAPPXML
- 最全MyBatis中XML對映檔案(Mapper)標籤分析及示例MyBatisXMLAPP
- 《手寫Mybatis》第4章:Mapper XML的解析和註冊使用MyBatisAPPXML
- Mybatis 學習筆記(一)——配置檔案SqlMapConfig.xml和對映檔案Mapper.xmlMyBatis筆記SQLXMLAPP
- SQL Parsing Flow DiagramSQL
- IDEA -去除 mapper.xml 中的 SQL 語句黃色下劃線IdeaAPPXMLSQL
- parsing html in asp.netHTMLASP.NET
- SpringBoot 實戰 (十三) | 整合 MyBatis (XML 版)Spring BootMyBatisXML
- Binary XML file line #2: Error inflatingXMLError
- SpringBoot原始碼篇(一):深度分析SpringBoot如何省去web.xmlSpring Boot原始碼WebXML
- SpringBoot邊學邊用(二)SpringBoot 整合 Mybatis(xml檔案形式)Spring BootMyBatisXML
- mybatis中 mapper.xml檔案中,獲取陣列中指定的位置的資料MyBatisAPPXML陣列
- [IDEA]可以透過點選圖示找到mapper.java關聯的xml檔案IdeaAPPJavaXML
- pecl PHP Parse error: syntax error, unexpected 'new' (T_NEW) 以及 XML缺失解決辦法PHPErrorXML