Announcement Announcement Module
No announcement yet.
how to reference class in another par Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to reference class in another par

    I packaged one par include one bundle named bundleA,and bundleA export com.a.b package, and it register one component as serviceA.then it is deployed in the springsource dm server 1.0.2 successfully.
    Then I create other one bundleB out of the par.I wanna reference serviceA exported by bundleA,at the BundleB's MANIFEST.MF include " Import-Package:com.a.b;version="[0.0.0,2.0.0)" " , but it always throws "Unsatisfied leaf constraints:
    Bundle: com.a.bundleB_1.2.0.SNAPSHOT - Import-Package: com.a.b; version="[0.0.0,2.0.0)"
    Did you mean: 'com.a.b'?" execption.

    but if bundleA and bundleB deploy in hotdeploy dir pickup, it works well.

    how to reference class in another par?

  • #2
    PARs are scoped which means that packages exported by bundles in the PAR are only available for bundles in the same PAR to import. Similarly, services are scoped unless you explicitly add an attribute, described on another thread, to make them "punch through" the scope.

    So the nearest you can get to the scenario you describe is to make sure the package of the service interface is exported by a bundle outside the PAR so that the PAR bundles and bundles outside the PAR can import that package.