0

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

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)

我该如何解决?

4

1 回答 1

0

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

于 2013-09-20T11:35:53.777 回答