0

I have an Eclipse product build using features. All of the services are registered via Declarative Services. As I understand it, the bundle must be started for the Service Component Runtime to pick up and then register the services exposed in each bundle.

I want to automatically start every bundle that's installed in my OSGi runtime. Is there a simple way to do this? The only thing I can find is the Product > Configuration > Start Levels > Auto-Start option. I don't want to have to do this in every product build that I have since I wanted to move to features to group & to start similar bundles together.

Is there a simple/recommended way to do this?

2 Answers 2

1

I think the stack overflow question/answer[1], comprehensively discuss your requirement. or else if you are using a p2-enabled product, you can set the start-by-default param to 'true' within your bundles.info file. But that is a hacky way.

[1] In Equinox Is it possible to to mark an OSGi bundle as started from its containing feature's p2.inf?

1
  • I ended up creating META-INF/p2.inf with the contents instructions.configure = markStarted(started: true) in each bundle. I don't want to have to configure per feature. Thanks.
    – oconnor0
    Jan 11, 2012 at 21:27
-1

Remove Bundle-ActivationPolicy: lazy from your MANIFEST.MF and make sure that the attribute enabled="false" is not in your component definition!

1
  • This only guarantees that once the containing plugin is started all services will be activated. I want to force start all plugins when Equinox start.
    – oconnor0
    Dec 27, 2011 at 19:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.