Moritz
Moritz

Reputation: 1125

OSGi bundle remains "installed" without conflicts

In an OSGi-environment using Apache Felix file-install, one of the bundles does not work.

At first, the bundle does not appear at all; however I can install it manually. It becomes INSTALLED (not RESOLVED as it should):

osgi>install file:///path/to/my/bundle.jar
Bundle id is 230

osgi>diag 230
file:///[...]
 No unresolved constraints

osgi>ss <filter>
id    State       Bundle
230   INSTALLED   <bundle-name>

I can start the bundle with start 230, and everything works (services start). After stopping the bundle with stop 230, the bundle is RESOLVED; after update 230 however the bundle enters state INSTALLED again.

How can I identify the cause why the bundle is not RESOLVED automatically?

Upvotes: 0

Views: 233

Answers (1)

Marcel Offermans
Marcel Offermans

Reputation: 3323

This is by design:

  • Installing a bundle will leave it in installed.
  • When you try to start a bundle, the resolver will first try to resolve it's dependencies, if it succeeds it will transition to resolved and from there to started.
  • When you stop a bundle, it will transition back to resolved (no need to un-resolve anything at this point as you might want to start it again).
  • When you update a resolved bundle, regardless of the fact if this is really a different version of the bundle or not, it will be seen as "new" and it will go to installed state.

So in short: updating a resolved bundle will leave the new version of it in installed state by design.

Upvotes: 3

Related Questions