You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Martin Thelian (JIRA)" <ji...@apache.org> on 2008/11/07 11:16:44 UTC

[jira] Created: (FELIX-810) MonitorAdmin - NullPointerException while calling MonitoringJob.stop()

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


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.


[jira] Updated: (FELIX-810) MonitorAdmin - NullPointerException while calling MonitoringJob.stop()

Posted by "Martin Thelian (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-810?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Thelian updated FELIX-810:
---------------------------------

    Attachment: FELIX-810.patch

Here is a patch to fix this issue.

> 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
>         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.


[jira] Resolved: (FELIX-810) MonitorAdmin - NullPointerException while calling MonitoringJob.stop()

Posted by "Didier DONSEZ (JIRA)" <ji...@apache.org>.
     [ 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.


[jira] Closed: (FELIX-810) MonitorAdmin - NullPointerException while calling MonitoringJob.stop()

Posted by "Martin Thelian (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-810?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Thelian closed FELIX-810.
--------------------------------


I'm now using the new snapshot version for a few days in my environment and it works fine. Thanks.

> 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.