`org.springframework.beans.factory.UnsatisfiedDependencyException異常處理


org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'moneyNotifyController': Unsatisfied dependency expressed through field 'moneyNotifyService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'moneyNotifyServiceImpl': Unsatisfied dependency expressed through field 'notifyMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'notifyMapper' defined in file [E:\software\newYupite2\yupite\yupiteprobject\yupite-Notify-Server\target\classes\com\yupite\notify\dao\moneyNotify\NotifyMapper.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:\software\newYupite2\yupite\yupiteprobject\yupite-Notify-Server\target\classes\mapping\spell\SpellMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException; lineNumber: 60; columnNumber: 7; The element type "trim" must be terminated by the matching end-tag "</trim>".

在SpringBoot啟動時遇到了這個錯誤,最終檢查了下,發現了是mapper映射文件中少寫了個結尾   </trim>

是一個很低級的錯誤,而且報錯的結尾很清楚給了原因“columnNumber: 7; The element type "trim" must be terminated by the matching end-tag "</trim>"”,所以能很快定位到。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM