Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » My bundles need a library in two versions, but only one is deployed.
My bundles need a library in two versions, but only one is deployed. [message #1754861] Thu, 23 February 2017 09:48
Jens Rabe is currently offline Jens RabeFriend
Messages: 81
Registered: September 2013
Member
My application builds on the Eclipse Workbench and also needs to include M2E which needs at most Guava 16.0.0. My own bundle needs Guava 16.0.1. So I ticked both Guava 15 and Guava 16.0.1 in my run configuration:

https://i.stack.imgur.com/elpAe.png

However, when running the run configuration, I get:

org.osgi.framework.BundleException: Could not resolve module: my.bundle [92]
  Unresolved requirement: Import-Package: com.google.common.base; version="[16.0.1,19.0.0)"


When I enable the OSGi console and enter "ss", I indeed see that only Guava 15 is deployed.

EDIT: When I manually install Guava 16.0.1 and try to start my bundle from the console, I get the following:

    gogo: BundleException: Could not resolve module: my.bundle [238]
      Bundle was not resolved because of a uses contraint violation.
      org.osgi.service.resolver.ResolutionException: Uses constraint violation. Unable to resolve resource my.bundle [osgi.identity; type="osgi.bundle"; version:Version="0.1.0.qualifier"; osgi.identity="my.bundle"; singleton:="true"] because it is exposed to package 'com.google.common.collect' from resources com.google.guava [osgi.identity; type="osgi.bundle"; version:Version="15.0.0.v201403281430"; osgi.identity="com.google.guava"] and com.google.guava [osgi.identity; type="osgi.bundle"; version:Version="16.0.1"; osgi.identity="com.google.guava"] via two dependency chains.

    Chain 1:
      my.bundle [osgi.identity; type="osgi.bundle"; version:Version="0.1.0.qualifier"; osgi.identity="my.bundle"; singleton:="true"]
        require: (osgi.wiring.bundle=org.eclipse.xtext.xbase.lib)
         |
        provide: osgi.wiring.bundle: org.eclipse.xtext.xbase.lib
      com.google.guava [osgi.identity; type="osgi.bundle"; version:Version="15.0.0.v201403281430"; osgi.identity="com.google.guava"]
    
    Chain 2:
      my.bundle [osgi.identity; type="osgi.bundle"; version:Version="0.1.0.qualifier"; osgi.identity="my.bundle"; singleton:="true"]
        require: (&(osgi.wiring.bundle=com.datastax.driver.core)(bundle-version>=3.0.0))
         |
        provide: osgi.wiring.bundle; bundle-version:Version="3.0.0"; osgi.wiring.bundle="com.datastax.driver.core"
      com.datastax.driver.core [osgi.identity; type="osgi.bundle"; version:Version="3.0.0"; osgi.identity="com.datastax.driver.core"]
        import: (&(osgi.wiring.package=com.google.common.reflect)(&(version>=16.0.1)(!(version>=19.0.0))))
         |
        export: osgi.wiring.package: com.google.common.reflect; uses:=com.google.common.collect
        export: osgi.wiring.package=com.google.common.collect
      com.google.guava [osgi.identity; type="osgi.bundle"; version:Version="16.0.1"; osgi.identity="com.google.guava"]


EDIT 2:

I split the failing bundle in two so the two dependency chains are gone. However, I still have to manually deploy Guava 16.0.1 into the running container after starting.

So, the question that remains, is:

How do I get both versions of Guava to deploy automatically?

[Updated on: Thu, 23 February 2017 10:32]

Report message to a moderator

Previous Topic:Force buddy classloading programmatically
Next Topic:ProvisioningAction not Found
Goto Forum:
  


Current Time: Thu Apr 25 20:53:14 GMT 2024

Powered by FUDForum. Page generated in 0.02853 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top