mybatis 配置错误 XML document structures must start and end within the same entity
2017-10-30 17:10
573 查看
问题如下:
Exception in thread "main" org.apache.ibatis.exceptions.PersistenceException: ### Error building SqlSession. ### Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException: XML document structures must start and end within the same entity. at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:26) at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:54) at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:38) at com.aaa.test.Test.main(Test.java:16) Caused by: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException: XML document structures must start and end within the same entity. at org.apache.ibatis.parsing.XPathParser.createDocument(XPathParser.java:256) at org.apache.ibatis.parsing.XPathParser.<init>(XPathParser.java:120) at org.apache.ibatis.builder.xml.XMLConfigBuilder.<init>(XMLConfigBuilder.java:63) at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:51) ... 2 more Caused by: org.xml.sax.SAXParseException: XML document structures must start and end within the same entity. at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:174) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:388) at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1411) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.endEntity(XMLDocumentFragmentScannerImpl.java:902) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.endEntity(XMLDocumentScannerImpl.java:605) at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.endEntity(XMLEntityManager.java:1393) at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(XMLEntityScanner.java:1763) at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.scanData(XMLEntityScanner.java:1242) at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanComment(XMLScanner.java:756) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanComment(XMLDocumentFragmentScannerImpl.java:1036) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2945) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107) at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:225) at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283) at org.apache.ibatis.parsing.XPathParser.createDocument(XPathParser.java:254) ... 5 more
解决方案
解决方案二:根据提示的错误,问题在xml里面,应该是个某个标签的开始和结束不一致了
解决方案三:
你的配置文件有标签没结束
解决方案四:
大哥,你可以自家看看,我哪个标签没结束,我都检查了N回了
解决方案五:
XMLdocumentstructuresmuststartandendwithinthesameentity.xml文档结构必须开始结束使用同一标签.你的XML元素一定有一个,名称是错误的,这可能是因为你编码方式导致你的标签内加入了系统当前编码环境下不识别的编码字符.
解决方案六:
问题和楼主一样啊..郁闷
解决方案七:
xml里的中文注释,先加空格再接“-->”
解决方案八:
LZ看看com.ibatis.blackcoat.entity.blackcoat的类中属性是否与表blackcoat的字段一一对应呢
解决方案九:
楼主的问题解决没有,我也遇到同样的问题,束手无策,求帮忙
解决方案十:
我解决了经过仔细检查除了标签要写对应之外,就是之前楼上提到的那个中文注释问题,一定要前后空格隔开<!--说明-->
相关文章推荐
- eclipse配置文件出现“Type XML document structures must start and end within the same entity”
- 配置spring的时候,application.xml配置文件报错:XML document structures must start and end within the same entity
- XML document structures must start and end within the same entity.
- XML document structures must start and end within the same entity
- XML document structures must start and end within the same entity
- XML document structures must start and end within the same entity.
- XML document structures must start and end within the same entity.
- XML document structures must start and end within the same entity
- XML document structures must start and end within
- mybatis mapper.xml文件中配置提示如下错误The entity name must immediately follow the '&' in the entity reference
- 配置文件中出现 The reference to entity "XX" must end with the ';' delimiter. 错误提示
- xml文件中配置JDBC源遇到问题 : The reference to entity "characterEncoding" must end with the ';' delimiter
- mybatis 项目配置 xml文件时 报错提示(The reference to entity "useSSL" must end with the ';'
- The document type declaration for root element type "config" must end with '>'.错误
- Parser exception for xx/AndroidManifest.xml: The reference to entity "z" must end with the ';' delim
- Unexpected XML declaration. The XML declaration must be the first node in the document and no white
- XML文件要有根标签(Extra content at the end of the document in file 错误)
- 关于xml配置文件无元素提示和the root element of the document is not <xsd:schema>.错误
- php 输出xml错误不能解析,XML declaration allowed only at the start of the document
- Mail merge region 'tablePrint' is badly formed. TableStart and TableEnd should be in the same sectio