0

I have a bundle com.elsten.bliss.platform. Here are the wirings before update:

g! inspect capability osgi.wiring.package 59
com.elsten.bliss.platform [59] provides:
----------------------------------------
osgi.wiring.package; com.elsten.bliss.client.impl 1.1.0 required by:
   com.elsten.bliss.ui [33]
osgi.wiring.package; com.elsten.bliss.licence 1.0.1 required by:
   com.elsten.bliss.ui [33]
osgi.wiring.package; com.elsten.bliss.main 2.0.5 required by:
   com.elsten.bliss.ui.systemtray [23]
   com.elsten.bliss.api [40]
osgi.wiring.package; com.elsten.bliss.music.policy.config 1.0.0 required by:
   com.elsten.bliss.ui [33]
   com.elsten.bliss.configuration.file [72]
osgi.wiring.package; com.elsten.bliss.music.policy.coverartpolicy 1.1.0 required by:
   com.elsten.bliss.ui [33]
osgi.wiring.package; com.elsten.bliss.music.policy.coverartpolicy.assessment 1.0.0 required by:
   com.elsten.bliss.ui [33]
osgi.wiring.package; com.elsten.bliss.music.policy.coverartpolicy.response 1.0.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.music.policy.fileorg 1.1.0 required by:
   com.elsten.bliss.ui [33]
osgi.wiring.package; com.elsten.bliss.music.policy.fileorg.pattern 1.0.0 required by:
   com.elsten.bliss.ui [33]
osgi.wiring.package; com.elsten.bliss.music.policy.fileorg.pattern.token 1.0.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.music.policy.tag.auto 1.0.0 required by:
   com.elsten.bliss.untagged.acoustid [52]
osgi.wiring.package; com.elsten.bliss.music.policy.tagsync 1.0.0 required by:
   jdbm-trunk-patched [20]
   com.elsten.bliss.ui [33]
osgi.wiring.package; com.elsten.bliss.music.policy.tagsync.allowablegenres 1.0.0 required by:
   com.elsten.bliss.ui [33]
osgi.wiring.package; com.elsten.bliss.music.policy.tagsync.consolidateartist 1.0.1 [UNUSED]
osgi.wiring.package; com.elsten.bliss.music.policy.tagsync.response 1.0.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.music.policy.tagsync.trackartist 1.0.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.music.policy.tagsync.tracknumberformat 1.0.0 required by:
   jdbm-trunk-patched [20]
osgi.wiring.package; com.elsten.bliss.music.policy2 1.0.1 required by:
   com.elsten.bliss.ui [33]
   com.elsten.bliss.configuration.file [72]
osgi.wiring.package; com.elsten.bliss.platform.storage.bus 1.0.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.platform.storage.file.jaudiotagger 1.0.0 required by:
   jdbm-trunk-patched [20]
osgi.wiring.package; com.elsten.bliss.platform.tagindex 1.0.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.platform.util2 1.0.0 required by:
   com.elsten.bliss.web.debug [14]
osgi.wiring.package; com.elsten.bliss.untagged2 1.0.0 required by:
   com.elsten.bliss.untagged.acoustid [52]
   com.elsten.bliss.ui [33]
osgi.wiring.package; com.elsten.bliss.platform.activity 1.0.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.platform2 1.0.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.platform.storage.file 1.0.0 required by:
   com.elsten.bliss.configuration.file [72]
osgi.wiring.package; com.elsten.bliss.music.conceptual 1.0.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.music.tagged.mapper 1.0.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.platform.storage.file.jaudiotagger.tag 28.1.2 [UNUSED]
osgi.wiring.package; com.elsten.bliss.music.policy.tagsync.regex 28.1.2 [UNUSED]
osgi.wiring.package; com.elsten.bliss.client.platform 1.0.0 [UNUSED]

And services:

g! inspect capability service 59
com.elsten.bliss.platform [59] provides:
----------------------------------------
service; com.elsten.bliss.client.Client with properties:
   service.id = 31
   Used by:
      com.elsten.bliss.ui [33]
service; com.elsten.bliss.licence.PerFixLicenceStore with properties:
   service.id = 32
   Used by:
      com.elsten.bliss.ui [33]
service; com.elsten.bliss.music.policy2.PerFixLicensedPolicyCommandExecutor with properties:
   service.id = 33
service; com.elsten.bliss.main.Platform with properties:
   component.id = 5
   component.name = com.elsten.bliss.main.PlatformImpl
   coverArtLookupStrategy.target = (rootLookupStrategy=true)
   informationSource.target = (getTags=true)
   service.id = 34
   Used by:
      com.elsten.bliss.api [40]
      com.elsten.bliss.ui.systemtray [23]

