[ 
https://issues.apache.org/jira/browse/CAMEL-17137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17494598#comment-17494598
 ] 

Rastislav Papp edited comment on CAMEL-17137 at 2/18/22, 2:03 PM:
------------------------------------------------------------------

This works when installing manually, but not when creating custom 
karaf-assembly (based on 4.3.6, via maven plugin). We create one with boot 
features from camel/3.14.1 and cxf/3.4.5, but karaf fails with:

{code}
org.apache.felix.resolver.reason.ReasonException: Unable to resolve 
com.sun.xml.messaging.saaj.impl/1.5.2: missing requirement 
[com.sun.xml.messaging.saaj.impl/1.5.2] osgi.wiring.package; 
filter:="(&(osgi.wiring.package=org.jvnet.staxex)(version>=1.8.0)(!(version>=2.0.0)))"
        at 
org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
 ~[?:?]
{code}

This is because camel-cxf 3.14.1 depends on a cxf feature using range 
[3.4,3.4], and somehow karaf tries to install it during boot stage, even though 
we define our own cxf repository+feature versions. It ends up installing cxf 
version 3.4.0. 

In the past we could blacklist camel's cxf feature in karaf, but now that it is 
defined via range, the blacklisting stopped working:

{code}
2022-02-18T13:57:35,135 | WARN  | activator-1-thread-2 |  | 
org.apache.karaf.features.core - 4.3.6 | LocationPattern                  |  | 
Matched URI can't use version ranges: 
mvn:org.apache.cxf.karaf/apache-cxf/[3.4,3.4]/xml/features
{code}
{code:java}
        if (other.versionRange != null) {
            LOG.warn("Matched URI can't use version ranges: " + otherUri);
            return false;
        }
{code}

Only solution for us is to create custom camel feature, by copying the real 
one, and deleting the cxf repository dependency.

cc: [~davsclaus], [~jbonofre]


furthermore, I'm not sure about the version range itself, does [3.4, 3.4] mean 
the same as [3.4, 3.5)? Because after creating the custom feature, it seems 
that camel-cxf-transport bundle requires cxf-core/3.4.0 exactly, and fails when 
having cxf-core/3.4.5:
{code}
Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to resolve 
org.apache.camel.camel-cxf-transport/3.14.1: missing requirement 
[org.apache.camel.camel-cxf-transport/3.14.1] osgi.wiring.package; 
filter:="(&(osgi.wiring.package=org.apache.cxf)(version>=3.4.0)(version<=3.4.0))"
{code}


was (Author: rastislav.papp):
This works when installing manually, but not when creating custom 
karaf-assembly (based on 4.3.6, via maven plugin). We create one with boot 
features from camel/3.14.1 and cxf/3.4.5, but karaf fails with:

{code}
org.apache.felix.resolver.reason.ReasonException: Unable to resolve 
com.sun.xml.messaging.saaj.impl/1.5.2: missing requirement 
[com.sun.xml.messaging.saaj.impl/1.5.2] osgi.wiring.package; 
filter:="(&(osgi.wiring.package=org.jvnet.staxex)(version>=1.8.0)(!(version>=2.0.0)))"
        at 
org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
 ~[?:?]
{code}

This is because camel-cxf 3.14.1 depends on a cxf feature using range 
[3.4,3.4], and somehow karaf tries to install it during boot stage, even though 
we define our own cxf repository+feature versions. It ends up installing cxf 
version 3.4.0. 

In the past we could blacklist camel's cxf feature in karaf, but now that it is 
defined via range, the blacklisting stopped working:

{code}
2022-02-18T13:57:35,135 | WARN  | activator-1-thread-2 |  | 
org.apache.karaf.features.core - 4.3.6 | LocationPattern                  |  | 
Matched URI can't use version ranges: 
mvn:org.apache.cxf.karaf/apache-cxf/[3.4,3.4]/xml/features
{code}
{code:java}
        if (other.versionRange != null) {
            LOG.warn("Matched URI can't use version ranges: " + otherUri);
            return false;
        }
{code}

Only solution for us is to create custom camel feature, by copying the real 
one, and deleting the cxf repository dependency.

cc: [~davsclaus], [~jbonofre]


> camel-karaf - Error while adding camel-cxf
> ------------------------------------------
>
>                 Key: CAMEL-17137
>                 URL: https://issues.apache.org/jira/browse/CAMEL-17137
>             Project: Camel
>          Issue Type: Bug
>          Components: came-cxf, karaf
>    Affects Versions: 3.11.3, 3.12.0
>            Reporter: Kiryanov Vlad
>            Priority: Minor
>             Fix For: 3.14.1, 3.15.0, 3.11.6
>
>         Attachments: karaf.log
>
>
> Hello!
> In Karaf 4.3.2 while add camel-cxf an error occurs
> 2021-10-27T11:59:22,050 | ERROR | Karaf local console user karaf | ShellUtil 
> | 43 - org.apache.karaf.shell.core - 4.3.2 | Exception caught while executing 
> command
> org.apache.felix.resolver.reason.ReasonException: Unable to resolve root: 
> missing requirement [root] osgi.identity; osgi.identity=camel-cxf; 
> type=karaf.feature; version="[3.11.3,3.11.3]"; 
> filter:="(&(osgi.identity=camel-cxf)(type=karaf.feature)(version>=3.11.3)(version<=3.11.3))"
>  [caused by: Unable to resolve camel-cxf/3.11.3: missing requirement 
> [camel-cxf/3.11.3] osgi.identity; osgi.identity=cxf-core; type=karaf.feature; 
> version="[3.3.0,4.0.0)"]
>  at 
> org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
>  ~[?:?]
>  at org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:433) 
> ~[?:?]
>  at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:420) 
> ~[?:?]
>  at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:374) 
> ~[?:?]
>  at 
> org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:257)
>  ~[?:?]
>  at 
> org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:399) 
> ~[?:?]
>  at 
> org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1069)
>  ~[?:?]
>  at 
> org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:1004)
>  ~[?:?]
>  at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
>  at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
>  ~[?:?]
>  at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
>  ~[?:?]
>  at java.lang.Thread.run(Thread.java:834) [?:?]
> Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to 
> resolve camel-cxf/3.11.3: missing requirement [camel-cxf/3.11.3] 
> osgi.identity; osgi.identity=cxf-core; type=karaf.feature; 
> version="[3.3.0,4.0.0)"
>  at 
> org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
>  ~[?:?]
>  ... 12 more



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to