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

quarkus 1.7.0 DocumentBuilderFactoryImpl not found #2323

Closed
ennishol opened this issue Mar 9, 2021 · 4 comments
Closed

quarkus 1.7.0 DocumentBuilderFactoryImpl not found #2323

ennishol opened this issue Mar 9, 2021 · 4 comments

Comments

@ennishol
Copy link

ennishol commented Mar 9, 2021

After migrating to camel quarkus 1.7.0, the following exception occurs when running jar java -jar target/quarkus-app/quarkus-run.jar
but not with mvn quarkus:dev

Caused by: javax.xml.parsers.FactoryConfigurationError: Provider org.apache.xerces.jaxp.DocumentBuilderFactoryImpl not found at javax.xml.parsers.DocumentBuilderFactory.newInstance(Unknown Source) at org.apache.camel.converter.jaxp.XmlConverter.createDocumentBuilderFactory(XmlConverter.java:951) at org.apache.camel.converter.jaxp.XmlConverter.getDocumentBuilderFactory(XmlConverter.java:880) at org.apache.camel.converter.jaxp.XmlConverter.getDocumentBuilderFactory(XmlConverter.java:938) at org.apache.camel.converter.jaxp.XmlConverter.toDOMDocument(XmlConverter.java:674) at org.apache.camel.converter.jaxp.CamelXmlJaxpBulkConverterLoader.doConvertTo(CamelXmlJaxpBulkConverterLoader.java:304) at org.apache.camel.converter.jaxp.CamelXmlJaxpBulkConverterLoader.convertTo(CamelXmlJaxpBulkConverterLoader.java:35) at org.apache.camel.impl.converter.CoreTypeConverterRegistry.doConvertTo(CoreTypeConverterRegistry.java:461) at org.apache.camel.impl.converter.CoreTypeConverterRegistry.doConvertTo(CoreTypeConverterRegistry.java:356) at org.apache.camel.impl.converter.CoreTypeConverterRegistry.convertTo(CoreTypeConverterRegistry.java:203) at org.apache.camel.language.xpath.XPathBuilder.doGetDocument(XPathBuilder.java:1290) at org.apache.camel.language.xpath.XPathBuilder.getDocument(XPathBuilder.java:1269) at org.apache.camel.language.xpath.XPathBuilder.doInEvaluateAs(XPathBuilder.java:1033) at org.apache.camel.language.xpath.XPathBuilder.evaluateAs(XPathBuilder.java:916) at org.apache.camel.language.xpath.XPathBuilder.evaluate(XPathBuilder.java:883) at org.apache.camel.language.xpath.XPathBuilder.evaluate(XPathBuilder.java:206) at org.apache.camel.processor.SetPropertyProcessor.process(SetPropertyProcessor.java:47) ... 18 more

@jamesnetherton
Copy link
Contributor

Please can you provide a bit more context. What do your routes look like, what dependencies do you have etc?

@ennishol
Copy link
Author

ennishol commented Mar 9, 2021

@jamesnetherton Yes sorry, failed to add in the description.
Basically, adding org.apache.xmlgraphics will demonstrate the problem

<dependency>
      <groupId>org.apache.camel.quarkus</groupId>
      <artifactId>camel-quarkus-xpath</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.xmlgraphics</groupId>
      <artifactId>fop</artifactId>
      <version>2.6</version>
    </dependency>

a little route to reproduce

@ApplicationScoped
public class MyRoute extends EndpointRouteBuilder {

    @Override
    public void configure() {
        String xml = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?><Item Number=\"42\"></Item>";
        from("timer://foo?fixedRate=true&period=15000")
                    .log("started")
                    .setBody(constant(xml))
                    .setProperty("TestNumber", xpath("/Item/@Number", Long.class))
                    .log("Number ${exchangeProperty.TestNumber}");
    }

}

@jamesnetherton
Copy link
Contributor

You probably need to add an exclusion to the fop dependency like:

<exclusions>
    <exclusion>
        <groupId>xml-apis</groupId>
        <artifactId>xml-apis</artifactId>
    </exclusion>
</exclusions>

If you want fop support with camel, then you can use camel-quarkus-fop it does this exclusion internally and adds the necessary native support.

@ennishol
Copy link
Author

ennishol commented Mar 9, 2021

@jamesnetherton Thank you very much! Looks like it will resolve the issue

@ennishol ennishol closed this as completed Mar 9, 2021
@ppalaga ppalaga added this to the No fix/wont't fix milestone Mar 26, 2021
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

3 participants