There's a bug in Felix SCR which solves this but it is not yet released. I won't be able to do it at least 'till next week.
Sincerely, - Ray On Wed, Aug 1, 2018, 04:59 Philipp Höfler, <philipp.hoef...@pernexas.com> wrote: > Hi, > > I am trying to utilize the new Felix Log Service (1.2.0) with DS. > But no matter what I am trying, the reference is always null. > > I added a field with the annotation in my class. > > @Reference(service = org.osgi.service.log.LoggerFactory.class) > private org.osgi.service.log.Logger _logger; > > In addition, I've added the following two bundles to the -runbundles > property of my bndrun file: > > org.apache.felix.log;version='[1.2.0,1.2.1)',\ > org.apache.felix.log.extension;version='[1.0.0,1.0.1)',\ > > I am not sure, if this is really necessary. > Even if no logger implementation (logback, log4j) is available, I would > have expected that the reference could be resolved? > > But also, when I add logback to the -runbundles, the logger cannot be > resolved and is always null > > ch.qos.logback.classic;version='[1.2.3,1.2.4)',\ > ch.qos.logback.core;version='[1.2.3,1.2.4)',\ > > You can inspect the whole project on GitHub: > > https://github.com/phhoef/osgi-test/blob/master/rest-service/src/main/java/com/my/app/rest/rest/ServerInfoControllerImpl.java > > Thanks >