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 55441 - IllegalStateException while editing web.xml as text
Summary: IllegalStateException while editing web.xml as text
Status: CLOSED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: DD Editor (show other bugs)
Version: 4.x
Hardware: PC Windows ME/2000
: P3 blocker (vote)
Assignee: Milan Kuchtiak
URL:
Keywords: RANDOM
Depends on:
Blocks:
 
Reported: 2005-02-23 22:37 UTC by _ pcw
Modified: 2006-03-24 13:17 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
stack trace (1007 bytes, text/plain)
2005-02-23 22:38 UTC, _ pcw
Details
Much better stack trace than original attachment. (2.62 KB, text/plain)
2005-02-23 22:43 UTC, _ pcw
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ pcw 2005-02-23 22:37:47 UTC
I opened web.xml in text mode side by side with
the visual config editors for sun-web.xml.

Then I created a new empty line right below
<web-app...>, typed "<servlet>" and got this
exception popup as soon as I typed the closing ">".

Annotation: Exception occurred in Request Processor
java.lang.IllegalStateException: BaseDocument.write()
	at
org.openide.text.CloneableEditorSupport.getInputStream(CloneableEditorSupport.java:1122)
	at
org.netbeans.modules.xml.multiview.XmlMultiViewDataObject.createInputStream(XmlMultiViewDataObject.java:169)
Comment 1 _ pcw 2005-02-23 22:38:23 UTC
Created attachment 20492 [details]
stack trace
Comment 2 _ pcw 2005-02-23 22:43:10 UTC
Upon checking my log, it appears the exception that popped up actually
followed another one that was displayed in the log only and had more
information.  See second attachment and disregard first one.
Comment 3 _ pcw 2005-02-23 22:43:46 UTC
Created attachment 20493 [details]
Much better stack trace than original attachment.
Comment 4 Milan Kuchtiak 2005-02-24 08:49:52 UTC
I noticed that as well few times during editing.
The exception is caused by BadLocationException from
CloneableEditorSupport:getInputStream() method.
However today I am not able to reproduce that.

Basically, we call the CloneableEditorSupport:getInputStream() method
(after couple of changes in DD editor) to get the data model and to
synchronize with the graphical view.

Jarda, can you help how we can prevent the BadLocationException ?
Comment 5 Jaroslav Tulach 2005-02-24 12:10:08 UTC
I doubt I can prevent it, it can be thrown by anyone. I've just add 
better debug messages to know who is causing the exception. 
 
cvs ci -m "Improving debugging capabilities" 
cvs commit: Examining . 
Checking in CloneableEditorSupport.java; 
/cvs/openide/src/org/openide/text/CloneableEditorSupport.java,v  <--  
CloneableEditorSupport.java 
new revision: 1.141; 
Comment 6 Milan Kuchtiak 2005-03-01 15:20:26 UTC
I was not able to reproduce the issue any more.
It (most likely) fixed by fixing the issue 38853.

Diff:
http://xml.netbeans.org/source/browse/xml/multiview/src/org/netbeans/modules/xml/multiview/XmlMultiViewDataObject.java.diff?r1=1.29&r2=1.30
Comment 7 zikmund 2005-07-13 16:26:40 UTC
Verified.