Announcement Announcement Module
No announcement yet.
Loading different versions of bundle in Spring OSGi Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Loading different versions of bundle in Spring OSGi

    Hi all,

    This is my first post in this forum.
    U people are doing great. This forum is my usual stop for my queries.

    My problem is similar post

    I have 3 bundles

    Bundle C has two versions say 1.0.0 and 1.1.0

    Bundle dependency is as follows:
    A-> B-> C1.0.0

    All bundles started for me without any problem

    As mentioned one of my class in Bundle A is refering to some service in Bundle C of version 1.1.0 and B refering to C1.0.0
    But when i run the application both bundle A and B is using same version 1.1.0. But both C1.0.0 and C1.1.0 is active.

    Even i tried the samples given by dewanto. Both Solution and Pricing bundle using Udm 1.1.0, even though other version of Udm bundle is active. I wonder whether this worked for dewanto?

    As per my understanding it should refer to services of corresponding versions.

    Pls help me to solve this. very urgent!!

  • #2
    What versions have you specified in bundle A's manifest for its dependencies that are satisfied by bundle C? You can force bundle A to depend on version 1.1.0 of bundle C by using appropriate versions. For example if your two C bundles have the following manifests:

    Bundle-SymbolicName: c
    Bundle-Version: 1.0.0
    Export-Package: c;version="1.0.0"
    Bundle-SymbolicName: c
    Bundle-Version: 1.1.0
    Export-Package: c;version="1.1.0"
    You can force Bundle A to depend upon Bundle C 1.1.0 by versioning its import of package c:

    Bundle-SymbolicName: a
    Bundle-Version: 1.0
    Import-Package: c;version="[1.1.0,2.0)"
    I've used a version range here that means it needs to import c at a version between 1.1.0 inclusive and 2.0 exclusive.


    • #3
      by mentioning the version like below worked.

      Thanks Andy