org.dom4j.DocumentException: Error on line 1 of document : The markup in the document following the
来源:互联网 发布:卷珠帘抄袭知乎 编辑:程序博客网 时间:2024/05/16 17:28
出错记录:
org.dom4j.DocumentException: Error on line 1 of document : The markup in the document following the root element must be well-formed. Nested exception: The markup in the document following the root element must be well-formed.
at org.dom4j.io.SAXReader.read(SAXReader.java:482)at org.dom4j.DocumentHelper.parseText(DocumentHelper.java:278)
at ouc.sei.xmloper.Result2Bean.str2Dom(Result2Bean.java:41)
at ouc.sei.xmloper.Result2Bean.strMap2DomMap(Result2Bean.java:57)
at ouc.sei.xmloper.Result2Bean.getSearchBean(Result2Bean.java:26)
at ouc.sei.result.GetSearchResult.getSearchResult(GetSearchResult.java:39)
at ouc.sei.result.GetSearchResult.test(GetSearchResult.java:67)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
解决方案:在xml文件当中一定要有“根“的概念,出错的原因是xml当中没有”根“。在最外面加一个节点即可。
如:<?xml version="1.0" encoding="UTF-8"?>
<a href="test">test</a>
<a href="test">test</a>
<a href="test">test</a>
这种情况,就会报错,因此要改为:
<?xml version="1.0" encoding="UTF-8" ?>
<root>
<a href="test">test</a>
<a href="test">test</a>
<a href="test">test</a>
</root>
即可正确!
- org.dom4j.DocumentException: Error on line 1 of document : The markup in the document following the
- org.dom4j.DocumentException: Error on line 1 of document : Content is not allowed in prolog.
- 烦:org.dom4j.DocumentException: Error on line 5 of document.....
- org.dom4j.DocumentException: Error on line 1 of document : Premature end of file. Nested exception:
- org.dom4j.DocumentException: Error on line 1 of document: 前言中不允许有内容
- org.dom4j.DocumentException: Error on line -1 of document : 文件提前结束
- Caused by: org.dom4j.DocumentException: Error on line 1 of document : 前言中不允许有内容。 Nested exception:
- org.xml.sax.SAXParseException: The markup in the document following the root element must be well-fo
- The markup in the document following the root element must be well-formed
- The markup in the document following the root element must be well-formed.
- The markup in the document following the root element must be well-formed.
- This page contains the following errors: error on line 1 at column 1: Document is empty Below is a
- 服务器返回出现:error on line 19 at column 1: Extra content at the end of the document
- xml报错The markup in the document following the root element must be well-formed的处理
- org.xml.sax.SAXParseException: The markup in the document preceding the root element must be well-fo
- This page contains the following errors: error on line 1 at column 1: Extra content at the end of t
- The markup in the document preceding the root element must be well-formed
- java.lang.RuntimeException: org.dom4j.DocumentException: Error on line 1 of ...xml: 应该有伪属性名。
- linux设备驱动init中死机问题
- 影响未来十年的10项互联网新技术
- 微软Microsoft、谷歌Google、百度、腾讯面试题(一)
- 怎样在android系统启动时自动运行自己的程序(RECEIVE_BOOT_COMPLETED)
- APK 反编译
- org.dom4j.DocumentException: Error on line 1 of document : The markup in the document following the
- 可爱又可恶的zlib
- 观察者模式
- C#中常用的字符串处理函数
- 微软Microsoft、谷歌Google、百度、腾讯面试题(二)
- 微软Microsoft、谷歌Google、百度、腾讯面试题(三)
- Linux RH5平台下使用Oracle ASM创建数据库
- 微软Microsoft、谷歌Google、百度、腾讯面试题(四)
- 利用Android手机的蓝牙控制电灯