You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Pierre De Rop (JIRA)" <ji...@apache.org> on 2018/10/17 16:30:00 UTC
[jira] [Updated] (FELIX-5956) NPE when invoking a lifecycle
runnable method from init method
[ https://issues.apache.org/jira/browse/FELIX-5956?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Pierre De Rop updated FELIX-5956:
---------------------------------
Fix Version/s: (was: org.apache.felix.dependencymanager-r12)
org.apache.felix.dependencymanager-r13
> NPE when invoking a lifecycle runnable method from init method
> --------------------------------------------------------------
>
> Key: FELIX-5956
> URL: https://issues.apache.org/jira/browse/FELIX-5956
> Project: Felix
> Issue Type: Bug
> Components: Dependency Manager Runtime
> Affects Versions: org.apache.felix.dependencymanager-r1
> Reporter: Pierre De Rop
> Assignee: Pierre De Rop
> Priority: Major
> Fix For: org.apache.felix.dependencymanager-r13
>
>
> When you use a DM lifecycle controller in order to trigger component activation from the @Init method, a NPE is throw if you invoke the lifecylce runnable from the init method.
> For example, the following code:
> {code:java}
> @Component
> public class MyServiceImpl implements MyService {
> @LifecycleController
> volatile Runnable _start;
> @Init
> void init() {
> _start.run(); // immediately trigger service activation
> }
> }
> {code}
> produces the following NPE:
> {code}
> Caused by: java.lang.NullPointerException
> at org.apache.felix.dm.runtime.ToggleServiceDependency.activate(ToggleServiceDependency.java:49)
> at org.apache.felix.dm.runtime.ServiceLifecycleHandler$ComponentStarter.run(ServiceLifecycleHandler.java:431)
> at org.apache.felix.dependencymanager.samples.hello.annot.ServiceProviderImpl.init(ServiceProviderImpl.java:47)
> ... 65 more
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)