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

Richard S. Hall resolved FELIX-1057.
------------------------------------

       Resolution: Fixed
    Fix Version/s: shell.remote-1.0.5

Ok, it turned out to not be so trivial. I could have done the fix you 
suggested, but the root of the issue was a little uglier since it was using a 
static-based approach to allow it to pass services around to all classes in the 
bundle; I highly recommend against this approach.

Also, there were a handful of concurrency issues and service tracking was not 
correct. I ended up pulling that code and just using ServiceTrackers to track 
log and shell services. Please run remote shell through its paces to make sure 
I didn't break anything else, but at least your issue is now gone after a few 
hours of work. :-)

Close this issue when you are satisfied. Thanks.

> stopping bundle causes NPE
> --------------------------
>
>                 Key: FELIX-1057
>                 URL: https://issues.apache.org/jira/browse/FELIX-1057
>             Project: Felix
>          Issue Type: Bug
>          Components: Remote Shell
>    Affects Versions:  shell.remote-1.0.4
>            Reporter: Peter Doornbosch
>            Assignee: Richard S. Hall
>            Priority: Minor
>             Fix For: shell.remote-1.0.5
>
>
> Stopping the remote shell bundle itself remotely, causes a NPE:
> Exception in thread "telnetconsole.shell remote=/127.0.0.1:56512" 
> java.lang.NullPointerException
>       at 
> org.apache.felix.shell.remote.TerminalPrintStream.print(TerminalPrintStream.java:52)
> I admit that stopping the bundle itself over the remote connection may seem 
> like a silly use case, but under circumstances it is necessary (to release 
> the socket).
> The NPE is causes by Activator.getServices() returning null. The fix is 
> trivial:
> ServiceMediator services = Activator.getServices();
> if (services != null)
>    services.error(...)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to