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 253098 - AssertionError at org.netbeans.modules.editor.structure.api.DocumentModel$DocumentModelModificationTransaction.addDocumentElement
Summary: AssertionError at org.netbeans.modules.editor.structure.api.DocumentModel$Doc...
Status: NEW
Alias: None
Product: xml
Classification: Unclassified
Component: Code (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal with 1 vote (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-21 17:13 UTC by MackSix
Modified: 2018-02-21 15:08 UTC (History)
18 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 218082


Attachments
stacktrace (3.52 KB, text/plain)
2015-06-21 17:13 UTC, MackSix
Details
stacktrace (3.67 KB, text/plain)
2015-06-22 09:22 UTC, abien
Details
stacktrace (3.67 KB, text/plain)
2015-07-14 09:44 UTC, abien
Details
stacktrace (3.52 KB, text/plain)
2015-08-05 08:36 UTC, jan.kurnatowski
Details
stacktrace (3.59 KB, text/plain)
2015-08-07 22:23 UTC, Exceptions Reporter
Details
stacktrace (3.58 KB, text/plain)
2015-09-15 03:43 UTC, MackSix
Details
stacktrace (3.58 KB, text/plain)
2015-10-09 17:16 UTC, MackSix
Details
stacktrace (3.58 KB, text/plain)
2015-11-04 03:52 UTC, misterm
Details
stacktrace (3.73 KB, text/plain)
2015-11-04 03:55 UTC, misterm
Details
stacktrace (3.58 KB, text/plain)
2015-11-04 03:58 UTC, misterm
Details
stacktrace (3.74 KB, text/plain)
2016-02-25 10:32 UTC, Pavel Flaska
Details
stacktrace (3.73 KB, text/plain)
2017-04-21 07:01 UTC, brettryan
Details
Stacktrace for empty xml file. (973 bytes, text/plain)
2017-08-23 12:06 UTC, Christian Lenz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description MackSix 2015-06-21 17:13:57 UTC
This bug was originally marked as duplicate of bug 159179, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.

Build: NetBeans IDE Dev (Build 201506190001)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.45-b02, Java(TM) SE Runtime Environment, 1.8.0_45-b15
OS: Windows 7

User Comments:
MackSix: Tried to open /WEB-INF/beans.xml in a web project.




Stacktrace: 
java.lang.AssertionError
   at org.netbeans.modules.editor.structure.api.DocumentModel$DocumentModelModificationTransaction.addDocumentElement(DocumentModel.java:875)
   at org.netbeans.modules.editor.structure.api.DocumentModel.addRootElement(DocumentModel.java:576)
   at org.netbeans.modules.editor.structure.api.DocumentModel.<init>(DocumentModel.java:196)
   at org.netbeans.modules.editor.structure.api.DocumentModel.getDocumentModel(DocumentModel.java:241)
   at org.netbeans.modules.xml.text.breadcrumbs.EditorRegistryMonitor.findTextModel(EditorRegistryMonitor.java:105)
   at org.netbeans.modules.xml.text.breadcrumbs.EditorRegistryMonitor.componentActivated(EditorRegistryMonitor.java:130)
Comment 1 MackSix 2015-06-21 17:13:59 UTC
Created attachment 154317 [details]
stacktrace
Comment 2 MackSix 2015-06-21 17:21:03 UTC
The beans.xml file is empty.
Comment 3 abien 2015-06-22 09:22:43 UTC
Created attachment 154323 [details]
stacktrace

Happened during opening a XML document
Comment 4 abien 2015-07-14 09:44:26 UTC
Created attachment 154610 [details]
stacktrace

Happened during opening persistence.xml
Comment 5 jan.kurnatowski 2015-08-05 08:36:34 UTC
Created attachment 155182 [details]
stacktrace

Trying to reproduce Report #218082. I closed all projects and restarted IDE, then chosed File -> New Project -> PHP -> PHP Application. Then I clicked on Project's Source Files and selected New -> Empty File... -> test.xml. I opened test.xml, removed all characters (more precisely:  I removed a solitary newline character) and saved. Now this exception is thrown when I navigate into opened test.xml.
Comment 6 Exceptions Reporter 2015-08-07 22:23:05 UTC
Created attachment 155225 [details]
stacktrace

Just created Sample Payroll Application using Batch from the JavaEE samples
Comment 7 MackSix 2015-09-15 03:43:59 UTC
Created attachment 156168 [details]
stacktrace

Opening blank  pom.xml
Comment 8 MackSix 2015-10-09 17:16:04 UTC
Created attachment 156645 [details]
stacktrace

Opened empty beans.xml
Comment 9 misterm 2015-11-04 03:52:01 UTC
Created attachment 157131 [details]
stacktrace

Double clicking on beans.xml
Comment 10 misterm 2015-11-04 03:55:01 UTC
Created attachment 157132 [details]
stacktrace

.
Comment 11 misterm 2015-11-04 03:58:01 UTC
Created attachment 157133 [details]
stacktrace

.
Comment 12 Pavel Flaska 2016-02-25 10:32:20 UTC
Created attachment 158639 [details]
stacktrace

1. Create an empty file:
$ touch test.svg

2. Use --open command line option:
$ /home/pflaska/dev/netbeans/bin/netbeans --open test.svg

Result:
repeating AssertionError occured.
Workaround:
update the file from command line, then I am able to close the dialog.
Comment 13 brettryan 2017-04-21 07:01:12 UTC
Created attachment 164152 [details]
stacktrace

Opened empty fxml.
Comment 14 Christian Lenz 2017-08-23 12:06:06 UTC
Created attachment 164993 [details]
Stacktrace for empty xml file.

I have the same problem when I have an empty test.xml file. I don't have any problems with my my NetBeans IDE 8.2 Patch 2 stable version, but it happens in the latest nightly. When I don't have open any projects and I open this file, I got the exception. It happens too when I have a lot of projects open.
Comment 15 Christian Lenz 2017-08-23 12:07:05 UTC
Atm I tried to reproduce it but w/o luck in my production enviroment.
Comment 16 Christian Lenz 2017-08-23 20:03:27 UTC
I got the exception when the XML file is really empty. 0 Bytes. And with help from benno, I have to set -J-ea in my conf for the stable version too, to see whether it happens there too and yes it happens there too.