Cause org.xml.sax.SAXParseException lineNumber 16 columnNumber 10 XML 文档结构必须从头至尾包含在同一个实体内

时间:2024-05-22 21:57:58

问题报错:

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring/spring-dao.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [F:\eclipse\workspace\campuso2o\target\classes\mapper\ProductDao.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error creating document instance.  Cause: org.xml.sax.SAXParseException; lineNumber: 16; columnNumber: 10; XML 文档结构必须从头至尾包含在同一个实体内。


问题解决办法:

如下代码,我的代码中没有写</mapper> ,所以报文档结构必须从头至尾包含在同一个实体内。

Cause org.xml.sax.SAXParseException lineNumber 16 columnNumber 10 XML 文档结构必须从头至尾包含在同一个实体内