This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 17914 - NPE from PropertiesOpen when swithich projects
Summary: NPE from PropertiesOpen when swithich projects
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Filesystems (show other bugs)
Version: 3.x
Hardware: Sun SunOS
: P2 blocker (vote)
Assignee: Vitezslav Stejskal
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-11-21 07:52 UTC by Jan Zajicek
Modified: 2008-12-22 23:36 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
ide.log from nb3.3beta5 build #200111201425 (40.16 KB, text/plain)
2001-11-21 07:55 UTC, Jan Zajicek
Details
patch of DataObject (15.48 KB, application/octet-stream)
2001-11-21 16:10 UTC, Tomas Pavek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Zajicek 2001-11-21 07:52:30 UTC
dev#200111201425, jdk1.4.0-rc86

Playing with the IDE for a while - switching between 3.3 projects with opened
source editor containing some forms, java and properties files - following NPE
occured. Note after this NPE is the IDE unusable - you cannot close the editor -
the NPE is thrown all the time, you have to restart the ide. Marking this as P2,
because of IDE unusability. Allthought this is irreproducible, it happens to me
twice in half an hour.

Snip of the NPE (see ide.log for all NPEs):
Tue Nov 20 18:06:24 CET 2001: java.lang.NullPointerException: null
java.lang.NullPointerException
        at
org.netbeans.modules.properties.PropertiesOpen$PropertiesCloneableTopComponent.getUndoRedo(PropertiesOpen.java:687)
        at org.openide.actions.UndoAction.getUndoRedo(UndoAction.java:91)
<...>
Comment 1 Jan Zajicek 2001-11-21 07:55:11 UTC
Created attachment 3504 [details]
ide.log from nb3.3beta5 build #200111201425
Comment 2 _ lkramolis 2001-11-21 08:03:34 UTC
It is properties module bug.
Comment 3 Jan Zajicek 2001-11-21 08:51:18 UTC
Ops missed the module - nice start of the day ;-)
Comment 4 Tomas Pavek 2001-11-21 10:40:48 UTC
However I'm not an expert on properties module, I think these 
problems are not caused by this module.
If you look at the attached ide.log, you see a failure of 
deserializing the "properties" top component. All the other 
exceptions from PropertiesOpen.PropertiesCloneableTopComponent (I 
found 3 in the log) are caused by that the top component is in an 
inconsistent state (was not initialized).

The top component deserialization exceptions is:

org.openide.filesystems.FileStateInvalidException
	at org.openide.loaders.DataObject.find(DataObject.java:428)
	at org.openide.loaders.DataNode$ObjectHandle.getNode
(DataNode.java:643)
	at org.openide.windows.TopComponent.readExternal
(TopComponent.java:536)
	at org.openide.windows.CloneableTopComponent.readExternal
(CloneableTopComponent.java:160)
	at 
org.netbeans.modules.properties.PropertiesOpen$PropertiesCloneableTopC
omponent.readExternal(PropertiesOpen.java:745)
	at org.openide.windows.TopComponent$Replacer.readObject
(TopComponent.java:761)
... etc ...
Comment 5 Jan Zajicek 2001-11-21 11:01:06 UTC
According to Dafe, root is in the deserializing phase of properties
topcomponent:

Tue Nov 20 18:06:17 CET 2001:
org.openide.filesystems.FileStateInvalidException: null
org.openide.filesystems.FileStateInvalidException
	at org.openide.loaders.DataObject.find(DataObject.java:428)
	at org.openide.loaders.DataNode$ObjectHandle.getNode(DataNode.java:643)
	at org.openide.windows.TopComponent.readExternal(TopComponent.java:536)

<...>
Comment 6 Tomas Pavek 2001-11-21 11:24:30 UTC
That's what I've written above...

So why have you reassigned this back to issues@properties ??
Comment 7 David Simonek 2001-11-21 13:22:24 UTC
Because exception thrown during deserialization of some component
which belongs to properties module is not winsys problem, I think. IMO
problem is either in properties module, which has some strange data
object asociated with its top component, or in data-file system
itself. It looks like properties' top component has some strange node
asociated with it, and that this node somehow becomes invalid...that's
why I would like to start in properties module, and only then move
further (but surely not to the winsys).
Comment 8 Tomas Pavek 2001-11-21 15:25:15 UTC
Sounds reasonably...

