Results 1 to 2 of 2

Thread: Services are not published

Hybrid View

  1. #1
    Join Date
    May 2010
    Posts
    3

    Default 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. #2
    Join Date
    May 2010
    Posts
    2

    Default

    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).

Posting Permissions

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