mybatis 配置错误 XML document structures must start and end within the same entity
来源:互联网 发布:做视频短片的软件 编辑:程序博客网 时间:2024/06/06 00:38
问题如下:
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 moreCaused 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的字段一一对应呢
解决方案九:
楼主的问题解决没有,我也遇到同样的问题,束手无策,求帮忙
解决方案十:
我解决了经过仔细检查除了标签要写对应之外,就是之前楼上提到的那个中文注释问题,一定要前后空格隔开<!--说明-->
阅读全文
0 0
- mybatis 配置错误 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.
- eclipse配置文件出现“Type XML document structures must start and end within the same entity”
- XML document structures must start and end within the same entity
- mybatis 项目配置 xml文件时 报错提示(The reference to entity "useSSL" must end with the ';' delimiter.)
- mybatis 项目配置 xml文件时 报错提示(The reference to entity "useSSL" must end with the ';'
- mybatis mapper.xml文件中配置提示如下错误The entity name must immediately follow the '&' in the entity reference
- xml文件中配置JDBC源遇到问题 : The reference to entity "characterEncoding" must end with the ';' delimiter
- eclipse xml 字符:The reference to entity XXX must end with the ';' delimiter
- Android中String.xml: The reference to entity "timestamp" must end with the ';' delimiter
- Parser exception for xx/AndroidManifest.xml: The reference to entity "z" must end with the ';' delim
- 关于The reference to entity "characterEncoding" must end with the ';' delimiter. org.xml.sax.SAXParseE
- 配置文件中出现 The reference to entity "XX" must end with the ';' delimiter. 错误提示
- 在xml文件中配置数据库url需要带多个参数的时候IDE提示The reference to entity "characterEncoding" must end with the ';'
- ubuntu16.04系统gcc下降和升级
- ListView实现下拉刷新(一)
- 应用Public API配置XenMobile Server
- 完整的支付体系
- 成员变量和类变量的区别?
- mybatis 配置错误 XML document structures must start and end within the same entity
- 一些sb题(day1下)
- S32K144 EVB之UART
- Reverse Integer算法研究
- java 基础--问题收集
- C++中ANSI、Unicode16、UTF-8字符串之间的互转
- CSS 浮动实例。为了兼容,浮动元素放在所在行的最前面
- c++原子操作内存序
- 刷题#R3