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.
[build 20051019] Steps: 1) create new web project 2) open sun-web.xml in text mode 3) make the sun-web.xml invalide, e.g. delete last </sun-web-app> element 4) save file 5) open web.xml file in text mode 6) make web.xml invalide 7) save web.xml file ERROR: Data lost in sun-web.xml
The problem here is a couple of things. When sun-web.xml is changed and saved, code automatically reads sun-web.xml and reloads the parallel DConfigBean tree with the new data. Since the sun-web.xml is invalid, the tree is flushed. This is probably bad -- I have to think about what really should happen here. Then when web.xml is changed, sun-web.xml is automatically saved (this actually is an inefficiency in the current system that will be fixed as part of Bug #67527, but it could be reproduced anyway by making a change to web.xml that required changes to sun-web.xml such as adding a web service, client, or resource). The sun-web.xml saved in this case is from the DConfigBeans, which were flushed and that is why there is the data loss. The proper fix is to decide what to do about handling invalid XML saved from the editor and there are a couple of decisions to make there.
I checked in patch that resolves the dataloss aspect of this bug. Now, when refreshing DConfigBean tree after a save of from the text XML editor (or any reload from disk request actually), if the xml descriptor cannot be parsed or read, etc., the prior bean configuration for that file will be used to reset the tree (which should correspond to the values it already had, btw). We still need to notify the user explictly that we failed to restore the tree properly because of whatever the error was and there is still the issue of decorating the sun-xxx.xml node with an error glyph (bug #67290). Downgrading to P3 since dataloss aspect is fixed.
Title changed to reflect latest bug status.
link related issues
tm change
Fixed by virtue of new editor design.