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>"”,所以能很快定位到。