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 160806 - [67cat] org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces.
Summary: [67cat] org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create...
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker with 1 vote (vote)
Assignee: Jesse Glick
URL: http://statistics.netbeans.org/except...
Keywords:
Depends on:
Blocks: 146081
  Show dependency tree
 
Reported: 2009-03-21 21:05 UTC by ulfzibis
Modified: 2009-04-15 18:14 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 27122


Attachments
stacktrace (4.25 KB, text/plain)
2009-03-21 21:06 UTC, ulfzibis
Details
stacktrace (4.25 KB, text/plain)
2009-03-21 21:20 UTC, ulfzibis
Details
stacktrace (4.25 KB, text/plain)
2009-04-04 17:41 UTC, ulfzibis
Details
log (60.41 KB, text/plain)
2009-04-04 19:37 UTC, ulfzibis
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ulfzibis 2009-03-21 21:05:56 UTC
Build: NetBeans IDE 6.5 (Build 200811100001)
VM: Java HotSpot(TM) Client VM, 11.2-b01, Java(TM) SE Runtime Environment, 1.6.0_12-b04
OS: Windows XP, 5.1, x86

User Comments:
GUEST: Attempt to insert  <classpath mode="compile">C:\Users\lk157052\lib\java\antlr\3.1.2\lib\antlr-3.1.2.jar</classpath> into 
----code snippet-----
        <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/2">
            <compilation-unit>
                <package-root>${root}/src/share/classes</package-root>
                <classpath mode="compile">C:\Users\lk157052\lib\java\antlr\3.1.2\lib\antlr-3.1.2.jar</classpath>
            </compilation-unit>
        </java-data>
-----------------------
via project/compiler[langtools]/properties/Java Sources ClassPath/[Add JAR/Folder...] button causes 

org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces.
	at com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.checkDOMNSErr(CoreDocumentImpl.java:2515)
	at com.sun.org.apache.xerces.internal.dom.AttrNSImpl.setName(AttrNSImpl.java:113)
	at com.sun.org.apache.xerces.internal.dom.AttrNSImpl

ulfzibis: changed classpath platform from default to jdk1.7.0_b51 for OpenJDK project "JConsole"



Stacktrace: 
org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces.
        at com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.checkDOMNSErr(CoreDocumentImpl.java:2515)
        at com.sun.org.apache.xerces.internal.dom.AttrNSImpl.setName(AttrNSImpl.java:113)
        at com.sun.org.apache.xerces.internal.dom.AttrNSImpl.<init>(AttrNSImpl.java:74)
        at com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.createAttributeNS(CoreDocumentImpl.java:2127)
        at com.sun.org.apache.xerces.internal.dom.ElementImpl.setAttributeNS(ElementImpl.java:656)
        at org.openide.xml.XMLUtil.fixupAttrsSingle(XMLUtil.java:526)
Comment 1 ulfzibis 2009-03-21 21:06:05 UTC
Created attachment 78582 [details]
stacktrace
Comment 2 ulfzibis 2009-03-21 21:20:00 UTC
Build: NetBeans IDE 6.5 (Build 200811100001)
VM: Java HotSpot(TM) Client VM, 11.2-b01, Java(TM) SE Runtime Environment, 1.6.0_12-b04
OS: Windows XP, 5.1, x86

User Comments: 


Stacktrace: 
org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces.
        at com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.checkDOMNSErr(CoreDocumentImpl.java:2515)
        at com.sun.org.apache.xerces.internal.dom.AttrNSImpl.setName(AttrNSImpl.java:113)
        at com.sun.org.apache.xerces.internal.dom.AttrNSImpl.<init>(AttrNSImpl.java:74)
        at com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.createAttributeNS(CoreDocumentImpl.java:2127)
        at com.sun.org.apache.xerces.internal.dom.ElementImpl.setAttributeNS(ElementImpl.java:656)
        at org.openide.xml.XMLUtil.fixupAttrsSingle(XMLUtil.java:526)
Comment 3 ulfzibis 2009-03-21 21:20:11 UTC
Created attachment 78583 [details]
stacktrace
Comment 4 Jaroslav Tulach 2009-03-22 08:30:44 UTC
This is not lookup problem, maybe XMLUtil one. As such it shall be automatically categorized to Other subcomponent in 
platform component.
Comment 5 mslama 2009-04-01 19:08:13 UTC
I will try to look at it. Please could you send me your freeform project so that I am able to reproduce? Does it happen
on all JDKs? Does it depend on value saved into element? I see it is Windows path.
Comment 6 ulfzibis 2009-04-01 19:19:04 UTC
The project is in jdk1.7.0_b51 source bundle at jdk/make/netbeans/jconsole

