Bug 190613 - [remotecdt] NPE in Remote CDT launch config when no connections except Local
Summary: [remotecdt] NPE in Remote CDT launch config when no connections except Local
Status: RESOLVED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P2 normal (vote)
Target Milestone: 2.0.1   Edit
Assignee: Yufen Kuo CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords: bugday, contributed
: 194020 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-06-01 20:15 EDT by Greg Watson CLA
Modified: 2011-05-25 09:37 EDT (History)
2 users (show)

See Also:


Attachments
patch to initialize the SystemRegistry before using it (1.96 KB, patch)
2007-08-31 14:27 EDT, Yufen Kuo CLA
mober.at+eclipse: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Greg Watson CLA 2007-06-01 20:15:19 EDT
If no connections have been defined in the workspace, creating a new C/C++ Remote Application launch configuration causes a null pointer exception in  org.eclipse.rse.internal.remotecdt.RemoteCMainTab.updateConnectionPulldown(RemoteCMainTab.java:329). I think this is because the RemoteCMainTab tries to look up a "shell" configuration category without checking the result. If no connections exist in the workspace, the launch configuration should do something more graceful.
Comment 1 Martin Oberhuber CLA 2007-06-06 05:55:23 EDT
Nice catch - though I expect most users would at least have the "Local" connection so they would not fall into this.
Comment 2 Eclipse Webmaster CLA 2007-07-29 09:22:59 EDT
Changing OS from Mac OS to Mac OS X as per bug 185991
Comment 3 Brent Washburne CLA 2007-07-30 18:55:34 EDT
I hit this bug as well.  Start with a new Europa and install CDT.  Then install the Remote Access and Device Development features.  Without opening any of the Remote Systems windows, open the Run dialog and create a new C/C++ Remote Application.  This will create the null pointer exception.  It's because the RSE Manager hasn't started yet.
Comment 4 Yufen Kuo CLA 2007-08-31 14:27:55 EDT
Created attachment 77497 [details]
patch to initialize the SystemRegistry before using it

If RSEUIPlugin is not loaded before, the SystemRegistry won't be initialized therefore it is getting a NullPointerException when trying to retrieve hosts from SystemRegistry.
Comment 5 Martin Oberhuber CLA 2007-09-03 12:47:21 EDT
dup of bug 194020
Comment 6 Martin Oberhuber CLA 2007-09-03 12:48:18 EDT
*** Bug 194020 has been marked as a duplicate of this bug. ***
Comment 7 Martin Oberhuber CLA 2007-09-03 13:21:19 EDT
The basic idea of the patch was correct, but there was two issues with it:

1.) For remotecdt, only connections are valid that do support a shell channel.
    FTP Only, for instance, would not be valid -- that's the reason why
    only those which have a "Shell" category were allowed. That code was
    incorrectly removed.

2.) After loading RSEUIPlugin, the code must wait until the InitRSEJob has run,
    or the connection pulldown will be empty on first run though it should
    at least have the "local" connection in it.

Fixed the two issues and committed the patch.

Thanks!
Comment 8 Martin Oberhuber CLA 2007-09-03 14:00:22 EDT
Also, Yu-Fen .. can you please add a line in the file header comment for your contribution next time, such that it is shipped with the patch you provide? 
This time, I added the following for you:

 * Yu-Fen Kuo (MontaVista) - [190613] Fix NPE in Remotecdt when RSEUIPlugin has not been loaded


And, please add the disclaimer in the bugzilla comment as outlined here:
http://www.eclipse.org/dsdp/tm/development/committer_howto.php#external_contrib

Thanks!
Comment 9 Yufen Kuo CLA 2007-09-04 12:17:59 EDT
(In reply to comment #8)
> Also, Yu-Fen .. can you please add a line in the file header comment for your
> contribution next time, such that it is shipped with the patch you provide? 
> This time, I added the following for you:
> 
>  * Yu-Fen Kuo (MontaVista) - [190613] Fix NPE in Remotecdt when RSEUIPlugin has
> not been loaded
> 
> 
> And, please add the disclaimer in the bugzilla comment as outlined here:
> http://www.eclipse.org/dsdp/tm/development/committer_howto.php#external_contrib
> 
> Thanks!
> 
Legal Message: I, Yu-Fen Kuo, declare that I developed attached code from scratch, without referencing any 3rd party materials except material licensed under the EPL. {I am authorized by my employer to make this contribution under the EPL.}