Now I update, which updates the bundle and a number of bundles besides. I perform this with a management agent coded by myself which uses OBR to update the new bundle versions and then calls refresh.

After this occurs, I set a breakpoint in com.elsten.bliss.main.PlatformImpl so I can test the wirings again. I expect that the old com.elsten.bliss.main.Platform has been removed. However:

g! lb platform
START LEVEL 1
   ID|State      |Level|Name
   59|Active     |    1|com.elsten.bliss.platform (28.1.2)
   84|Resolved   |    1|com.elsten.bliss.platform (28.1.3)

Now there are two versions! So I print the wiring (at this stage the services are not wired so no point in including them):

g! inspect capability osgi.wiring.package 59
com.elsten.bliss.platform [59] provides:
----------------------------------------
osgi.wiring.package; com.elsten.bliss.client.impl 1.1.0 required by:
   com.elsten.bliss.ui [33]
osgi.wiring.package; com.elsten.bliss.licence 1.0.1 required by:
   com.elsten.bliss.ui [33]
   com.elsten.bliss.platform [84]
osgi.wiring.package; com.elsten.bliss.main 2.0.5 required by:
   com.elsten.bliss.ui.systemtray [23]
   com.elsten.bliss.api [40]
osgi.wiring.package; com.elsten.bliss.music.policy.config 1.0.0 required by:
   com.elsten.bliss.ui [33]
   com.elsten.bliss.configuration.file [72]
osgi.wiring.package; com.elsten.bliss.music.policy.coverartpolicy 1.1.0 required by:
   com.elsten.bliss.ui [33]
osgi.wiring.package; com.elsten.bliss.music.policy.coverartpolicy.assessment 1.0.0 required by:
   com.elsten.bliss.ui [33]
osgi.wiring.package; com.elsten.bliss.music.policy.coverartpolicy.response 1.0.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.music.policy.fileorg 1.1.0 required by:
   com.elsten.bliss.ui [33]
osgi.wiring.package; com.elsten.bliss.music.policy.fileorg.pattern 1.0.0 required by:
   com.elsten.bliss.ui [33]
osgi.wiring.package; com.elsten.bliss.music.policy.fileorg.pattern.token 1.0.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.music.policy.tag.auto 1.0.0 required by:
   com.elsten.bliss.untagged.acoustid [52]
osgi.wiring.package; com.elsten.bliss.music.policy.tagsync 1.0.0 required by:
   com.elsten.bliss.ui [33]
osgi.wiring.package; com.elsten.bliss.music.policy.tagsync.allowablegenres 1.0.0 required by:
   com.elsten.bliss.ui [33]
osgi.wiring.package; com.elsten.bliss.music.policy.tagsync.consolidateartist 1.0.1 [UNUSED]
osgi.wiring.package; com.elsten.bliss.music.policy.tagsync.response 1.0.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.music.policy.tagsync.trackartist 1.0.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.music.policy.tagsync.tracknumberformat 1.0.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.music.policy2 1.0.1 required by:
   com.elsten.bliss.ui [33]
   com.elsten.bliss.configuration.file [72]
osgi.wiring.package; com.elsten.bliss.platform.storage.bus 1.0.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.platform.storage.file.jaudiotagger 1.0.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.platform.tagindex 1.0.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.platform.util2 1.0.0 required by:
   com.elsten.bliss.web.debug [14]
osgi.wiring.package; com.elsten.bliss.untagged2 1.0.0 required by:
   com.elsten.bliss.untagged.acoustid [52]
   com.elsten.bliss.ui [33]
osgi.wiring.package; com.elsten.bliss.platform.activity 1.0.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.platform2 1.0.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.platform.storage.file 1.0.0 required by:
   com.elsten.bliss.configuration.file [72]
osgi.wiring.package; com.elsten.bliss.music.conceptual 1.0.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.music.tagged.mapper 1.0.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.platform.storage.file.jaudiotagger.tag 28.1.2 [UNUSED]
osgi.wiring.package; com.elsten.bliss.client.platform 1.0.0 [UNUSED]

And the new bundle:

