Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 141BB200C72 for ; Fri, 28 Apr 2017 07:32:10 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 12B1E160BB2; Fri, 28 Apr 2017 05:32:10 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 596A7160BA7 for ; Fri, 28 Apr 2017 07:32:09 +0200 (CEST) Received: (qmail 97616 invoked by uid 500); 28 Apr 2017 05:32:08 -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 97604 invoked by uid 99); 28 Apr 2017 05:32:08 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Apr 2017 05:32:08 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id C0D45183991 for ; Fri, 28 Apr 2017 05:32:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id IDITU4avBL8U for ; Fri, 28 Apr 2017 05:32:05 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id F018C5F485 for ; Fri, 28 Apr 2017 05:32:04 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 4AFF6E042C for ; Fri, 28 Apr 2017 05:32:04 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 0C28621DD5 for ; Fri, 28 Apr 2017 05:32:04 +0000 (UTC) Date: Fri, 28 Apr 2017 05:32:04 +0000 (UTC) From: "Carsten Ziegeler (JIRA)" To: dev@felix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (FELIX-5627) Class loading issues while finding fields causes an NPE MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 28 Apr 2017 05:32:10 -0000 [ https://issues.apache.org/jira/browse/FELIX-5627?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Carsten Ziegeler updated FELIX-5627: ------------------------------------ Fix Version/s: scr-2.0.12 > Class loading issues while finding fields causes an NPE > ------------------------------------------------------- > > Key: FELIX-5627 > URL: https://issues.apache.org/jira/browse/FELIX-5627 > Project: Felix > Issue Type: Bug > Components: Declarative Services (SCR) > Reporter: Thomas Watson > Fix For: scr-2.0.12 > > > See eclipse bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=515873 > The following snippet of an NPE can happen > Caused by: java.lang.NullPointerException > at org.apache.felix.scr.impl.inject.FieldHandler.validateField(FieldHandler.java:279) > at org.apache.felix.scr.impl.inject.FieldHandler.access$500(FieldHandler.java:51) > at org.apache.felix.scr.impl.inject.FieldHandler$NotResolved.resolve(FieldHandler.java:839) > at org.apache.felix.scr.impl.inject.FieldHandler$NotResolved.fieldExists(FieldHandler.java:864) > at org.apache.felix.scr.impl.inject.FieldHandler.fieldExists(FieldHandler.java:918) > This is because org.apache.felix.scr.impl.inject.FieldHandler.findField(SimpleLogger) can return null. In this case it is returning null because of a NoClassDefFoundError which is caught in org.apache.felix.scr.impl.inject.FieldHandler.getField(Class, boolean, boolean, SimpleLogger) and null ultimately is returned. It seems a null check is the correct fix here since later on it appears that null may be used when things are not as expected. > While investigating this issue I found the field handler implementation suffers from the same global lock strategy as the BaseMethod implementation did in FELIX-5615 -- This message was sent by Atlassian JIRA (v6.3.15#6346)