This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 153253 - [persistence] connection-private filters cause NPE when restoring
Summary: [persistence] connection-private filters cause NPE when restoring
Status: CLOSED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P1 normal (vote)
Target Milestone: 1.0   Edit
Assignee: David Dykstal CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-09 05:26 EDT by Martin Oberhuber CLA
Modified: 2008-08-13 13:05 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Oberhuber CLA 2006-08-09 05:26:15 EDT
Create a connection.
In the connection, define a new filter. Choose the "Connection private" checkbox.
Quit RSE.
Restart RSE 
--> Observe NullPointerException
--> Because of the NPE, restoring all other connections also fails, therefore this is a major problem. 

java.lang.NullPointerException
	at org.eclipse.rse.internal.references.SystemPersistableReferencingObject.setReferencedObject(SystemPersistableReferencingObject.java:58)
	at org.eclipse.rse.internal.filters.SystemFilterPoolReference.setReferenceToFilterPool(SystemFilterPoolReference.java:148)
	at org.eclipse.rse.internal.filters.SystemFilterPoolReference.getReferencedFilterPool(SystemFilterPoolReference.java:160)
Comment 1 Martin Oberhuber CLA 2006-08-09 05:37:37 EDT
I have checked in a workaround in RSEDomImporter, but this problem needs to be observed better since filter references will be lost. Anyway, the problem is not major now any more --> keeping P3 priority.
Comment 2 Kushal Munir CLA 2006-08-16 04:07:54 EDT
I see this message in the console:

TODO: Fix bug 153253 - NPE reading connection-private filter pools
java.lang.NullPointerException
	at org.eclipse.rse.internal.references.SystemPersistableReferencingObject.setReferencedObject(SystemPersistableReferencingObject.java:58)
	at org.eclipse.rse.internal.filters.SystemFilterPoolReference.setReferenceToFilterPool(SystemFilterPoolReference.java:148)
	at org.eclipse.rse.internal.filters.SystemFilterPoolReference.getReferencedFilterPool(SystemFilterPoolReference.java:160)
	at org.eclipse.rse.core.subsystems.SubSystem.filterEventFilterPoolReferenceCreated(SubSystem.java:1090)
	at org.eclipse.rse.internal.filters.SystemFilterPoolReferenceManager.addReferenceToSystemFilterPool(SystemFilterPoolReferenceManager.java:614)
	at org.eclipse.rse.internal.persistence.dom.RSEDOMImporter.restoreFilterPoolReference(RSEDOMImporter.java:487)
	at org.eclipse.rse.internal.persistence.dom.RSEDOMImporter.restoreSubSystem(RSEDOMImporter.java:297)
	at org.eclipse.rse.internal.persistence.dom.RSEDOMImporter.restoreConnectorService(RSEDOMImporter.java:177)
	at org.eclipse.rse.internal.persistence.dom.RSEDOMImporter.restoreHost(RSEDOMImporter.java:146)
	at org.eclipse.rse.internal.persistence.dom.RSEDOMImporter.restoreProfile(RSEDOMImporter.java:94)
	at org.eclipse.rse.internal.persistence.RSEPersistenceManager.load(RSEPersistenceManager.java:366)
	at org.eclipse.rse.internal.persistence.RSEPersistenceManager.restore(RSEPersistenceManager.java:122)
	at org.eclipse.rse.internal.model.SystemProfileManager.getSystemProfileManager(SystemProfileManager.java:60)
	at org.eclipse.rse.model.SystemStartHere.getSystemProfileManager(SystemStartHere.java:160)
	at org.eclipse.rse.ui.RSEUIPlugin.start(RSEUIPlugin.java:480)
Comment 3 Kushal Munir CLA 2006-08-16 04:17:50 EDT
Noticed other problems:
1. If I have a single connection with a connection specific filter, that does not show up in RSE when I restart.
2. If I have two connections with a connection specific filter in each, then one shows up, but the other doesn't, on restart.
3. If I have two connections with a connection specific filter in one and a general filter in another, then both show up on restart.

I see the NPE message in the console, which is probably what is causing it.

I'm increasing the priority of this bug since it seems to be serious.
Comment 4 Martin Oberhuber CLA 2006-08-16 11:30:27 EDT
Increased to P1 since we reallz want this for M4 if at all possible.
Comment 5 David Dykstal CLA 2006-08-17 17:33:06 EDT
Problem is caused two things.
(1) the SystemFilterPool was not marking itself dirty in many cases after it was modified.
(2) Changes to the DOM were being lost in the window between the point when the DOM should have been was constructed/merged from the model and when the DOM was actually written. Flags were set in the persistence manager to ignore changes up to the point where the DOM had finished writing.

The fix was to redo the way synchronization is done between exporting to the DOM from the model(usually on the UI thread) and the background job that actually wrote the DOM.
Comment 6 David Dykstal CLA 2006-08-17 18:37:37 EDT
Fixed the synchronization between the DOM writing job and the export to the DOM. Made the PropertyFileProvider a bit more resilient when reading the persistent form. Fixed the SystemFilterPool to mark itself dirty when changed. Minor formatting changes to SystemNewFilterWizard and SubSystem.
Comment 7 Javier Montalvo Orús CLA 2006-10-31 10:56:37 EST
NPE not reproduced when setting a "Connection private" filter and restarting.
Marked as verified.
Comment 8 Martin Oberhuber CLA 2006-11-23 06:53:00 EST
Closing.
Comment 9 Martin Oberhuber CLA 2008-08-13 13:05:38 EDT
[target cleanup] 1.0 M4 was the original target milestone for this bug