慕慕0563197
2019-04-24 20:52
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'app': Unsatisfied dependency expressed through field 'userDOMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userDOMapper' defined in file [E:\ideawork\newdongsheng\trunk\miaosha\target\classes\com\miaoshaproject\dao\UserDOMapper.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:\ideawork\newdongsheng\trunk\miaosha\target\classes\mapping\UserPasswordDOMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 7; 不允许有匹配 "[xX][mM][lL]" 的处理指令目标。
你把逆向生成的xml文件给删了,重新生成就可以了。记得给生成的mapper接口加上@Repository
这种情况应该是UserPasswordDOMapper.xml里面有错,我当时也报这个错误,后来发现是在xml里使用了”//“做注释
我也遇到了这样的错误,好烦,不知道怎么解决,网上搜了感觉都不专业,难受
SpringBoot构建电商基础秒杀项目
49065 学习 · 954 问题
相似问题