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?

oconnor0
  • 3,154
  • 6
  • 34
  • 52

2 Answers2

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?

Community
  • 1
  • 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 '12 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!

Tim
  • 2,831
  • 1
  • 25
  • 37
  • 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 '11 at 19:05