Log service is provided by Karaf (pax logging actually). Can you check your bundle or feature requirement when you build it ? I suspect more a new requirement in your bundle/feature.
I also recommend to upgrade to maven-bundle-plugin 5.1.2 as it fixes an important issue. If you can share your project, I can take a look. Regards JB > Le 9 avr. 2021 à 18:26, Steinar Bang <[email protected]> a écrit : > > >> >>>>>> Jean-Baptiste Onofre <[email protected]>: > >> Hi, >> I don’t see how it’s related to BoM: your missing requirement is at runtime, >> not build time. Maybe you change the maven-bundle-plugin version ? > > I actually have bumped the maven-bundle-plugin version to 5.1.1 on all > affected projects. > > But bumping maven-bundle-plugin didn't affect if the features in > question loads or not, but switching between 4.3.0 and 4.3.1 in the > karaf version makes a difference. > > (I've done a lot of trial and error and git-bisect to find out what made > things fail) > > Of course switching between karaf versions now does two things: > 1. switch the BoM > 2. switch the karaf-maven-plugin, and thereby affects the feature repo > generation of feature repos of the individual bundles > > And it may be the latter that has an effect...? > > Anyway I now have rolled back to karaf.version 4.3.0 for all builds and > the resulting feature loads fine in karaf 4.3.0, but gets a missing > LogService in karaf 4.3.1. > >> Let me explain: the requirement is NOT a missing package, but a missing >> service (osgi.service; effective:=active). > > Yes I saw that, I just couldn't figure out what the problem was, > because: > 1. There was no version indication on the service requirement (which I > e.g. got when trying to run bundles built with LogService 1.4 on > karaf 4.2.11) > 2. I thought the LogService always would be present in karaf so I > couldn't understand why it would be missing...? > >> Your bundle header contains a requirement (in the MANIFEST) like >> Require-Service. > >> If you use pax-logging-log4j2 (2.0.8 for instance), it provides this >> capability: > >> Provide-Capability: osgi.service;effective:=active;objectClass="org.os >> gi.service.log.LogService,org.osgi.service.log.LoggerFactory,org.ops4 >> j.pax.logging.PaxLoggingService,org.osgi.service.cm.ManagedService";u >> ses="org.osgi.service.log" > >> A simple workaround is to say to and to not generate the Require-Service >> requirement (if you use scr it’s with norequirement option on -dsannotation). > > Hm... but I *do* have LogService SCR injections into my components and I > use the LogService in my code. > > Is the LogService no longer a part of karaf? > >> You can also provide the capability in a feature (assuming you don’t use >> pax-logging-log4j2). > > Hm... do I need to reference a feature from pax-logging-log4j to get the > LogService? > > Thanks! > > > - Steinar >
