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.
Summary: | AssertionError at org.netbeans.modules.xml.xdm.diff.MergeDiff.applyChildrenDiffs | ||
---|---|---|---|
Product: | xml | Reporter: | Marek Fukala <mfukala> |
Component: | XDM | Assignee: | _ alexpetrov <alexpetrov> |
Status: | VERIFIED FIXED | ||
Severity: | blocker | CC: | alexismp, Chiana, diesil, kokuzawa, neilg, pjiricka, scottmelton, sustaining |
Priority: | P1 | ||
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
URL: | http://statistics.netbeans.org/exceptions/detail.do?id=7415 | ||
Issue Type: | DEFECT | Exception Reporter: | 7415 |
Attachments: |
stacktrace
stacktrace stacktrace stacktrace stacktrace stacktrace stacktrace stacktrace stacktrace stacktrace |
Description
Marek Fukala
2009-09-21 10:51:29 UTC
Created attachment 88006 [details]
stacktrace
This issue already has 10 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=7415 Alex, please take a look. This issue already has 12 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=7415 Build: NetBeans IDE 6.8 Beta (Build 200910212001) VM: Java HotSpot(TM) 64-Bit Server VM, 14.2-b01, Java(TM) SE Runtime Environment, 1.6.0_16-b01 OS: Linux, 2.6.28-15-generic, amd64 User Comments: editing pom file Stacktrace: java.lang.AssertionError at org.netbeans.modules.xml.xdm.diff.MergeDiff.applyChildrenDiffs(MergeDiff.java:142) at org.netbeans.modules.xml.xdm.diff.MergeDiff.merge(MergeDiff.java:108) at org.netbeans.modules.xml.xdm.XDMModel.mergeDiff(XDMModel.java:251) at org.netbeans.modules.xml.xdm.XDMModel.finishSync(XDMModel.java:218) at org.netbeans.modules.xml.xdm.XDMModel.sync(XDMModel.java:158) at org.netbeans.modules.xml.xdm.xam.XDMAccess.sync(XDMAccess.java:141) Created attachment 90024 [details]
stacktrace
This issue already has 14 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=7415 Created attachment 90888 [details]
stacktrace
I'm not able to reproduce this bug on: Product Version: NetBeans IDE Dev (Build 200911091156) Java: 1.5.0_22; Java HotSpot(TM) Client VM 1.5.0_22-b03 System: Linux version 2.6.31-14-generic running on i386; UTF-8; en_US (nb) Product Version: NetBeans IDE Dev (Build 200911091156) Java: 1.6.0_14; Java HotSpot(TM) Client VM 14.0-b16 System: Linux version 2.6.31-14-generic running on i386; UTF-8; en_US (nb) If it still appears please provide exact steps for a bug reproducing. Created attachment 91051 [details]
stacktrace
Created attachment 91072 [details]
stacktrace
Reopening it's still reproducible. According to previous exception report. Steps: - create web (jee6) project with jsf 2 - create faces-config.xml - work with Actually it's happened when i was using cc in faces-config Created attachment 91075 [details]
stacktrace
I just created a new faces-config.xml file in a web project, opened it and type < inside the faces-config tag. Then the exception reappears almost after each modification => Editor almost unusable => P1. There is currently 49 duplicates, 50 is the limit for P1, so please fix this! Created attachment 91076 [details]
stacktrace
This issue already has 50 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=7415 It looks like once the UI editor appears the issue is not reproducible. After creating a new FC the editor opens in the XML mode directly. Then you almost cannot edit. Created attachment 91077 [details]
stacktrace
This issue already has 51 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=7415 Guys, who used faces-config.xml for reproducing of this bug, please attach your project containing this "reproducible" .xml file. The following help will be appreciated very much - if it's possible could you describe your steps in this format: 1. Start "clear" Netbeans with "clear" userdir 2. Create new clear (JavaEE+JSF) project 3. Add new JSF Config file to the project 4. Other . steps . for . reproducing . of this bug I'm still not able to reproduce this bug on Product Version: NetBeans IDE Dev (Build 200911091156) Java: 1.6.0_14; Java HotSpot(TM) Client VM 14.0-b16 System: Linux version 2.6.31-14-generic running on i386; UTF-8; en_US (nb), using given descriptions 1. - create web (jee6) project with jsf 2 - create faces-config.xml - work with 2. I just created a new faces-config.xml file in a web project, opened it and type < inside the faces-config tag. 3. After creating a new FC the editor opens in the XML mode directly. Then you almost cannot edit. I always get a correct code completion box or a message "No suggestions". Please, help. I cannot say more than I already said: Using the #2 steps I can perfectly reproduce. I have questions for you: 1) what platform, what OS, what *exact* build, or when fetched&rebuild for the last time? If self build - from what repository do you fetch? As for me it is web-main. 2) do you use some non standart module? (extensions to the xml support) 3) is the RAW XML editor opened for you when you follows the steps: 1. Start "clear" Netbeans with "clear" userdir 2. Create new clear (JavaEE+JSF) project 3. Add new JSF Config file to the project As I've already said the issues disappears once you switch to the UI editor. I recon it may be some timing issue as well (not sure how you initializes the models in the background) I'll try to fetch&build web-main again right now and give it another try. BTW did you changed anything which may affect the involved code recently, I mean in last few days? Marek, we can NOT reproduce this issue at all. We'll try to do it on different machines, platforms etc. But for now (even if GUI editor is not used from the beginning) issue is not reproducible. Code wasn't changed recently. And there is the workaround as Marek mentioned: open GUI editor. So not P1. Created attachment 91227 [details]
stacktrace
This issue already has 53 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=7415 Still reproducible I am affraid: web-main repository 1) ant clean && hg fetch && ant == clean fresh nb build. *only j2ee cluster* 2) run with a new userdir 3) create new web project, select javaee6, add glassfish v3, select jsf framework 4) create new faces-config.xml from template 5) open it => there is NO MULTIVIEW, just the raw xml editor 6) do any modification, e.g. type a whitespace anywhere. But for you to have a precise steps, type < inside the absolute-ordering tag body 7) wait for a few seconds Following exception is thrown: SEVERE [org.openide.util.RequestProcessor]: Error in RequestProcessor org.netbeans.modules.xml.xam.AbstractModel$1 java.lang.AssertionError at org.netbeans.modules.xml.xdm.diff.MergeDiff.applyChildrenDiffs(MergeDiff.java:142) at org.netbeans.modules.xml.xdm.diff.MergeDiff.merge(MergeDiff.java:108) at org.netbeans.modules.xml.xdm.XDMModel.mergeDiff(XDMModel.java:251) at org.netbeans.modules.xml.xdm.XDMModel.finishSync(XDMModel.java:218) at org.netbeans.modules.xml.xdm.XDMModel.sync(XDMModel.java:158) at org.netbeans.modules.xml.xdm.xam.XDMAccess.sync(XDMAccess.java:141) at org.netbeans.modules.xml.xam.AbstractModel.sync(AbstractModel.java:259) at org.netbeans.modules.xml.xam.AbstractModel$1.run(AbstractModel.java:652) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:602) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1084) Caused: org.openide.util.RequestProcessor$FastItem: task failed due to This repeats after each subsequent modification. 8) close the file 9) restart netbeans 10) open the file => the UI editor is there => editing the XML itsef works fine. Apparently the xml model is initialized by the "UI" view and since this doesn't happen for the first time for new faces-config.xml file, the assertion error is thrown. From looking into the code, the MergeDiff.applyChildrenDiffs(final Set<Difference> diffs, Node target) methods gets an instance of Document as the target, instead of the expected Element instance. Then the Difference.getNewParent().getId() is different and the assertion fails. Proper node type is passed to the method when the UI editor is opened (after step #8) I guess there is a bug in the TextEditorSupport since following message is writeen to the IDe log during creating the faces-config.xml for the first time. I recon this is the real cause of the issue. WARNING [org.openide.text.CloneableEditorSupport]: org.netbeans.modules.xml.text.TextEditorSupport should override asynchronousOpen(). See http://bits.netbeans.org/dev/javadoc/org-openide-text/apichanges.html#CloneableEditorSupport.asynchronousOpen Please do not try to convince me you still cannot reproduce it :-). This is likely not platform specific, look at the exception reports. Not P1 in anyway. Created attachment 91232 [details]
stacktrace
This issue already has 54 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=7415 Steps to reproduce: 1. Start "clear" Netbeans with "clear" userdir 2. Create new clear (Java Web + Web Application) project, using (Glassfish V3 + JavaEE 6) 3. Add New -> Other -> JavaServer Faces -> JSF Managed Bean to the project 4. Add New -> Other -> JavaServer Faces -> JSF Configuration to the project Sorry for the wrong previous comment, it was not finished. Button "Commit" was pressed accidentally. The reason of exception is the violation of uniqueness of IDs inside of XDM model. So now we know the reason, but unfortunately it's still unclear what was the motivation of those who added the code, which leads to models' corruption. It's definitely has been added intentionally. There is another simpler way to reproduce the exception: It's necessary to prepare the XML file at first. -- Create a new XML Schema file in any project -- Add many comments at the beginning. You can copy the following line to the document BEFORE the root element <xsd:schema>. Do it SEVERAL times (5-10 for example) <!-- aaa --> <!-- aaa --> <!-- aaa --> <!-- aaa --> <!-- aaa --> -- Save the schema and close NetBeans. Now you have the XSD file with multiple comments. You don't need to repeat preparation steps again. -- Open the NetBeans and the XSD file in source view. -- For other case wait till NetBeans finish loading. -- You can try validating it to be sure that it is valid. -- Select root element <xsd:schema>, copy it to buffer and delete. -- Wait 2-4 seconds (to give XDM model a time be synchronized) -- Add it back to the document. -- Wait 2-4 seconds -- At this time the document already corrupted because it has repeated IDs. The IDs for pasted part of document was regenerated starting from 1. -- Try adding anything inside of root element and you get the same AssertionException. -- The XSD remain corrupted until NebBenas is reloaded. Supernikita, just FYI 1) all the reports are agains exception from XML file editing, in particular from faces-config.xml, not regarding xsd 2) the issue appear is super simple scenario, nothing so complicated as you described above The issue you've just desribed (if only reproducible this way) sound like at most P3 to me, whilst what are all the more than fifty duplicates about sound more serious. I perfectly understand that you are affraid modifying the involved code in the CF if you do not have a perfect knowledge of it. The consequences may be sometimes unpredictible. OTOH isn't the XAM/XDM well covered with unit tests? Marek, we definitely have a number (rather big) of unit test. However the successful passing of those tests does not guarantee something else will be corrupted. Nikita added another scenario just as result of our attempts to understand root cause of the problem. So the most scaring thing to me personally is that why this issue is not 100% reproducible. In other owrds we don't know know why in some cases algorithm works correctly. Will continue to investigate. P1 - based on discussion with Michal, it's regression since NB 6.8 Beta (Michal will confirm today) Fixed in trunk: http://hg.netbeans.org/main/rev/eb9e210ddb70 Integrated into 'main-golden', will be available in build *200911241400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/eb9e210ddb70 User: Alex Petrov <alexpetrov@netbeans.org> Log: Fix for issue [#172663]. AssertionError at org.netbeans.modules.xml.xdm.diff.MergeDiff.applyChildrenDiffs. Fixed in release68: http://hg.netbeans.org/release68/rev/b679f1ce67fd Key word has been changed. Verified in trunk with build 26.11.2009 It's necessary to migrate the changes to NetBeans 6.7.1 branch The fix has been ported into the release67_fixes repository. http://hg.netbeans.org/release67_fixes/rev/dc07309633cf I've verified the fix in NetBeans 6.7 after downloading updated modules from the update center. |