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

camel-quarkus-atlasmap including xercesImpl problem #3282

Closed
tarilabs opened this issue Nov 10, 2021 · 6 comments
Closed

camel-quarkus-atlasmap including xercesImpl problem #3282

tarilabs opened this issue Nov 10, 2021 · 6 comments

Comments

@tarilabs
Copy link
Member

When used on Quarkus, the dependency org.apache.camel.quarkus:camel-quarkus-atlasmap also transitively imports xercesImpl and that makes my Quarkus app fail on some xml apis; to solve it, I manually exclude xercesImpl from my pom.

...
[INFO] +- org.apache.camel.quarkus:camel-quarkus-atlasmap:jar:2.4.0:compile
[INFO] |  \- org.apache.camel:camel-atlasmap:jar:3.12.0:compile
...
[INFO] |     \- io.atlasmap:atlas-dfdl-module:jar:2.2.3:compile
[INFO] |        +- io.atlasmap:atlas-dfdl-model:jar:2.2.3:compile
[INFO] |        \- io.atlasmap:atlas-dfdl-core:jar:2.2.3:compile
[INFO] |           \- org.apache.daffodil:daffodil-japi_2.12:jar:3.0.0:compile
[INFO] |              +- org.scala-lang:scala-library:jar:2.12.13:compile
[INFO] |              +- org.apache.daffodil:daffodil-core_2.12:jar:3.0.0:compile
[INFO] |              |  +- org.apache.daffodil:daffodil-runtime1-unparser_2.12:jar:3.0.0:compile
[INFO] |              |  |  \- org.apache.daffodil:daffodil-runtime1_2.12:jar:3.0.0:compile
[INFO] |              |  |     \- org.apache.daffodil:daffodil-io_2.12:jar:3.0.0:compile
[INFO] |              |  |        \- org.apache.daffodil:daffodil-lib_2.12:jar:3.0.0:compile
[INFO] |              |  \- org.apache.daffodil:daffodil-udf_2.12:jar:3.0.0:compile
[INFO] |              +- org.scala-lang.modules:scala-xml_2.12:jar:1.3.0:compile
[INFO] |              +- org.scala-lang.modules:scala-parser-combinators_2.12:jar:1.1.2:compile
[INFO] |              +- com.ibm.icu:icu4j:jar:67.1:compile
[INFO] |              +- xerces:xercesImpl:jar:2.12.0:compile
[INFO] |              |  \- xml-apis:xml-apis:jar:1.4.01:compile
[INFO] |              +- xml-resolver:xml-resolver:jar:1.2:compile
[INFO] |              +- commons-io:commons-io:jar:2.11.0:compile
[INFO] |              +- jline:jline:jar:2.14.6:compile
[INFO] |              +- org.jdom:jdom2:jar:2.0.6:compile
[INFO] |              \- com.fasterxml.woodstox:woodstox-core:jar:6.1.1:compile
[INFO] |                 \- org.codehaus.woodstox:stax2-api:jar:4.2:compile
...

The error relates to missing XSD Validation property:

Property 'http://javax.xml.XMLConstants/property/accessExternalDTD' is not recognized

Which is expected by another Quarkus extensions in the same Quarkus application which needs to perform XSD Validation.

To solve this issue, I exclude xercesImpl ~like this:

https://github.com/tarilabs/quarkus-content-based-routing/blob/1b21a5359d71cb9a54d4a8ee8d901cac0c53fec6/pom.xml#L82-L91

To reproduce the problem, you can checkout that ^ application locally, elide the <exclusion> and running mvn clean install will exhibit the problem: another Quarkus extension is performing XSD Validation, but the property is being likely searched on the specific xercesImpl now, instead of relying on the batteries-included JDK xml capabilities?

Can you kindly advise please?
Thanks!
/cc @zbendhiba

@jamesnetherton
Copy link
Contributor

From Camel 3.13 onwards, this problem likely goes away. atlas-dfdl-module is experimental and is no longer included as a direct dependency of camel-atlasmap (it's optional).

@tarilabs
Copy link
Member Author

Thank you for the headsup @jamesnetherton

I understand AtlasMap works with XSD, JSONSchema, Pojos and CSV.
I tried to read about DFDL in the AtlasMap User docs but there's no mention. I search DFDL instead in the AtlasMap Dev docs but in 3.3.5. DFDL Service seems a typo the same description of xml is actually repeated.

My question is: how can I understand if I can just remove dfdl-module altogether already in my quarkus application, please?

@jamesnetherton
Copy link
Contributor

if I can just remove dfdl-module altogether already in my quarkus application

You can try to exclude the dfdl module from the dependency tree, but it may not work because there are a few references to the dependency in the AtlasMap Camel Quarkus extension.

@zbendhiba
Copy link
Contributor

I will look at this. thanks @tarilabs

@zbendhiba
Copy link
Contributor

@tarilabs I wonder if you have tried recent versions of Camel Quarkus, as DFDL was removed few versions now ?

tarilabs added a commit to tarilabs/quarkus-content-based-routing that referenced this issue Apr 13, 2022
bump Quarkus version
ref apache/camel-quarkus#3282 (comment)
using resteasy-jackson choice per latest Kogito
@tarilabs
Copy link
Member Author

Thank you for the ping @zbendhiba !

ref tarilabs/quarkus-content-based-routing@b22373b#diff-9c5fb3d1b7e3b0f54bc5c4182965c4fe1f9023d449017cece3005d3f90e8e4d8L91-R91

It worked as expected on this end with the demo originally referenced 🚀

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