Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 179223 - XML namespaces are not correctly recognised in XHTML pages
XML namespaces are not correctly recognised in XHTML pages
Product: javaee
Classification: Unclassified
Component: JSF Editor
PC Linux
: P3 (vote)
: 6.x
Assigned To: Marek Fukala
Depends on:
  Show dependency treegraph
Reported: 2010-01-05 06:43 UTC by wvreeven
Modified: 2010-01-19 05:22 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT

Tag completion working. (41.95 KB, image/png)
2010-01-08 06:37 UTC, wvreeven
Tag completion broken (35.49 KB, image/png)
2010-01-08 06:38 UTC, wvreeven
The exceptions from ide log file (4.07 KB, text/plain)
2010-01-08 08:53 UTC, Marek Fukala

Note You need to log in before you can comment on or make changes to this bug.
Description wvreeven 2010-01-05 06:43:17 UTC
I have imported a Maven project into NetBeans 6.8. The project depends on JBoss RichFaces 3.3.2 and Seam 2.1.2. This ensures that Facelets 1.1.14 is included automatically.

Most of our pages are includes into templates. The top line of the xhtml pages are e.g.

<ui:composition xmlns="" xmlns:s="" xmlns:ui="" xmlns:f="" xmlns:h="" xmlns:rich="" xmlns:a4j="">

NetBeans complains about these lines with the message "the attribute xmlns is not defined in the component's interface.". Moreover, all JSF tags from the rich, a4j and s namespaces are not recognised by NetBeans, despite the jars being present in the Project due to the Maven dependencies.

I have submitted a similar bug before: However this bug was closed. Please do not do that this time. Thanks in advance.
Comment 1 Marek Fukala 2010-01-05 07:36:18 UTC
The issue with the xmlns attribute being underlined with the squiggy red line is a bug. Moreover the URIs completion doesn't work in non-pure-html tags.

As for the completion not working - if I create a new web maven project, add all the richfaces jars as libraries, create a new xhtml file and put your header inside the completion and other features works well. 

Can you please attach a demo project so I can reproduce the second issue please?
Comment 2 wvreeven 2010-01-05 07:41:27 UTC
Thanks for the quick reply. I will create a demo project for you and attach it to this issue later this week.
Comment 3 Marek Fukala 2010-01-07 02:28:30 UTC
xmlns attribute fix:
Comment 4 Quality Engineering 2010-01-07 23:44:50 UTC
Integrated into 'main-golden', will be available in build *201001080200* on (upload may still be in progress)
User: Marek Fukala <>
Log: #179223 - XML namespaces are not correctly recognised in XHTML pages
Comment 5 wvreeven 2010-01-08 03:38:38 UTC
As it turns out, tag completion works but it sometimes stops working. I have created a rather lengthy xhtml file which will take some time for NetBeans to parse. If during parsing the file I press page down, all rich, a4j and s tags get red squiggy underlinging and tag completion stops working for those namespaces. Closing the file and then reopening it won't solve the issue. I need to stop and start NetBeans again and let the parser do its job for completion to work again in that file.

I'll try to create a project with such a file and describe how to reproduce this, since regrettably I am not at liberty to share my current projects file.
Comment 6 Marek Fukala 2010-01-08 04:12:58 UTC
You can send me the file in private by email if you want.
Comment 7 Marek Fukala 2010-01-08 06:11:11 UTC
I tried to reproduce the issue with a file sent to me by email by wvreeven, but with no luck. This might be related to the fact I had to use my own maven web project with different POM. When I added the richfaces library the coloring of rich and a4j tags started to work. Completion and other parser related features also works fine.

Honestly, I cannot imagine how could be the editor's behaviour so weird - first the file is parsed fine, then, after some modification you press page down and suddenly the parse tree becomes invalid and the coloring disappears? Phew! Is that really what happens to you? Is this behavior repeatable?

Even if the file is unparsable the features should still work, at least to some extent. That's because of what matters the most is the parsing of the libraries descriptors itself (richfaces, seam .taglib.xml files). If their parsing fails, then the editor will screw up in the described way.

Please try to send me your POM as well or preferably the whole project packed along with a list of steps to reproduce.

Thanks in advance.
Comment 8 wvreeven 2010-01-08 06:33:38 UTC
the project is over 200 Mb large, so I'll need to get rid of some images etc before I can provide it to you. I'll attach two screenshots to prove that what I say is true :-)
Comment 9 wvreeven 2010-01-08 06:37:03 UTC
Created attachment 93132 [details]
Tag completion working.

This screenshot shows that tag completion is working. The drop down with possible tags is shown.
Comment 10 wvreeven 2010-01-08 06:38:09 UTC
Created attachment 93133 [details]
Tag completion broken

This screenshot shows that the tag completion is not working. Moreover, the rich, ajf and s tags are not recognised by NetBeans. It is the same xhtml file as the one in the screenshot with working tag completion!
Comment 11 wvreeven 2010-01-08 08:05:26 UTC
Shared my project with Marek Fukala in a private email conversation. He is able to reproduce the issue now. Great stuff. Looking forward for the fix :-)
Comment 12 Marek Fukala 2010-01-08 08:53:02 UTC
Created attachment 93136 [details]
The exceptions from ide log file
Comment 13 Marek Fukala 2010-01-08 08:59:52 UTC
There's an exception logged in the ide log with Level.INFO level:

Caused: com.sun.faces.config.ConfigurationException: Unable to parse document 'file:/Users/marekfukala/NetBeansProjects/vpa/src/main/webapp/WEB-INF/vpa.taglib.xml': org.apache.xerces.parsers.XML11Configuration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration
	at org.netbeans.modules.web.jsf.editor.facelets.mojarra.ConfigManager$
[snip - see previous attachement]

The problem seems to be caused by inheriting a classloader in a thread run from Mojarra's executor which loads xerces classes which are not those the mojarra's dom parser expects.

fixed in web-main#5ef902be9461.

I hope the fix helps, at least for me I cannot reproduce anymore.

For the sake of completeness I must add the issue is quite well reproducible according to the reporter's steps. I just misread the part about pressing enter after opening the file and incorrently pressed enter inside the editor itself before pressing the pagedown key.
Comment 14 Quality Engineering 2010-01-09 23:40:18 UTC
Integrated into 'main-golden', will be available in build *201001100200* on (upload may still be in progress)
User: Marek Fukala <>
Log: #179223 -  XML namespaces are not correctly recognised in XHTML pages
Comment 15 wvreeven 2010-01-11 13:32:23 UTC
I downloaded NB Nighlty 201001110200 and verified that this issue has been resolved. Many thanks for the quick fix! I hope the fix will soon be available.
Comment 16 Marek Fukala 2010-01-12 03:34:50 UTC
Lets put the fix into the 6.8 patch.
Comment 17 pgebauer 2010-01-14 13:37:23 UTC
The fix has been ported into the release68_fixes repository.
Comment 18 Jindrich Sedek 2010-01-19 05:22:20 UTC

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo