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 92996 - Exception while creating schema models for DTDs
Summary: Exception while creating schema models for DTDs
Status: VERIFIED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: Schema Model (show other bugs)
Version: 5.x
Hardware: All All
: P1 blocker (vote)
Assignee: Nam Nguyen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-23 02:31 UTC by Samaresh Panda
Modified: 2007-02-07 06:12 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
patch in xam (1.67 KB, patch)
2007-01-30 19:46 UTC, Nam Nguyen
Details | Diff
patch in xdm (1.32 KB, patch)
2007-01-30 19:47 UTC, Nam Nguyen
Details | Diff
patch in schema/api (3.47 KB, patch)
2007-01-30 19:49 UTC, Nam Nguyen
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Samaresh Panda 2007-01-23 02:31:59 UTC
This issue is a side-effect of fixing 92875 and 91333. In brief, CC now looks at
runtime catalog schemas if they are not found in the project catalog.

When it comes to web.xml kind of files, we try to do the same.
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
	 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	 xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
	 version="2.4">
...
</web-app>

The file http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd has been registered in
the catalog but the content is DTD and we get an NPE.

java.lang.NullPointerException
        at org.netbeans.modules.xml.xam.dom.AbstractDocumentComponent.resolveMod
elSource(AbstractDocumentComponent.java:706)
        at org.netbeans.modules.xml.xam.dom.AbstractDocumentComponent._resolveMo
del(AbstractDocumentComponent.java:746)
        at org.netbeans.modules.xml.xam.dom.AbstractDocumentComponent.resolveMod
el(AbstractDocumentComponent.java:738)
        at org.netbeans.modules.xml.schema.model.impl.IncludeImpl.resolveReferen
cedModel(IncludeImpl.java:77)
        at org.netbeans.modules.xml.schema.model.impl.SchemaModelImpl.resolve(Sc
hemaModelImpl.java:157)
        at org.netbeans.modules.xml.schema.model.impl.SchemaModelImpl.resolve(Sc
hemaModelImpl.java:142)
        at org.netbeans.modules.xml.schema.model.impl.SchemaModelImpl.resolve(Sc
hemaModelImpl.java:113)
        at org.netbeans.modules.xml.schema.model.impl.GlobalReferenceImpl.get(Gl
obalReferenceImpl.java:52)
        at org.netbeans.modules.xml.schema.model.impl.GlobalReferenceImpl.get(Gl
obalReferenceImpl.java:34)
        at org.netbeans.modules.xml.axi.impl.Util.getSchemaType(Util.java:146)
        at org.netbeans.modules.xml.axi.impl.ElementImpl.populateChildren(Elemen
tImpl.java:265)
....

I think we should return either a null or status of the model as Invalid.
Comment 1 Samaresh Panda 2007-01-30 18:31:59 UTC
--> To Nam
Comment 2 Nam Nguyen 2007-01-30 19:46:55 UTC
Created attachment 37848 [details]
patch in xam
Comment 3 Nam Nguyen 2007-01-30 19:47:41 UTC
Created attachment 37849 [details]
patch in xdm
Comment 4 Nam Nguyen 2007-01-30 19:49:08 UTC
Created attachment 37850 [details]
patch in schema/api
Comment 5 Nam Nguyen 2007-01-30 20:00:00 UTC
The issue is that XDMAccess does not check for case that XDM returns DOM
Document with null element for a non-XML content.  The fix is simply check for
document element to avoid calling createRootComponent() with null argument.

Checked in trunk.  Patches in relesae551 attached.
Comment 6 Nam Nguyen 2007-01-30 22:31:32 UTC
Reviewed by Ayub.  Fix checked in release551.
Comment 7 Samaresh Panda 2007-02-07 06:12:50 UTC
Works, the unit test is now part of the continuous build.