My "default" is JDK1.6.0_u12

Comment 7 ulfzibis 2009-04-04 17:41:10 UTC
Build: NetBeans IDE Dev (Build 200904011705)
VM: Java HotSpot(TM) Client VM, 11.2-b01, Java(TM) SE Runtime Environment, 1.6.0_12-b04
OS: Windows XP, 5.1, x86

User Comments: 
Swiched java platform to 1.7.0 b51.
IDE 6.7M3 itself runs on JDK1.6.0u12.


Stacktrace: 
org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces.
        at com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.checkDOMNSErr(CoreDocumentImpl.java:2515)
        at com.sun.org.apache.xerces.internal.dom.AttrNSImpl.setName(AttrNSImpl.java:113)
        at com.sun.org.apache.xerces.internal.dom.AttrNSImpl.<init>(AttrNSImpl.java:74)
        at com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.createAttributeNS(CoreDocumentImpl.java:2127)
        at com.sun.org.apache.xerces.internal.dom.ElementImpl.setAttributeNS(ElementImpl.java:656)
        at org.openide.xml.XMLUtil.fixupAttrsSingle(XMLUtil.java:526)
Comment 8 ulfzibis 2009-04-04 17:41:14 UTC
Created attachment 79446 [details]
stacktrace
Comment 9 ulfzibis 2009-04-04 19:37:23 UTC
Created attachment 79451 [details]
log
Comment 10 mslama 2009-04-06 14:41:28 UTC
Jesse it happens when
XMLUtil.fixupAttrsSingle calls setAttributeNS(null,"xml:base",
"file:/mnt/local/mslama/jdk7b53src/jdk/make/netbeans/common/properties.ent");
I do not know if it is problem on NB side or JDK side. Any hint?

The same happens on 1.7.0-ea-b53
Comment 11 mslama 2009-04-06 14:42:38 UTC
As workaround if you run IDE on JDK 7 JDK 7 is as default platform so you need not to set it explicitly in Properties.
Comment 12 Jesse Glick 2009-04-06 17:57:49 UTC
You must not use the Properties dialog for OpenJDK projects - they have hand-written project.xml's. Anyway there should
be no need to do so, because the project already specifies

        <classpath mode="boot">${bootstrap.jdk}/jre/lib/rt.jar</classpath>

i.e. its intrinsic configuration should be set up to use the bootstrap JDK without user customization.

Nonetheless there is clearly a problem in XMLUtil; perhaps it manifests itself in some other circumstances.
Comment 13 Jesse Glick 2009-04-06 19:29:01 UTC
Related to issue #146081.

I can reproduce, and have fixed. The test does _not_ catch the actual NAMESPACE_ERR reported here (it tests some other
problems that would arise later); something about the way project.ant loads and perhaps clones the DOM tree causes it to
incorrectly report the attribute "xml:base" as being a no-namespace attribute, whereas it should be considered "base" in
the namespace "http://www.w3.org/XML/1998/namespace". So the code fixes this problem but the test does not verify it - I
was unable to figure out how to get the test to simulate the real behavior.

core-main #1d645f781b21

I should repeat that this fix causes the IDE to write out a new project.xml, without throwing any exceptions, which is
semantically correct and valid according to schema. However the rewritten project.xml will have all entity includes
expanded in place rather than referenced as in the original, which is certainly not what you want. (Making XML
round-trip code write out changes to entities would be difficult, and it would be impossible to ascertain what other
including documents might be broken as a result.) Again, anyone using the OpenJDK freeform projects should _not_ use the
Properties dialog.
Comment 14 Quality Engineering 2009-04-07 20:21:46 UTC
Integrated into 'main-golden', will be available in build *200904071400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/1d645f781b21
User: Jesse Glick <jglick@netbeans.org>
Log: #160806: problems with validating and writing entity includes.
Comment 15 ulfzibis 2009-04-15 11:27:50 UTC
> Again, anyone using the OpenJDK freeform projects should _not_ use the Properties dialog.

IMHO the only proper way to fix this issue is:
Disable the changeability of the regarding properties for free-form projects in Project Properties dialogue. At least
add a BOLD red-couloured blinking hint at prominent position about the consequences in this dialogue.
Comment 16 Jesse Glick 2009-04-15 18:14:30 UTC
@ulfzibis: your request is distinct from the exception mentioned here, and anyway is already filed separately. The
difficulty is in calculating _which_ projects cannot be safely modified using the GUI. Please do not comment further on
the topic in this issue.