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.
Steps to reproduce: 1. open web.xml 2. choose servlets tab 3. add servlet entry 4. switch to xml view => xml is not synced with multiview data 5. switch back -> servlet is still there 6. save the file and switch again to xml view => still nothing 7. switch again back and add another servlet 8. switch to xml => now it's synced, from that moment everything work fine It's marked as P2 cause it should be fixed in FCS -> not marking as P1 due to very clear workaround
Hi Michal, is this a regression?
Yes .. it's a regression from beta build. Upgrading back to P1 due to user data loss. Another scenario appeared. When you edited web.xml by yourself (add a new servlet manually) and then you would add servlet through wizard all previous servlets are lost from web.xml.
I cannot reproduce this issue on my linux : Tested before and after schema updates (build 091123) Is that MAC specific issue ?
I also can not reproduce. Product Version: NetBeans IDE Dev (Build web-main-2148-on-091123) Java: 1.6.0_15; Java HotSpot(TM) 64-Bit Server VM 14.1-b02-92 System: Mac OS X version 10.5.8 running on x86_64; MacRoman; en_US (nb) Userdir: /Users/petrjiricka/.netbeans/dev
I also found some suspicious behaviour (#2 Michal Mocnak). Investigating further what's happening there.
This is a tough synchronization problem. I found out, that XmlMultiviewElement:componentActivated/componentShowing methods are called prior to document (in cache) is updated from web.xml data model. These methods likely need to be "synchronized" with XmlMultiviewEditorSupport:updatingDataFromModel(), or XmlMultiviewDataObject:saveData();
I can reproduce it always on several NB versions (68 RC1, 68 Beta, NB 67). Again the problem was there probably always so I would suggest to fix it but I do not think it is showstopper.
Milan, I make no progress on this issue today so feel free to continue. You seems to be author of many classes so perhaps it will be easier for you to fix. I had a look at Sun Deployment Descriptor (editor for sun-web.xml from j2ee.sun.ddui module) which synchronizes GUI/xml changes correctly but code is too different and too complex so I have not got far.
This is the fix: http://hg.netbeans.org/main/rev/064fc2f6dca7 There are actually 2 problems: 1. problem (described by M.Mocnak in first description) This is the synchronization between web.xml graphical view and xml view In this case the web.xml data model is saved to XML Multiview (text) cache, and the content of cache is used in editor. It happened that cache was modified sooner than web.xml model was changed. This was happening when DD data object was saved and (isModified() == false) The synchronization process started with different delay than the case when data object is modified. The fix is based on using the same delay regardless the data object is modified or not. 2. problem (Michal Mocnak #2) This issue was caused by improper implementation of the merge data model for deployment descriptor (model that accepts both annotation and web.xml) In DDProider, WebApp object (representing dd data model) is cached. Problem is that, instead of using this cached object (used also by DD Editor) the WebAppMetadataImpl works with another instance of WebApp. Thus, when new servlet is added, using the wizard, web.xml is not changed in editor (that uses another WebApp instance) The solution is to use the same instance as DD Editor. QA engineer(reporter), please verify thoroughly the fix. Thank You.
I tested the patch and it seems to fix the issue. It is hard to say what was the purpose of different scheduling of updateTask in XmlMultiViewDataSynchronizer.java. One thing which makes me little bit suspicious is that sun-web.xml worked fine even before the Milan's change. That seems to indicate that problem is somewhere else than in XmlMultiViewDataSynchronizer. Also now you can notice delay in updating: change servlet name in GUI and immediately switch to XML view and you will see old servlet name being replaced with new one. sun-web.xml does not have this update issue.
Great ... it's working (verified in main)
>One thing which makes me little bit suspicious is that sun-web.xml worked fine even before the Milan's change. That seems to indicate that problem is somewhere else than in XmlMultiViewDataSynchronizer. There a different delay regarding DataObject is modified or not. I've just unified the delay. Moreover, web.xml editing differs little bit from sub-web.xml eidting, which doesn't use modal dialogs (like in Add Servlet). >Also now you can notice delay in updating: change servlet name in GUI and immediately switch to XML view and you will see old servlet name being replaced with new one. sun-web.xml does not have this update issue. That's the same as before, providing the data object is modified (not saved). Michal, can you pleaase test also sun-web.xml editing ?
i have tried it and it seems to be ok ... all is well synced
Fixed in release68: http://hg.netbeans.org/release68/rev/5554ed70dff9
Integrated into 'main-golden', will be available in build *200911251400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/064fc2f6dca7 User: mkuchtiak@netbeans.org Log: #177370: fixing 2 problems with web.xml synchronization
Verified in rc1 build