Actually it's not really a bug in Pax-Logging, as the feature.xml is
provided by Karaf.
And it's easy to fix for us, cause we just need to add this capability to
the feature.xml of the pax-logging feature we have in Karaf.

we just need to add the following snippet to the feature.xml

<capability>
osgi.service;objectClass=org.osgi.service.log.LogService
</capability>

regards, Achim


2017-02-22 10:27 GMT+01:00 Christian Schneider <[email protected]>:

> As Tim explained your bundle has the requirement for a LogService OSGi
> service in its Manifest. Since I think karaf 4.0.5 requirements for
> services are also checked by the feature service of karaf. In version
> before these requirements were ignored.
>
> The problem now is that not all bundles that provide such services also
> define a capability for them in their Manifest. So while the actually is a
> LogService in karaf that is provided by pax logging this service is not
> announced statically in the Manifest using a Provide-Capability header. So
> in fact this is a bug in pax-logging as it should provide the capability. I
> will take care of an issue and fix at pax logging.
>
> You can fix this quickly by either switching off the functionality of
> karaf to look into service requirements or by providing the capability in
> config.
>
> 1. Edit etc/org.apache.karaf.features.cfg and set
> serviceRequirements=disable
>
> 2. Edit etc/config.properties and a line to
> org.osgi.framework.system.capabilities=
> osgi.service;effective:=active;objectClass=org.osgi.service.log.LogService
>
> The solution 2 wrongly attributes the LogService to the system bundle but
> this should still work.
>
> Christian
>
>
> On 22.02.2017 10:09, Timothy Ward wrote:
>
>> The missing requirement indicates that you need a Log Service
>> implementation (i.e. someone to provide you with the service). The
>> dependency that you’re compiling against is just the API (which is a good
>> thing to compile against) but you actually need an implementation at
>> runtime. Your build tools know that you need this service, and so have
>> added a requirement for the service to your bundle. Your bundle therefore
>> will not resolve until you have installed a bundle which declares that it
>> provides the service!
>>
>> Regards,
>>
>> Tim
>>
>> On 22 Feb 2017, at 09:05, Olivier21 <[email protected]>
>>> wrote:
>>>
>>> Hello,
>>>
>>> I developed a SOAP service which is encapsulated in a kar archive. Then,
>>> I
>>> made a custom karaf distribution from Karaf 4.0.4. Everything works fine
>>> (no
>>> error message in the log files and the service works fine).
>>>
>>> The problem is when I try to do the same thing with Karaf 4.0.8, I got
>>> this
>>> message during the deployement :
>>>
>>> missing requirement [...] osgi.service; effective:=active;
>>> filter:="(objectClass=org.osgi.service.log.LogService)"
>>>
>>> How can I inject the service "org.osgi.service.log.LogService"?
>>>
>>> In my class, I have :
>>>
>>> protected LogService logService;
>>>
>>> public void setLogService( final LogService logService )
>>> {
>>>         this.logService = logService;
>>> }
>>>
>>>
>>> In the file pom.xml, I have :
>>> <dependency>
>>>         <groupId>org.osgi</groupId>
>>>         <artifactId>org.osgi.service.log</artifactId>
>>> </dependency>
>>>
>>> Must I use <import-service> and if yes, what must be the contain of this
>>> element?
>>>
>>> It seems that the LogService service is not satisfied anymore and it
>>> seems
>>> to be the same problem that is specified here :
>>> http://karaf.922171.n3.nabble.com/VOTE-Apache-Karaf-Containe
>>> r-4-0-6-release-td4047647.html
>>>
>>> Please, could you help me please?
>>>
>>> Olivier
>>>
>>>
>>>
>>>
>>> --
>>> View this message in context: http://karaf.922171.n3.nabble.
>>> com/missing-requirement-osgi-service-effective-active-filter
>>> -objectClass-org-osgi-service-log-LogService-tp4049593.html
>>> Sent from the Karaf - User mailing list archive at Nabble.com.
>>>
>>
>
> --
> Christian Schneider
> http://www.liquid-reality.de
>
> Open Source Architect
> http://www.talend.com
>
>


-- 

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master

Reply via email to