Last week I ported another feature from Karaf 3 to 4
When I install this feature in Karaf 4.3.6 then the feature:install command
runs into a OutOfMemoryException.
The Exception occurs in ResolverImpl of Apache Felix.

I enabled the debug logging of the logger org.apache.felix.resolver. I
found out that many time such log messages are written:

2022-02-07 14:08:14,781 | DEBUG | features-3-thread-1 |
org.apache.felix.resolver.ResolverImpl | 18  -
org.apache.karaf.features.core - 4.3.6      | Candidate permutation failed
due to a conflict between imports; will try another if possible. (Uses
constraint violation. Unable to resolve resource
org.apache.servicemix.bundles.jaxb-xjc
[org.apache.servicemix.bundles.jaxb-xjc/2.3.2.1] because it is exposed to
package 'javax.xml.bind' from resources
org.apache.servicemix.specs.jaxb-api-2.2
[org.apache.servicemix.specs.jaxb-api-2.2/2.9.0] and
org.apache.servicemix.specs.jaxb-api-2.3
[org.apache.servicemix.specs.jaxb-api-2.3/2.3.0.2] via two dependency
chains.

Chain 1:
  org.apache.servicemix.bundles.jaxb-xjc
[org.apache.servicemix.bundles.jaxb-xjc/2.3.2.1]
    import:
(&(osgi.wiring.package=javax.xml.bind)(version>=2.0.0)(!(version>=3.0.0)))
     |
    export: osgi.wiring.package: javax.xml.bind
  org.apache.servicemix.specs.jaxb-api-2.2
[org.apache.servicemix.specs.jaxb-api-2.2/2.9.0]

Chain 2:
  org.apache.servicemix.bundles.jaxb-xjc
[org.apache.servicemix.bundles.jaxb-xjc/2.3.2.1]
    import: (osgi.wiring.package=com.sun.xml.bind.unmarshaller)
     |
    export: osgi.wiring.package=com.sun.xml.bind.unmarshaller;
uses:=javax.xml.bind
  org.apache.servicemix.bundles.jaxb-runtime
[org.apache.servicemix.bundles.jaxb-runtime/2.3.2.1]
    import:
(&(osgi.wiring.package=javax.xml.bind)(version>=2.0.0)(!(version>=3.0.0)))
     |
    export: osgi.wiring.package: javax.xml.bind
  org.apache.servicemix.specs.jaxb-api-2.3
[org.apache.servicemix.specs.jaxb-api-2.3/2.3.0.2]) |


% grep -c "Candidate permutation failed"  data/log/karaf.log
7890

% grep -c "Candidate permutation failed.*jaxb-api" data/log/karaf.log
6855

jaxb-api-2.3 comes from apache-cxf-3.4.5-features.xml

system/org/apache/cxf/karaf/apache-cxf/3.4.5/apache-cxf-3.4.5-features.xml
28:        <bundle start-level="10"
dependency="true">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jaxb-api-2.3/2.3_2</bundle>

jaxb-api-2.2 comes from framework-4.3.6-features.xml

system/org/apache/karaf/features/framework/4.3.6/framework-4.3.6-features.xml
47:        <bundle dependency="true"
start-level="30">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jaxb-api-2.2/2.9.0</bundle>


I need CXF for my feature.

Has some an idea how to solve this problem?

Regards

  Richard

Reply via email to