How to fix the "No XMLValidationSchemaFactory implementation class specified or accessible" error?

StackOverflow https://stackoverflow.com/questions/18914158

  •  29-06-2022
  •  | 
  •  

Question

In my code I have following code fragment:

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);
    }

    [...]
}

When I run it, get following error:

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)

How can I fix it?

Était-ce utile?

La solution

I fixed this problem by upgrading to Woodstox 4.2.0.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top