Return-Path: X-Original-To: apmail-felix-dev-archive@www.apache.org Delivered-To: apmail-felix-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0C35117811 for ; Mon, 27 Oct 2014 09:26:40 +0000 (UTC) Received: (qmail 97579 invoked by uid 500); 27 Oct 2014 09:26:34 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 97494 invoked by uid 500); 27 Oct 2014 09:26:33 -0000 Mailing-List: contact dev-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list dev@felix.apache.org Received: (qmail 97482 invoked by uid 99); 27 Oct 2014 09:26:33 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Oct 2014 09:26:33 +0000 Date: Mon, 27 Oct 2014 09:26:33 +0000 (UTC) From: "Pierre De Rop (JIRA)" To: dev@felix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (FELIX-3914) Log unsuccessful field injections MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/FELIX-3914?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14184984#comment-14184984 ] Pierre De Rop edited comment on FELIX-3914 at 10/27/14 9:26 AM: ---------------------------------------------------------------- Hello Tuomas; I have committed in revision 1634480 a patch for the logging of unsuccessful field injections. Additionally, non existing dependency callbacks are also logged. Here is an example for an unsuccessful field injection: 2014.10.27 08:33:13 WARNING - Bundle: org.apache.felix.dependencymanager.samples.device.api - Could not inject dependency org.osgi.service.log.LogService to field "log" at any of the following component instances: [org.apache.felix.dependencymanager.samples.device.api.DeviceAccessImpl@142c28a] And here is an example for a non existing dependency callback: 2014.10.27 08:26:29 WARNING - Bundle: org.apache.felix.dependencymanager.samples.device.api - Dependency "setLog" callback not found on componnent instances [org.apache.felix.dependencymanager.samples.device.api.DeviceAccessImpl@fe1a8d] Care has been taken to not log warnings on AbstractDecorator component instances, which are special internal DM components and are not interested in user dependency callbacks (and user autoconfigured dependencies). Also, when a composition of object instances is used (when many objects are used to implement a given service, using Component.setComposition method), then the warn message is logged only if *all* object instances can't be injected using a given field (or dependency callback), because usually, when using objects composition, not all objects in the composition are necessarily needing to be injected with all declared dependencies. If you have a chance to test the DM4 from the sandbox [1] and if you are satisfied, then please change the state of this issue to "Resolved" (I will then close it later, after the DM 4.0.0 is released). thanks ! [1] http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype (see also the README in http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/README in order to import DM4 in bndtools). was (Author: pderop): Hello Tuomas; I have committed in revision 1634480 a patch for the logging of unsuccessful field injections. Additionally, non existing dependency callbacks are also logged. Here is an example for an unsuccessful field injection: 2014.10.27 08:33:13 WARNING - Bundle: org.apache.felix.dependencymanager.samples.device.api - Could not inject dependency org.osgi.service.log.LogService to field "log" at any of the following component instances: [org.apache.felix.dependencymanager.samples.device.api.DeviceAccessImpl@142c28a] And here is an example for a non existing dependency callback: 2014.10.27 08:26:29 WARNING - Bundle: org.apache.felix.dependencymanager.samples.device.api - Dependency "setLog" callback not found on componnent instances [org.apache.felix.dependencymanager.samples.device.api.DeviceAccessImpl@fe1a8d] Care has been taken to not log warnings on AbstractDecorator component instances, which are special internal DM components and are not interested in user dependency callbacks (and user autoconfigured dependencies). Also, when a composition of object instances are used (when many objects are used to implement a given service, using Component.setComposition method), then the warn message is logged only if *all* object instances can't be injected using a given field (or dependency callback), because usually, when using objects composition, not all objects in the composition are necessarily needing to be injected with all declared dependencies. If you have a chance to test the DM4 from the sandbox [1] and if you are satisfied, then please change the state of this issue to "Resolved" (I will then close it later, after the DM 4.0.0 is released). thanks ! [1] http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype (see also the README in http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/README in order to import DM4 in bndtools). > Log unsuccessful field injections > --------------------------------- > > Key: FELIX-3914 > URL: https://issues.apache.org/jira/browse/FELIX-3914 > Project: Felix > Issue Type: Improvement > Components: Dependency Manager > Reporter: Tuomas Kiviaho > Assignee: Pierre De Rop > Fix For: dependencymanager-4.0.0 > > Attachments: ComponentImpl.patch > > > I had an NPE scenario where service dependency's tracked class was not assignable from a field which auto config instance name pointed to. It took me a while to figure out this trivial error because dependency manager only reports if field setting fails but the case where it is not even performed. -- This message was sent by Atlassian JIRA (v6.3.4#6332)