org.dom4j.DocumentException: Error on line 1 of document : Content is not allowed in prolog. Nested

报错:

org.dom4j.DocumentException: Error on line 1 of document  : Content is not allowed in prolog. Nested exception: Content is not allowed in prolog.
    at org.dom4j.io.SAXReader.read(SAXReader.java:482)
    at org.dom4j.io.SAXReader.read(SAXReader.java:365)
    at com.primeton.dgs.extractor.server.util.Dom4jReader.initDocument(Dom4jReader.java:71)
    at com.primeton.dgs.extractor.server.util.Dom4jReader.initDocument(Dom4jReader.java:59)
    at com.primeton.dgs.extractor.server.adapter.mapping.impl.BuildTableauServiceImpl.buildMetadata(BuildTableauServiceImpl.java:78)
    at com.primeton.dgs.extractor.server.adapter.mapping.BuildMetadataBaseService.buildMetadatas(BuildMetadataBaseService.java:77)
    at com.primeton.dgs.extractor.server.control.impl.ExtractServiceImpl.singleExtract(ExtractServiceImpl.java:263)
    at com.primeton.dgs.extractor.server.control.impl.ExtractServiceImpl.multiExtract(ExtractServiceImpl.java:199)
    at com.primeton.dgs.extractor.server.control.impl.ExtractServiceImpl.multiExtract(ExtractServiceImpl.java:144)
    at com.primeton.dgs.extractor.server.control.impl.ExtractServiceImpl.extract(ExtractServiceImpl.java:72)
    at com.primeton.dgs.extractor.server.control.ExtractController.adapterControl(ExtractController.java:58)
    at com.primeton.dgs.extractor.server.control.ExtractRunnable.run(ExtractRunnable.java:35)
    at java.lang.Thread.run(Thread.java:745)
Nested exception: 
org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    at org.dom4j.io.SAXReader.read(SAXReader.java:465)
    at org.dom4j.io.SAXReader.read(SAXReader.java:365)
    at com.primeton.dgs.extractor.server.util.Dom4jReader.initDocument(Dom4jReader.java:71)
    at com.primeton.dgs.extractor.server.util.Dom4jReader.initDocument(Dom4jReader.java:59)
    at com.primeton.dgs.extractor.server.adapter.mapping.impl.BuildTableauServiceImpl.buildMetadata(BuildTableauServiceImpl.java:78)
    at com.primeton.dgs.extractor.server.adapter.mapping.BuildMetadataBaseService.buildMetadatas(BuildMetadataBaseService.java:77)
    at com.primeton.dgs.extractor.server.control.impl.ExtractServiceImpl.singleExtract(ExtractServiceImpl.java:263)
    at com.primeton.dgs.extractor.server.control.impl.ExtractServiceImpl.multiExtract(ExtractServiceImpl.java:199)
    at com.primeton.dgs.extractor.server.control.impl.ExtractServiceImpl.multiExtract(ExtractServiceImpl.java:144)
    at com.primeton.dgs.extractor.server.control.impl.ExtractServiceImpl.extract(ExtractServiceImpl.java:72)
    at com.primeton.dgs.extractor.server.control.ExtractController.adapterControl(ExtractController.java:58)
    at com.primeton.dgs.extractor.server.control.ExtractRunnable.run(ExtractRunnable.java:35)
    at java.lang.Thread.run(Thread.java:745)
Nested exception: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    at org.dom4j.io.SAXReader.read(SAXReader.java:465)
    at org.dom4j.io.SAXReader.read(SAXReader.java:365)
    at com.primeton.dgs.extractor.server.util.Dom4jReader.initDocument(Dom4jReader.java:71)
    at com.primeton.dgs.extractor.server.util.Dom4jReader.initDocument(Dom4jReader.java:59)
    at com.primeton.dgs.extractor.server.adapter.mapping.impl.BuildTableauServiceImpl.buildMetadata(BuildTableauServiceImpl.java:78)
    at com.primeton.dgs.extractor.server.adapter.mapping.BuildMetadataBaseService.buildMetadatas(BuildMetadataBaseService.java:77)
    at com.primeton.dgs.extractor.server.control.impl.ExtractServiceImpl.singleExtract(ExtractServiceImpl.java:263)
    at com.primeton.dgs.extractor.server.control.impl.ExtractServiceImpl.multiExtract(ExtractServiceImpl.java:199)
    at com.primeton.dgs.extractor.server.control.impl.ExtractServiceImpl.multiExtract(ExtractServiceImpl.java:144)
    at com.primeton.dgs.extractor.server.control.impl.ExtractServiceImpl.extract(ExtractServiceImpl.java:72)
    at com.primeton.dgs.extractor.server.control.ExtractController.adapterControl(ExtractController.java:58)
    at com.primeton.dgs.extractor.server.control.ExtractRunnable.run(ExtractRunnable.java:35)
    at java.lang.Thread.run(Thread.java:745)
2019-09-23 11:25:07,140 ERROR ExtractServiceImpl:328 - 
java.lang.NullPointerException
    at com.primeton.dgs.extractor.server.util.Dom4jReader.selectNodes(Dom4jReader.java:151)
    at com.primeton.dgs.extractor.server.adapter.mapping.impl.BuildTableauServiceImpl.buildMetadata(BuildTableauServiceImpl.java:79)
    at com.primeton.dgs.extractor.server.adapter.mapping.BuildMetadataBaseService.buildMetadatas(BuildMetadataBaseService.java:77)
    at com.primeton.dgs.extractor.server.control.impl.ExtractServiceImpl.singleExtract(ExtractServiceImpl.java:263)
    at com.primeton.dgs.extractor.server.control.impl.ExtractServiceImpl.multiExtract(ExtractServiceImpl.java:199)
    at com.primeton.dgs.extractor.server.control.impl.ExtractServiceImpl.multiExtract(ExtractServiceImpl.java:144)
    at com.primeton.dgs.extractor.server.control.impl.ExtractServiceImpl.extract(ExtractServiceImpl.java:72)
    at com.primeton.dgs.extractor.server.control.ExtractController.adapterControl(ExtractController.java:58)
    at com.primeton.dgs.extractor.server.control.ExtractRunnable.run(ExtractRunnable.java:35)
    at java.lang.Thread.run(Thread.java:745)

 

 

解决方案:

(1)查看你的导入的文件是否能正常打开,是否有编码错误,如若导入的文件打不开就是文件有问题了。

(2)

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------

作者还在努力解决,如果有大神知道,还请指点一二,谢谢!

你可能感兴趣的:(java)