Announcement Announcement Module
Collapse
No announcement yet.
A bundle can't import another bundle in same workspace Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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

    Comment


    • #3
      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

      Comment


      • #4
        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

        Comment


        • #5
          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,

          Comment


          • #6
            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

            Comment

            Working...
            X