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 80999 - Exception on validating of broken schema
Summary: Exception on validating of broken schema
Status: VERIFIED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: Schema Tools (show other bugs)
Version: 5.x
Hardware: All Windows XP
: P1 blocker (vote)
Assignee: Praveen Savur
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-24 16:08 UTC by kozlov
Modified: 2006-07-25 13:31 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kozlov 2006-07-24 16:08:19 UTC
Reproduced in build 060723.

To reproduce the bug:

- create a 'newpo' schema;
- switch to Source view;
- remove close tag of 'purchaseOrder' element;
- invoke 'Validate XML'.

Exception:

java.lang.IllegalStateException: The model is not initialized or is broken.
	at
org.netbeans.modules.xml.xdm.XDMModel.checkStableOrParsingState(XDMModel.java:810)
	at org.netbeans.modules.xml.xdm.XDMModel.getDocument(XDMModel.java:678)
	at
org.netbeans.modules.xml.xdm.xam.XDMAccess.getContainingElement(XDMAccess.java:307)
	at
org.netbeans.modules.xml.xdm.xam.XDMAccess.getContainingElement(XDMAccess.java:63)
	at
org.netbeans.modules.xml.xam.dom.AbstractDocumentModel.findComponent(AbstractDocumentModel.java:346)
	at
org.netbeans.modules.xml.xam.spi.XsdBasedValidator$Handler.logValidationErrors(XsdBasedValidator.java:244)
	at
org.netbeans.modules.xml.xam.spi.XsdBasedValidator$Handler.logValidationErrors(XsdBasedValidator.java:256)
	at
org.netbeans.modules.xml.schema.model.validation.SchemaXsdBasedValidator.validate(SchemaXsdBasedValidator.java:71)
	at
org.netbeans.modules.xml.xam.spi.XsdBasedValidator.validate(XsdBasedValidator.java:78)
	at org.netbeans.modules.xml.xam.spi.Validation.validate(Validation.java:73)
	at
org.netbeans.modules.xml.validation.ValidationOutputWindowController.validate(ValidationOutputWindowController.java:59)
	at
org.netbeans.modules.xml.validation.ValidateXMLCookieImpl.validateXML(ValidateXMLCookieImpl.java:50)
	at
org.netbeans.modules.xml.tools.actions.ValidateAction$RunAction.run(ValidateAction.java:95)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:499)
[catch] at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:932)
Comment 1 Chris Webster 2006-07-24 19:51:45 UTC
If the underlying model state is not well formed, then the position finder
should not be invoked. Please change the XsdBasedValidator to reflect this usage. 
Comment 2 Praveen Savur 2006-07-25 05:31:26 UTC
 Added check to see whether model is broken and if so validation prints broken
model message.
Comment 3 kozlov 2006-07-25 13:31:39 UTC
Verified in build060724.