You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "Speckels, Bert" <Be...@btc-ag.com> on 2023/04/06 07:25:55 UTC

Camel 3.20.3: Version mismatch for "stax2-api" results in java.lang.NoSuchMethodError 'org.codehaus.stax2.ri.EmptyIterator'

Problem Description:

When creating a simple SOAP endpoint in Apache Karaf with Camel 3.20.3/2 (tested), the following errors occur when retrieving the WSDL:

HTTP ERROR 500 java.lang.NoSuchMethodError: 'org.codehaus.stax2.ri.EmptyIterator org.codehaus.stax2.ri.EmptyIterator.getInstance()'

Steps to reproduce:

* Start Apache Karaf
* Install simple SOAP endpoint:
  example from karaf/examples/karaf-soap-example at main apache/karaf
  'feature:install karaf-soap-example-blueprint'
* Then access the WSDL from the endpoint: http://localhost:8181/cxf/example?wsdl (works as expected)

* Add Camel's xml-specs-api feature: 'feature:install xml-specs-api'
* Important: Restart Karaf
* Then access the WSDL again: http://localhost:8181/cxf/example?wsdl (The error now occurs!)
   HTTP ERROR 500 java.lang.NoSuchMethodError: 'org.codehaus.stax2.ri.EmptyIterator org.codehaus.stax2.ri.EmptyIterator.getInstance()'

Analaysis:

Different Woodstox versions with different "stax2-api" versions are used in the Apache Camel feature.xml.

https://repo1.maven.org/maven2/org/apache/camel/karaf/apache-camel/3.20.2/apache-camel-3.20.2-features.xml

"xml-specs-api" uses a very old Woodstox version (“woodstox-core-asl:4.4.1”) which requires the stax2-api in version 3.1.4.
However, since "camel-stax" uses the Woodstox version 6.4.0 of com.fasterxml, there is a version conflict here: "woodstox-core-asl:4.4.1" does not work with "stax2-api 4.2.1"

Furthermore, camel-olingo4 references two different stax2-api versions. Is this really correct? Doesn't this cause version conflicts?

----

Currently we solved that problem by replacing bundles in "org.apache.karaf.features.xml".

<bundle mode="maven" originalUri="mvn:org.codehaus.woodstox/woodstox-core-asl/4.4.1" replacement="wrap:mvn:com.fasterxml.woodstox/woodstox-core/6.4.0"/>

With kind regards
Bert Speckels