g! inspect capability osgi.wiring.package 84
com.elsten.bliss.platform [84] provides:
----------------------------------------
osgi.wiring.package; com.elsten.bliss.client.impl 1.1.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.main 2.0.5 [UNUSED]
osgi.wiring.package; com.elsten.bliss.music.policy.config 1.0.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.music.policy.coverartpolicy 1.1.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.music.policy.coverartpolicy.assessment 1.0.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.music.policy.coverartpolicy.response 1.0.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.music.policy.fileorg 1.1.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.music.policy.fileorg.pattern 1.0.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.music.policy.fileorg.pattern.token 1.0.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.music.policy.tag.auto 1.0.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.music.policy.tagsync 1.0.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.music.policy.tagsync.allowablegenres 1.0.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.music.policy.tagsync.consolidateartist 1.0.1 [UNUSED]
osgi.wiring.package; com.elsten.bliss.music.policy.tagsync.response 1.0.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.music.policy.tagsync.trackartist 1.0.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.music.policy.tagsync.tracknumberformat 1.0.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.music.policy2 1.0.1 [UNUSED]
osgi.wiring.package; com.elsten.bliss.platform.storage.bus 1.0.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.platform.storage.file.jaudiotagger 1.0.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.platform.tagindex 1.0.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.platform.util2 1.0.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.untagged2 1.0.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.platform.activity 1.0.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.platform2 1.0.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.platform.storage.file 1.0.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.music.conceptual 1.0.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.music.tagged.mapper 1.0.0 [UNUSED]
osgi.wiring.package; com.elsten.bliss.platform.storage.file.jaudiotagger.tag 28.1.3 [UNUSED]
osgi.wiring.package; com.elsten.bliss.music.policy.tagsync.regex 28.1.3 required by:
   com.elsten.bliss.platform [59]
osgi.wiring.package; com.elsten.bliss.client.platform 1.0.0 [UNUSED]

So the new bundle is barely being used for anything.

My suspicion is that it's something to do with the withdrawal of the com.elsten.bliss.licence package. This was removed, but note that this always existed (before the update):

g! lb licence
START LEVEL 1
   ID|State      |Level|Name
   69|Active     |    1|com.elsten.bliss.licence (1.0.1)
g! inspect capability osgi.wiring.package 69
com.elsten.bliss.licence [69] provides:
---------------------------------------
osgi.wiring.package; com.elsten.bliss.licence 1.0.1 [UNUSED]

So this is an interesting case: I had a split package before update which I didn't know about. However, dependencies for that split package were wired to a bundle that got updated. Subsequent to the bundle update, they are still wired to the old bundle. So does this stop those bundles being re-wired to the extant com.elsten.bliss.licence?

A new idea: before update, ensure that all bundles except for the bootstrap bundle are not started. Then, start Felix with just the bootstrap bundle, check the package wiring, then perform the update.

The results: another pointer to the split com.elsten.bliss.licence package being the problem. After the update, there are again two com.elsten.bliss.platform bundles. However, there is only one wiring on the old version:

osgi.wiring.package; com.elsten.bliss.licence 1.0.1 required by:
    com.elsten.bliss.platform [84]

The new version is now dependent on the old version because of the removed package!

Any advice (including don't have split packages you dimwit!) accepted ;)

Dan Gravell
  • 7,855
  • 7
  • 41
  • 64

1 Answers1

1

Not sure I understand. You have the bundle installed twice (59 and 84). So you did not update 59 with a new jar. So it seems you did not do a bundle update on 59. You just installed the bundle again (84). So this would explain why 59 is still present and probably still in use after the refresh.

BJ Hargrave
  • 9,324
  • 1
  • 19
  • 27
  • I think you forgot the "don't have split packages you dimwit! :-)" BJ! But yes, your management can never have done an update with this result or you got one hell of a strange framework. – Peter Kriens Aug 05 '14 at 16:37
  • Not quite... Originally there was just 59 (v28.1.2). Then I used OBR to deploy a new repository.xml containing v28.1.3 and some other bundles. AFAIK that calls `bundle.update()` under the covers. However, this got deployed as 84, leading to two installations, rather than replacing 28.1.2 as 59, as normally happens. I want to understand why that happened. – Dan Gravell Aug 05 '14 at 18:18
  • 1
    Then you need to check into the code which is doing the management. This is not an OSGi framework problem as far as I can see. – BJ Hargrave Aug 05 '14 at 19:07
  • Sorry for being dumb, but do you mean my code or OBR? This code has been working fine for three years with updates every two weeks over that time. Clearly there's something wrong but I thought it must be a nuance of the wiring. – Dan Gravell Aug 06 '14 at 09:20
  • Clearly there's something wrong but I thought it must be a nuance of the wiring and the way bundle capabilities/requirements have changed between versions. I wondered whether the above (removing a package capability that other bundles depended on when another bundle also has that capability) was covered in the OSGi spec and what the behaviour should be. – Dan Gravell Aug 06 '14 at 09:26
  • 1
    As BJ says, there are two instances of the same BSN: bundle IDs 59 and 84. This can **only** happen if the management layer does an install rather than an update. Whether that is your code or OBR, I don't know... but it's not the framework. – Neil Bartlett Aug 06 '14 at 11:16