繁体   English   中英

将 xerces 与 JBOSS EAP 7.1 一起使用时 XSD 1.1 验证失败

[英]XSD 1.1 validation failure upon using xerces with JBOSS EAP 7.1

我的 Web 应用程序部署在 JBOSS EAP 7.1 服务器中并使用 jdk 1.8。 我需要使用以下 xerces 依赖项针对 XSD 1.1 验证我的 XML:

<dependency>
        <groupId>org.opengis.cite.xerces</groupId>
        <artifactId>xercesImpl-xsd11</artifactId>
        <version>2.12-beta-r1667115</version>
</dependency>

我的验证代码在独立运行时运行良好。 但是,当我在 JBOSS 服务器上部署我的 Web 应用程序时,相同的代码在以下行失败。

SchemaFactory factory = SchemaFactory.newInstance("http://www.w3.org/XML/XMLSchema/v1.1");

我收到以下错误:

javax.xml.validation.SchemaFactoryConfigurationError: Provider for class javax.xml.validation.SchemaFactory cannot be created

如何使用 xerces 在 JBOSS EAP 7.1 中验证我的 XSD 1.1 版本?

尝试使用这个构造函数,它采用工厂的类名。 工厂的类是'org.apache.xerces.jaxp.validation.XMLSchema11Factory',您还需要类路径上的'xercesImpl-xsd11-2.12-beta-r1667115.jar'。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM