Continuing to support the R6 LogService made the logging in SCR way more
complicated, but yes I agree the impl now requires an R7 log service impl
and that could be surprising.

Tom

On Fri, Sep 4, 2020 at 8:40 AM Jean-Baptiste Onofre <[email protected]> wrote:

> Yes, ds.log configuration doesn’t help :/
>
> About the versioning, my point is more that with log package version
> change, we are more R7 only and not compliant with R6 anymore.
> That’s not a big deal but a bit "surprising", especially the fact that log
> package is not really optional anymore.
>
> I’m also taking on look on SCR to find a potential solution.
>
> Regards
> JB
>
> > Le 4 sept. 2020 à 15:18, Thomas Watson <[email protected]> a écrit :
> >
> > As the code is today the import for log has to be mandatory.  I'll take a
> > quick look to see if we can make this optional again, but I suspect it
> will
> > be a bit of work.  I'll let you know the feasibility today.
> > I'm fine with bumping the version to 2.2.0 if we think that is required
> > when we update the minor version for an import range.
> >
> > Tom
> >
> > On Fri, Sep 4, 2020 at 4:05 AM Jean-Baptiste Onofre <[email protected]>
> wrote:
> >
> >> Hi guys,
> >>
> >> I tested (during the vote) Felix SCR 2.1.22 without problem in Karaf
> >> 4.3.0-SNAPSHOT (using Pax Logging 2.x).
> >>
> >> This morning I tested SCR 2.1.22 on Karaf 4.2.10-SNAPSHOT (with Pax
> >> Logging 1.x), and I have the issue: the activator doesn’t start at all:
> >>
> >> org.osgi.framework.BundleException: Activator start error in bundle
> >> org.apache.felix.scr [48].
> >>                at
> >> org.apache.felix.framework.Felix.activateBundle(Felix.java:2290)
> >>                at
> >> org.apache.felix.framework.Felix.startBundle(Felix.java:2146)
> >>                at
> >> org.apache.felix.framework.BundleImpl.start(BundleImpl.java:998)
> >>                at
> >> org.apache.felix.framework.BundleImpl.start(BundleImpl.java:984)
> >>                at
> >>
> org.apache.karaf.features.internal.service.BundleInstallSupportImpl.startBundle(BundleInstallSupportImpl.java:165)
> >>                at
> >>
> org.apache.karaf.features.internal.service.FeaturesServiceImpl.startBundle(FeaturesServiceImpl.java:1153)
> >>                at
> >>
> org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:1036)
> >>                ... 6 more
> >>        Caused by: java.lang.NoClassDefFoundError:
> >> org/osgi/service/log/LoggerFactory
> >>                at
> >> org.apache.felix.scr.impl.logger.LogManager.<init>(LogManager.java:59)
> >>                at
> >>
> org.apache.felix.scr.impl.logger.ScrLogManager.<init>(ScrLogManager.java:62)
> >>                at
> >>
> org.apache.felix.scr.impl.logger.ScrLogManager.scr(ScrLogManager.java:58)
> >>                at
> >> org.apache.felix.scr.impl.Activator.start(Activator.java:119)
> >>                at
> >>
> org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:697)
> >>                at
> >> org.apache.felix.framework.Felix.activateBundle(Felix.java:2240)
> >>                ... 12 more
> >>        Caused by: java.lang.ClassNotFoundException:
> >> org.osgi.service.log.LoggerFactory not found by org.apache.felix.scr
> [48]
> >>                at
> >>
> org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1639)
> >>                at
> >>
> org.apache.felix.framework.BundleWiringImpl.access$200(BundleWiringImpl.java:80)
> >>                at
> >>
> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2053)
> >>                at
> >> java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
> >>                ... 18 more
> >>
> >> So, it seems that org.osgi.service.log.LoggerFactory is now a strong
> >> requirement, whereas the org.osgi.service.log package is optional in
> >> Import-Package:
> >>
> >> org.osgi.service.log;resolution:=optional;version="[1.4,2)"
> >>
> >> This import is not satisfied in Karaf 4.2.x as Pax Logging exports 1.3.0
> >> version.
> >>
> >> This requirement has been introduced by this commit:
> >>
> >> commit 18d37af0cc3b6a1392dc2053ae97a5577adfa0e5
> >> Author: Peter Kriens <[email protected]>
> >> Date:   Thu Jul 23 16:39:40 2020 +0200
> >>
> >>    [scr] Logging Extension
> >>
> >>
> >> So basically, I have several questions:
> >>
> >> 1. If org.osgi.service.log package is required, we should not flag as
> >> optional in Import-Package right ?
> >> 2. It sounds like a non backward compatible change to me, so, maybe it
> >> would have been better to bump version to 2.2.0 instead of 2.1.22.
> Thoughts
> >> ?
> >> 3. Do you think it’s a problem to extend the range to [1.3,2) ?
> >>
> >> Anyway, I gonna take a deeper look to see if I can find a fix for Karaf
> >> 4.2.x (testing extending the range and/or upgrading Pax Logging).
> >>
> >> Regards
> >> JB
>
>

Reply via email to