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 378C7200C77 for ; Mon, 1 May 2017 18:17:08 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 3620C160BBD; Mon, 1 May 2017 16:17:08 +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 7D58B160BAB for ; Mon, 1 May 2017 18:17:07 +0200 (CEST) Received: (qmail 24657 invoked by uid 500); 1 May 2017 16:17:06 -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 24646 invoked by uid 99); 1 May 2017 16:17:06 -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; Mon, 01 May 2017 16:17:06 +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 1B864180533 for ; Mon, 1 May 2017 16:17:06 +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-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id yFxMSTZafRCr for ; Mon, 1 May 2017 16:17:05 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id DF06A5F3BB for ; Mon, 1 May 2017 16:17: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 6FD94E06CF for ; Mon, 1 May 2017 16:17: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 2A51F21DE3 for ; Mon, 1 May 2017 16:17:04 +0000 (UTC) Date: Mon, 1 May 2017 16:17:04 +0000 (UTC) From: "Thomas Watson (JIRA)" To: dev@felix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (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: Mon, 01 May 2017 16:17:08 -0000 [ https://issues.apache.org/jira/browse/FELIX-5627?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Thomas Watson resolved FELIX-5627. ---------------------------------- Resolution: Fixed I opened FELIX-5628 to track the global lock problem as a separate issue. Marking this issue as resolved. > 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)