Announcement Announcement Module
Collapse

Spring Dynamic Modules forum decommissioned in favor of Eclipse Gemini Blueprint

With the official first release of Eclipse Gemini Blueprint shipped, the migration of the Spring Dynamic Modules code base to the Eclipse Foundation, as part of the Gemini project, has been completed.

As such, this forum has been decommissioned in favour of the Eclipse Gemini forums.
See more
See less
Services are not published Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Services are not published

    Hello,

    I am using Spring DM 2.0.0.M1 and I am facing a basic problem (it seems).

    In a single bundle:
    - I have an interface A
    - I have a basic implementation B of this interface A
    - I have a consumer C which uses one instance of my service A

    In the spring context:
    - I create a bean of the basic implementation B and I publish it as a service of my interface A
    - I create a bean of my consumer C which uses a required service A.

    At runtime, the dependency "C requires A" is created (I saw it in log file), but B is never published as service so C is never available as well.

    It works if I make one of the changes:
    - I link C with the bean B instead of the service A
    - I change the availabilty of the A service in C to "optional"

    This shows that globally my project can work.
    However, I don't want to link C with B because B is supposed to be an "emergency implementation" (ranking 0).
    And I need the A service to be not-null, so the "optional" does not please me.

    Have I to publish the B bean in a separate bundle?

  • #2
    To reach your goal,you should have to publish the B bean in a seperate bundle.

    if you insist to push them together, I suggest you to link C with B, B can be lazily created while no matched implementaion is found from the OSGI Services(by catching ServiceUnavailableException).

    Comment

    Working...
    X