【问题标题】:How to fix the "No XMLValidationSchemaFactory implementation class specified or accessible" error?如何修复“未指定或可访问 XMLValidationSchemaFactory 实现类”错误?
【发布时间】:2013-09-20 10:09:33
【问题描述】:

在我的代码中,我有以下代码片段:

import org.codehaus.stax2.validation.XMLValidationSchema;
import org.codehaus.stax2.validation.XMLValidationSchemaFactory;


public class MyClass
{
    [...]

    public void myMethod()
    {
        XMLValidationSchemaFactory sf = XMLValidationSchemaFactory.
          newInstance(XMLValidationSchema.SCHEMA_ID_W3C_SCHEMA);
    }

    [...]
}

当我运行它时,得到以下错误:

javax.xml.stream.FactoryConfigurationError: No XMLValidationSchemaFactory 
implementation class specified or accessible (via system property 
'org.codehaus.stax2.validation.XMLValidationSchemaFactory.w3c', or 
service definition under 
'META-INF/services/org.codehaus.stax2.validation.XMLValidationSchemaFactory.w3c')
    at org.codehaus.stax2.validation.XMLValidationSchemaFactory.
newInstance(XMLValidationSchemaFactory.java:226)
    at org.codehaus.stax2.validation.XMLValidationSchemaFactory.
newInstance(XMLValidationSchemaFactory.java:116)

我该如何解决?

【问题讨论】:

    标签: java stax


    【解决方案1】:

    我通过升级到Woodstox 4.2.0 解决了这个问题。

    【讨论】:

      猜你喜欢
      • 2015-01-08
      • 2023-01-08
      • 2013-10-28
      • 2015-02-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-04-05
      相关资源
      最近更新 更多