全网首发:org.xml.sax.SAXNotRecognizedException: unrecognized features nonvalidating/load-external-dtd

简介: 全网首发:org.xml.sax.SAXNotRecognizedException: unrecognized features nonvalidating/load-external-dtd

具体错误:

[INFO] Loading inherited module 'org.teavm.samples.benchmark.benchmark'
[INFO]    [ERROR] Failure while parsing XML
[INFO] org.xml.sax.SAXNotRecognizedException: unrecognized feature http://apache.org/xml/features/nonvalidating/load-external-dtd
[INFO]  at org.gjt.xpp.sax2.Driver.setFeature(Driver.java:178)
[INFO]  at org.gjt.xpp.jaxp11.SAXParserImpl.setFeatures(SAXParserImpl.java:149)
[INFO]  at org.gjt.xpp.jaxp11.SAXParserImpl.<init>(SAXParserImpl.java:132)
[INFO]  at org.gjt.xpp.jaxp11.SAXParserFactoryImpl.newSAXParserImpl(SAXParserFactoryImpl.java:114)
[INFO]  at org.gjt.xpp.jaxp11.SAXParserFactoryImpl.setFeature(SAXParserFactoryImpl.java:142)
[INFO]  at com.google.gwt.dev.util.xml.ReflectiveParser.createNewSaxParser(ReflectiveParser.java:61)
[INFO]  at com.google.gwt.dev.util.xml.ReflectiveParser.access$000(ReflectiveParser.java:48)
[INFO]  at com.google.gwt.dev.util.xml.ReflectiveParser$Impl.parse(ReflectiveParser.java:345)
[INFO]  at com.google.gwt.dev.util.xml.ReflectiveParser$Impl.access$200(ReflectiveParser.java:70)
[INFO]  at com.google.gwt.dev.util.xml.ReflectiveParser.parse(ReflectiveParser.java:431)
[INFO]  at com.google.gwt.dev.cfg.ModuleDefLoader.nestedLoad(ModuleDefLoader.java:316)
[INFO]  at com.google.gwt.dev.cfg.ModuleDefLoader.load(ModuleDefLoader.java:243)
[INFO]  at com.google.gwt.dev.cfg.ModuleDefLoader.doLoadModule(ModuleDefLoader.java:193)
[INFO]  at com.google.gwt.dev.cfg.ModuleDefLoader.loadFromResources(ModuleDefLoader.java:151)
[INFO]  at com.google.gwt.dev.cfg.ModuleDefLoader.loadFromClassPath(ModuleDefLoader.java:126)
[INFO]  at com.google.gwt.dev.Compiler.compile(Compiler.java:139)
[INFO]  at com.google.gwt.dev.Compiler$1.run(Compiler.java:118)
[INFO]  at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:55)
[INFO]  at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:50)
[INFO]  at com.google.gwt.dev.Compiler.main(Compiler.java:125)
  • 解决办法一(无效)

在编译脚本中,加入:

JAVA_OPTIONS="${JAVA_OPTIONS} -Djavax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl"
export JAVA_OPTIONS

解决办法二(有效)

看到一篇文章,受到启发(大哥你这还好意思说自己是首发?,标题不一样嘛,哈哈):


https://blog.csdn.net/SCTOM/article/details/83100430


在pom.xml中,把xercesImpl置于所有jar之前。具体来说:


/

  <dependencies>
    <dependency>
        <groupId>org.apache.xerces</groupId>
        <artifactId>xercesImpl-2.12.0</artifactId>
        <version>2.12.0</version>
        <scope>system</scope>
        <systemPath>${HOME}/.m2/repository/xerces/xercesImpl/2.12.0/xercesImpl-2.12.0.jar</systemPath>
    </dependency>
。。。。。。
目录
相关文章
|
SQL 缓存 Java
Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; 前言中不允许有内容。
简化数据库访问:通过配置文件或注解的方式来定义数据库操作,减少了传统的JDBC编码工作量。 灵活性:支持自定义SQL语句,可以编写复杂的SQL语句来满足特定的需求。
383 0
Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; 前言中不允许有内容。
|
Java 测试技术 Spring
Configuration problem: Failed to import bean definitions from URL location classpath:spring-mvc.xml
Configuration problem: Failed to import bean definitions from URL location classpath:spring-mvc.xml
826 0
Faceted project metadata file "/.settings/org.eclipse.wst.common.project.facet.core.xml" could
Faceted project metadata file "/.settings/org.eclipse.wst.common.project.facet.core.xml" could
167 0
Faceted project metadata file "/.settings/org.eclipse.wst.common.project.facet.core.xml" could
|
Java Maven
web.xml is missing and <failOnMissingWebXml> is set to true[解决]
web.xml is missing and <failOnMissingWebXml> is set to true[解决]
132 0
web.xml is missing and <failOnMissingWebXml> is set to true[解决]
|
XML 数据格式 Perl
|
分布式计算 Hadoop
|
Java 数据库连接 数据库
Proxool Provider unable to load JAXP configurator file: proxoolconf.xml
Proxool Provider unable to load JAXP configurator file: proxoolconf.xml   [java] view plain copy print? log4j:WARN No appenders could be found for logger (org.
1072 0