【问题标题】:SAXNotRecognizedException for feature 'http://apache.org/xml/features/standard-uri-conformant'功能“http://apache.org/xml/features/standard-uri-conformant”的 SAXNotRecognizedException
【发布时间】:2012-08-07 18:49:33
【问题描述】:

任何人都知道为什么我在以下代码中遇到异常。我正在使用 Java 6。

final XMLReader reader = XMLReaderFactory.createXMLReader();
reader.setFeature("http://xml.org/sax/features/validation", doValidate);
reader.setFeature("http://apache.org/xml/features/validation/schema", doValidate);
reader.setFeature("http://apache.org/xml/features/standard-uri-conformant", doValidate);


org.xml.sax.SAXNotRecognizedException: Feature 'http://apache.org/xml/features/standard-uri-conformant' is not recognized

【问题讨论】:

    标签: java xml jaxb saxparser


    【解决方案1】:

    在集成 Spring 和 Rest Webservice Jersey 时遇到此问题

    解决方案

    删除了以下 jars
    xerces-2.6.2.jar
    xercesImpl-2.11.0.jar
    xml-apis.jar

    已添加

    jaxp-api-1.4.2.jar

    【讨论】:

      【解决方案2】:

      找到解决方案:

      将 xercesImpl 2.9.1 添加到我的类路径中,而不是使用 Xerces 的内部 Java 6 捆绑版本。

      【讨论】:

      • 我从 JDK 6 切换到 JDK 8 时遇到了同样的问题,这个解决方案有效。
      猜你喜欢
      • 1970-01-01
      • 2015-11-22
      • 1970-01-01
      • 2017-07-21
      • 2023-04-02
      • 1970-01-01
      • 1970-01-01
      • 2013-02-22
      • 2013-10-15
      相关资源
      最近更新 更多