Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems using stax-2 java 11 #19

Closed
pavansinguluri opened this issue Jun 14, 2020 · 1 comment
Closed

Problems using stax-2 java 11 #19

pavansinguluri opened this issue Jun 14, 2020 · 1 comment

Comments

@pavansinguluri
Copy link

I have upgraded from java 8 to 11 and using woodstox 4.1.

public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) {
        try {
            XMLValidationSchemaFactory factory = XMLValidationSchemaFactory.newInstance(XMLValidationSchema.SCHEMA_ID_W3C_SCHEMA);
            XMLValidationSchema xmlValidationSchema = factory.createSchema(schemaResource.getURL());
            XMLInputFactory2 xmlFactory = (XMLInputFactory2) XMLInputFactory2.newInstance();
            InputStream xmlInputStream = xmlResource.getInputStream();
            XMLStreamReader2 reader = (XMLStreamReader2) xmlFactory.createXMLStreamReader(xmlInputStream);
            reader.validateAgainst(xmlValidationSchema);
            while (reader.hasNext()) {
                int eventType = reader.next();
            
            }
          } catch (Exception e) {
            throw new IllegalArgumentException("Error while validating " + xmlResource.getFilename(), e);
        }
        return RepeatStatus.FINISHED;
    }

The above was working for last 2 years with java 8. After i upgraded to java 11, i get the below 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')

Am i missing something?

@cowtowncoder
Copy link
Member

This is not the repository for Woodstox, but for Stax2 API which is implemented by Stax libraries such as Woodstox and Aalto. So please report against Woodstox (I think you filed an issue for it, so can just reopen it).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants