Results 1 to 6 of 6

Thread: A bundle can't import another bundle in same workspace

  1. #1
    Join Date
    Oct 2008
    Posts
    18

    Default A bundle can't import another bundle in same workspace

    Now I am creating simple application by SpringSource dm Server Tools.
    I created two bundles configured by below.

    ### for DTO bundle ###
    Manifest-Version: 1.0
    Bundle-Name: Sample01_dto Bundle
    Bundle-ManifestVersion: 2
    Bundle-SymbolicName: sample01_dto
    Bundle-Version: 1.0.0
    Export-Package: sample.dto

    ### for DAO bundle ###
    Manifest-Version: 1.0
    Bundle-Name: Sample01_dao Bundle
    Bundle-ManifestVersion: 2
    Bundle-SymbolicName: sample01_dao
    Bundle-Version: 1.0.0
    Import-Package: sample.dto

    DAO depends DTO.
    So, DTO exports its pacage, and DAO imports DTO's package.

    And, eclipse say this error:
    "Import-Package: sample.dto [0.0.0, ∞) could not be resolved".

    I do set "Targeted Runtimes" to dm Server instance for both bundles,
    and when setting DAO's Import-Package to "sample.dto", I used code assist succecesfully.

    Coulde someone tell me how to remove this error?

    My environment is:
    eclipse 3.4 with wtp
    springsource-dm-server-1.0.0.RELEASE
    springsource-dm-server-tools_updatesite_1.1.0_v200809261800

    thanks,
    Kouhei

  2. #2
    Join Date
    Aug 2004
    Location
    Duesseldorf, Germany
    Posts
    1,210

    Default

    Hi Kouhei,

    there are two approaches to enable inter project dependencies within Eclipse.

    1) Create a PAR project and add the two bundles to the PAR using the MANIFEST editor
    2) If you don't want to create a PAR, open the Project Properties (not a classpath dependency) and define a Project Reference from the importing project to exporting project

    Re-save your MANIFEST files to trigger a refresh of the class path container and validation.

    HTH

    Christian
    Christian Dupuis
    SpringSource, a division of VMware
    Lead, SpringSource Tools Team
    http://www.springsource.com
    http://twitter.com/cdupuis

  3. #3
    Join Date
    Oct 2008
    Posts
    18

    Default

    Thanks Christian,
    Both solutions works !

    And pleasantly, despite reference another project by eclipse in solution 2),
    referencing project can't see referenced project's not exported packages.
    # expecting behavior.

    Kouhei

  4. #4
    Join Date
    Aug 2004
    Location
    Duesseldorf, Germany
    Posts
    1,210

    Default

    Kouhei,

    Glad that both approaches work for you.

    I will add the section to tooling chapter in the reference documentation that will explain these approaches in case other users experience similar problems.

    PLATFORM-178: document bundle reference approaches using PAR or Project References
    https://issuetracker.springsource.co...e/PLATFORM-178

    Christian
    Christian Dupuis
    SpringSource, a division of VMware
    Lead, SpringSource Tools Team
    http://www.springsource.com
    http://twitter.com/cdupuis

  5. #5
    Join Date
    Aug 2004
    Location
    London, UK
    Posts
    339

    Default

    I'm having the same problem as the OP, but find that neither of the suggested solutions fixes it. Using eclipse 3.3 with the same version of the tool support (1.1.0_v200809261800).

    Anything else I could be missing?

    Cheers,
    Darren Davison.
    Public Key: 0xE855B3EA

  6. #6
    Join Date
    Oct 2008
    Posts
    18

    Default

    Hi, davison,

    for number 2) approach, you should check below.

    In ecllipse's Property Dialog for bundle project,
    * check "Targeted Runtimes" setting to point dm server
    * check "Project Reference" setting to reference import bundle project.

    And be sure to
    * update MANIFEST.MF file (like add break line at last line) and save.
    (It trigger validation)

    I hope this will help.

    Kouhei

Posting Permissions

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