Results 1 to 2 of 2

Thread: how to reference class in another par

  1. #1
    Join Date
    Feb 2009
    Posts
    6

    Angry 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. #2
    Join Date
    Oct 2008
    Location
    Winchester, UK
    Posts
    535

    Default

    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.
    Glyn Normington
    SpringSource

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •