Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 222376

Summary: [regression] NPE when starting eclipse with rse
Product: [Tools] Target Management Reporter: Tobias Schwarz <tobias.schwarz>
Component: RSEAssignee: David Dykstal <ddykstal.eclipse>
Status: RESOLVED FIXED QA Contact: Martin Oberhuber <mober.at+eclipse>
Severity: normal    
Priority: P2 CC: mober.at+eclipse, wb-rel
Version: 3.0   
Target Milestone: 3.0 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 197167    
Bug Blocks:    

Description Tobias Schwarz CLA 2008-03-12 06:13:19 EDT
Build ID: e34m5; rse head

Steps To Reproduce:
1. start eclipse with existing workspace and existing local connection
2. a npe is reported (twice)
java.lang.NullPointerException
	at java.util.Hashtable.get(Hashtable.java:336)
	at org.eclipse.rse.internal.core.model.SystemHostPool.getSystemHostPool(SystemHostPool.java:100)
	at org.eclipse.rse.internal.core.model.SystemRegistry.getHostPool(SystemRegistry.java:1187)
	at org.eclipse.rse.internal.core.model.SystemRegistry.getHost(SystemRegistry.java:1372)
	at org.eclipse.rse.internal.core.RSELocalConnectionInitializer.run(RSELocalConnectionInitializer.java:27)
	at org.eclipse.rse.internal.core.RSEInitJob.runInitializer(RSEInitJob.java:262)
	at org.eclipse.rse.internal.core.RSEInitJob.run(RSEInitJob.java:187)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

More information:
after clicking "ok" in the upcomming dialog, rse seems to work correctly.
the local connection is present and can be used normally.
Comment 1 Martin Oberhuber CLA 2008-03-12 06:19:40 EDT
Quite apparently this is a regression due to the fix for bug 197167. Looking at the backtrace, I see two issues:

(1) RSELocalConnectionInitializer should not be run in an already-existing
    workspace, since the stampfile already exists in
       .metadata\.plugins\org.eclipse.rse.core\localHostCreated.mark
    so this is kind of a missing feature in terms of migration

(2) If the RSELocalConnectionInitializer job runs it must run in a safe manner
    without NPE, so it should not be allowed to run before profiles are 
    available.

Targeting M6 since the new initialization APIs are an important addition to M6 and they should be working properly.
Comment 2 David Dykstal CLA 2008-03-12 17:24:09 EDT
The problem apparently occurs when the default profile has been renamed. See also bug 202630.
Fix checks for local mark and fixes bug 202630.
Comment 3 David Dykstal CLA 2008-03-12 17:26:00 EDT
*** Bug 202630 has been marked as a duplicate of this bug. ***
Comment 4 Martin Oberhuber CLA 2008-03-13 04:58:14 EDT
Tobias can you verify please? Had you indeed renamed the profile (i.e. started Eclipse on your old workspace with the new machine you had just recently obtained --> default profile name is now new machine name instead of the old one) ?
Comment 5 Martin Oberhuber CLA 2008-03-13 05:01:34 EDT
I'm not marking this as a dup since the "local mark" fix is separate from the API change fix in bug 202630. Just keeping 'em separate.