tags:

views:

143

answers:

1

Hi all!

I've got a running equinox osgi framework with a bunch of started bundles. Now i update a bundle using the osgi console via 'update . (or use provided method: bundle.update(url));

Everything works perfectly... but if i completly restart the osgi framework the previously updated bundle is in the original state again (as it was before the update).

I'm using the update.configurator of eclipse to search all bundles in the plugins directory and install them but i thought it recognizes if a bundle had been updated.

Can somebody drop me a hint what i'm missing?

thanks, Michael Mangeng

A: 

How are you starting Equinox? Are you starting with -clean (which would wipe out any updates)?

Note that the 'udpate' just updates the in-memory running copy, rather than changing any bits on the original JAR on disk. If you're starting up equinox and passing in the old bundle (but not the new one) then it might come back as the old state.

P2 gets in the way somewhat in assuming that once you've cut the bits of a bundle, then it remains the same thereafter - in other words, P2 effectively breaks doing bundle.update() in the first place. However, you probably should manage the bits on disk so that even if someone does do a -clean, you get the right data.

AlBlue
hi!no i don't start it with -clean. currently i'm using equinox 3.2 because i never swapped to a higher version.maybe the problem is that i thought that bundle.update(...) stores the uploaded version of the bundle in the configuration area (which is done for a series of bundles... don't know the rules when a jar is stored there and when not).if this is the case.. i'll change my code so that a upload stores the file to the filesystem first and then delete the old version.if that is the corret approach.sad that i cannot use bundle.update(InputStream in) in this case.what do ou think?
Michael Mangeng
The OSGi spec doesn't say anything about what should persistently happen after the restart; only that it should bring it back in. I don't think the update itself will update the persistent bundle - especially for a file-based bundle. I'm not sure what would happen if you installed a bundle from a remote URL and did the update.In any case, this area of the spec is undefined in this case :-)Note that you can still use bundle.update(InputStream) if you want; however, you'll have to arrange for the bits to be updated in-place in the right location and then (afterwards) call update().
AlBlue
i'll change my impl to make it replace the original file-based bundle.thanks for you help!
Michael Mangeng