`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