You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "James Watkins-Harvey (JIRA)" <ji...@apache.org> on 2016/08/02 17:04:20 UTC
[jira] [Commented] (FELIX-5316) Updating from SCR 2.0.2 to SCR
2.0.4 leads to nullpointers
[ https://issues.apache.org/jira/browse/FELIX-5316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15404393#comment-15404393 ]
James Watkins-Harvey commented on FELIX-5316:
---------------------------------------------
The bug has been introduced in r1744739 (FELIX-5243).
Here are the key items of the stack trace:
{noformat}
java.lang.NullPointerException
at org.osgi.util.tracker.ServiceTracker.<init>(ServiceTracker.java:184)
at org.apache.felix.scr.impl.inject.ClassUtils.getPackageAdmin(ClassUtils.java:187)
at org.apache.felix.scr.impl.inject.ClassUtils.getClassFromComponentClassLoader(ClassUtils.java:118)
[...]
at org.apache.felix.scr.impl.Activator.start(Activator.java:108)
[...]
{noformat}
From the first three lines, we get that the static field {{ClassUtils.m_context}} is {{null}}. The value of that field is set in {{Activator.start()}}, at line 110. But the method is called a little bit too early: we are currently at line 108 of that very same method.
It should be possible to fix the bug by simply moving lines 109-110 of Activator.jave before the current line 108.
> Updating from SCR 2.0.2 to SCR 2.0.4 leads to nullpointers
> ----------------------------------------------------------
>
> Key: FELIX-5316
> URL: https://issues.apache.org/jira/browse/FELIX-5316
> Project: Felix
> Issue Type: Bug
> Components: Declarative Services (SCR)
> Affects Versions: scr-2.0.4
> Environment: org.apache.felix.main 5.4.0
> org.apache.felix.scr 2.0.4
> Reporter: max urech
> Attachments: felixScrNullpointer.txt
>
>
> Our Application works fine with org.apache.felix.scr 2.0.2.
> If we update to org.apache.felix.scr 2.0.4 it doesn't work any more.
> Several bundles fail to load their components.
> The failure is displayed as stack trace([^felixScrNullpointer.txt]) on the console.
> The failing components all have the same pattern in their definitions.
> They all provide the same interface and are defined as immediate=true.
> There is another component, which defines a dynamic 0..n reference to this interface.
> I suspect, there has been introduced a bug with issue FELIX-4417.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)