But I'm not able to reproduce the problem, so I cannot debug it to 
find out what node/data object is associated with the serialized top 
component. I see nothing wrong in properties code at the first sight.

Honzo, please provide some reproducible case...
Comment 9 Tomas Pavek 2001-11-21 15:51:39 UTC
I have just another idea: could not this be some timing issue around 
mounting filesystems during project switch? It looks like because it 
happens very irregularly, and the failure is in FileObject.isValid().
Radek, could you look at it?
Comment 10 Tomas Pavek 2001-11-21 16:10:45 UTC
Created attachment 3516 [details]
patch of DataObject
Comment 11 Tomas Pavek 2001-11-21 16:13:34 UTC
I've added a patch of DataObject to print the name of the invalid file
DataObject.find:

if (!fo.isValid())
  throw new FileStateInvalidException(fo.getPackageNameExt('/', '.'));
Comment 12 _ ttran 2001-11-21 16:29:30 UTC
something b/w file system and data system
Comment 13 Jan Zajicek 2001-11-21 17:29:26 UTC
I tried tough to repro this issue but without succes. So no more info
for now. If the stacktraces cannot help, then will be good at least
provide better annotation - i.e. inform what file is invalid, as Tomas
provided.
Comment 14 Tomas Pavek 2001-11-21 18:25:48 UTC
I've just encountered the FileStateInvalidException during startup.
With the patched DataObject it shows that "Bundle.properties" is not 
a valid file - but it should be valid for sure...

Note that this exception even did not go through PropertiesOpen top 
component, but through NbNodeOperation.Sheet (so it is not dependent 
on top component type).


org.openide.filesystems.FileStateInvalidException: Bundle.properties
  at org.openide.loaders.DataObject.find(DataObject.java:428)
  at org.openide.loaders.DataNode$ObjectHandle.getNode
(DataNode.java:643)
  at org.openide.nodes.DefaultHandle.getNode(DefaultHandle.java:51)
  at org.openide.nodes.DefaultHandle.getNode(DefaultHandle.java:51)
  at org.openide.nodes.FilterNode$FilterHandle.getNode
(FilterNode.java:1116)
  at org.openide.nodes.NodeOp.fromHandles(NodeOp.java:405)
  at org.netbeans.core.NbNodeOperation$Sheet.readExternal
(NbNodeOperation.java:455)
  at org.openide.windows.TopComponent$Replacer.readObject
(TopComponent.java:761)
Comment 15 rmatous 2001-11-22 14:33:59 UTC
I don`t think that the problem is in filesystems. If that invalid 
FileObject were from MultiFileSystem then I would hasitate. But 
because Bundle.properies is probably from ExLocalFileSystem then it 
should be more transparent. AbstractFileObject is invalid:
1/ after delete
2/ during refresh, before fileDeleted event is fired
3/ deserialization, if filesystem of AbstractFileObject is not find 
in repository, which is most probable. 

Please Vita, could you verify point 3/.
Comment 16 Vitezslav Stejskal 2001-11-22 16:08:49 UTC
My explanantion is more guess than solid standpoint, but from reports 
attached here it seems to me that filesystem repository isn't 
up-to-date at the time when window system reopens editor's 
TopComponents. That's why the deserialized FileObject is invalid and 
exception is thrown from DataObject.find(). This scenarion is possible 
as long as there is no synchronization between AutomountSupport and 
window system, they both just listen to changes from MultiFileSystem 
and do their job without knowing of each other.

The fix was done in SessionManager, which waits now for the 
AutomountSupport to refresh filesystems repository before the project 
open event is fired to listeners (window system). This definitely 
improves the project switching mechanism, but may not truly resolve 
the problem, please try to verify and let me know in case of troubles.

Fixed in main trunk.
Comment 17 Jan Zajicek 2001-11-26 13:28:22 UTC
Do not see this in last build. Verifying.
Comment 18 Quality Engineering 2003-07-01 16:16:05 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.