You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Didier DONSEZ (JIRA)" <ji...@apache.org> on 2008/11/13 15:37:44 UTC
[jira] Resolved: (FELIX-810) MonitorAdmin - NullPointerException
while calling MonitoringJob.stop()
[ https://issues.apache.org/jira/browse/FELIX-810?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Didier DONSEZ resolved FELIX-810.
---------------------------------
Resolution: Fixed
Assignee: Didier DONSEZ
the patch was applied and tested with the demo script felix/sandbox/donsez/script/monitor.txt
and commited at revision: 713734
> MonitorAdmin - NullPointerException while calling MonitoringJob.stop()
> -----------------------------------------------------------------------
>
> Key: FELIX-810
> URL: https://issues.apache.org/jira/browse/FELIX-810
> Project: Felix
> Issue Type: Bug
> Components: Sandbox
> Reporter: Martin Thelian
> Assignee: Didier DONSEZ
> Attachments: FELIX-810.patch
>
>
> I've started a scheduled job with:
> |> this.monitorService.startScheduledJob(
> |> PID, // listener.id
> |> variableNames.toArray(new String[variableNames.size()]),
> |> 60, // seconds
> |> 0 // Forever
> |> );
> If I then need to stop the job via
> |> this.currentMonitorJob.stop();
> e.g. because the variableName list has changed I'm getting the following NullpointerException:
> -----
> |> java.lang.NullPointerException
> |> at org.apache.felix.sandbox.monitor.MonitorAdminImpl$MonitoringJobImpl.unsubscribeStatusVariables(MonitorAdminImpl.java:185)
> |> at org.apache.felix.sandbox.monitor.MonitorAdminImpl$MonitoringJobImpl.stop(MonitorAdminImpl.java:162)
> -----
> The problem seems to be that there are no subscriptions in a scheduled job and therefore the variable "list" shown in the code fragment below is null.
> |> private void unsubscribeStatusVariables() {
> |> [...]
> |> List list=(List)subscriptions.get(statusVariableName);
> |> if(list!=null) {
> |> list.remove(this);
> |> } // else never occurs
> |> if(list.isEmpty())
> |> subscriptions.remove(statusVariableName);
> |> }
> |> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.