You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Karl Pauls (JIRA)" <ji...@apache.org> on 2017/06/21 13:30:00 UTC

[jira] [Assigned] (FELIX-5627) Class loading issues while finding fields causes an NPE

     [ https://issues.apache.org/jira/browse/FELIX-5627?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Karl Pauls reassigned FELIX-5627:
---------------------------------

    Assignee: Karl Pauls

> 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
>            Assignee: Karl Pauls
>             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.4.14#64029)