brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aled Sage (JIRA)" <>
Subject [jira] [Created] (BROOKLYN-423) Upgrade cxf to 3.1.9 (in karaf)
Date Mon, 09 Jan 2017 14:09:58 GMT
Aled Sage created BROOKLYN-423:

             Summary: Upgrade cxf to 3.1.9 (in karaf)
                 Key: BROOKLYN-423
             Project: Brooklyn
          Issue Type: Improvement
    Affects Versions: 0.10.0
            Reporter: Aled Sage
            Priority: Minor

For why we want this, see (upgrading cxf to 3.1.9,
and httpcomponents.httpclient to 4.5.2).

Also see, which attempts to update httpcomponents'
httpcore and httpclient. However, that breaks winrm4j if we don't also upgrade cxf (according
to Svet's comment).

However, cxf 3.1.9 pulls in {{;version=2.0.1}}, which causes jclouds to fail to
start because that needs 1.1.0 >= version < 2.0.0. The 2.0.1 version comes from feature
cxf-core, which depends on feature cxf-specs, which depends on bundle org.apache.servicemix.specs.jsr339-api-2.0.1
(bundle version 2.6.0, but exports {{;version=2.0.1}})).

The jclouds error is:
2017-01-09 09:48:52,714 ERROR  40 o.a.k.s.s.ShellUtil [nsole user karaf] Exception caught
while executing command
org.osgi.service.resolver.ResolutionException: Unable to resolve jclouds-core/2.0.0: missing
requirement [jclouds-core/2.0.0] osgi.wiring.package; filter:="(&(>=1.1.0)(!(version>=2.0.0)))"
        at org.apache.felix.resolver.ResolutionError.toException([org.apache.felix.framework-5.4.0.jar:]
        at org.apache.felix.resolver.ResolverImpl.resolve([org.apache.felix.framework-5.4.0.jar:]
        at org.apache.felix.resolver.ResolverImpl.resolve([org.apache.felix.framework-5.4.0.jar:]
        at org.apache.karaf.features.internal.region.SubsystemResolver.resolve([11:org.apache.karaf.features.core:4.0.4]
        at org.apache.karaf.features.internal.service.Deployer.deploy([11:org.apache.karaf.features.core:4.0.4]
        at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision([11:org.apache.karaf.features.core:4.0.4]
        at org.apache.karaf.features.internal.service.FeaturesServiceImpl$[11:org.apache.karaf.features.core:4.0.4]
        at java.util.concurrent.ThreadPoolExecutor.runWorker([:1.8.0_111]
        at java.util.concurrent.ThreadPoolExecutor$[:1.8.0_111]

Looking at Brooklyn 0.10.0, it does include both 1.x and 2.x of
karaf@brooklyn()> package:exports | grep
...                                                       | 1.1.1            | 185
| org.apache.servicemix.bundles.jersey-core                                                       | 2.0.0            | 194
| org.apache.servicemix.specs.jsr339-api-2.0

However, adding both bundle versions 1.1.1 and 2.0.1 gives the error shown below:

2017-01-09 10:25:41,238 ERROR  40 o.a.k.s.s.ShellUtil [nsole user karaf] Exception caught
while executing command
org.osgi.service.resolver.ResolutionException: Uses constraint violation. Unable to resolve
resource []
because it is exposed to package '
rs' from resources [] and org.apache.servicemix.specs.jsr311-api-1.1.1
[org.apache.servicemix.specs.jsr311-api-1.1.1/2.7.0] via two dependency chains.

Chain 1: []
    import: (&(>=2.0.0)(!(version>=3.0.0)))
    export: osgi.wiring.package: []

Chain 2: []
    import: (&(osgi.wiring.package=io.swagger.jaxrs.listing)(version>=1.5.0)(!(version>=2.0.0)))
    export: osgi.wiring.package=io.swagger.jaxrs.listing;
  io.swagger.jaxrs [io.swagger.jaxrs/1.5.6]
    import: (&(>=1.1.0)(!(version>=3.0.0)))
    export: osgi.wiring.package:
  org.apache.servicemix.specs.jsr311-api-1.1.1 [org.apache.servicemix.specs.jsr311-api-1.1.1/2.7.0]

This is because brooklyn-rest-api pom.xml explicitly adds the OSGi import {{;version="[1.1,2.0]}},
with the commit (6f624c78b1e7fe72c6df1ecd297b922721b2c023) comment:
    There is no standard JAX-RS way to process multipart/form-data contents,
    so this service was removed from the API for the purpose of unifying the
    CXF and Jersey API.
    * Adjust OSGi package import directives to allow a version range of 1.1 to
    2.0 of JAX-RS directives.

Removing that from the pom (so brooklyn-rest-api depends on {{;version="[2.0,3)"}}),
it seems to work (without having tested any api calls that require multipart/form-data).

However, it refreshes cxf core (and thus many other bundles) because of:
2017-01-09 11:31:43,748 INFO   11 o.a.k.f.i.s.FeaturesServiceImpl [pool-14-thread-1]     org.apache.httpcomponents.httpasyncclient/4.1.2
(Attached fragments changed: [org.apache.brooklyn.karaf-httpcomponents-extension/0.11.0.SNAPSHO

The only purpose of
is to work around a bu in the httpasyncclient OSGi bundle (as described in the commit message

commit 470dda2ced543bf68f4ae931c5c7090a08d799f3
Author: Svetoslav Neykov <>
Date:   Wed Aug 31 19:33:20 2016 +0300

    Fix winrm4j in Karaf
    winrm4j version update has fixed for OSGi. Also adding an extension bundle to httpcomponents-asyncclient
so that it's able to see org.apache.http.ssl package (that's fixed in later revision releases
of the jar).

This leads us back to, which attempts to
bump the httpclient and httpcore versions to 4.5.2 and 4.4.5 respectively. If we also update
httpasyncclient then we shouldn't need that.

This message was sent by Atlassian JIRA

View raw message