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 178049 - Facelets page error checker is problematic
Summary: Facelets page error checker is problematic
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: JSF Editor (show other bugs)
Version: 6.x
Hardware: PC Linux
: P3 normal (vote)
Assignee: Marek Fukala
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-03 00:49 UTC by hantsy
Modified: 2010-10-27 10:43 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
screenshot (112.93 KB, image/png)
2009-12-03 00:51 UTC, hantsy
Details
screenshot after reinstallation (103.72 KB, image/png)
2009-12-03 02:08 UTC, hantsy
Details
screenshot (124.80 KB, image/png)
2009-12-03 04:32 UTC, hantsy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description hantsy 2009-12-03 00:49:32 UTC
I created a seam(2.2.GA) project from seam command and open it from NetBeans IDE 6.8 RC1.

There are some errors markers on xhtml page(in the layout folder, each page are marked as errors occurred), but there are no errors.

The seam taglib are also marked as errors, but no indication about it.

Please research the attachment.
Comment 1 hantsy 2009-12-03 00:51:48 UTC
Created attachment 92023 [details]
screenshot
Comment 2 Alexey Butenko 2009-12-03 01:08:34 UTC
Could you provide sample project to reproduce?
Comment 3 Alexey Butenko 2009-12-03 01:09:59 UTC
Do you have any errors during build and deploy?
Comment 4 hantsy 2009-12-03 01:32:21 UTC
This is a new created project... without one line extra code, I deployed it into JBoss 5.1, and it works well.

From the indication of the error marker, it can not determine the xmlns attribute if the root element is not "html".

You can download Seam 2.2.0GA release package, and use ./seam setup and ./seam create-project in seam directory to create a new project and verify the problem. The seam scaffold is based on ant, so the project includes all needed jars, it is two big, so I will not upload it here.

I reused the NetBeans user dir from Beta version(move folder 6.8beta to 6.8rc1 in ~/.netbeans directly), and I will remove my NetBeans user dir, and reinstall IDE to verify this problem later.
Comment 5 hantsy 2009-12-03 02:06:30 UTC
The problem is still here after I installed a clean version(I removed the userdir for 6.8rc1).
Comment 6 hantsy 2009-12-03 02:08:29 UTC
Created attachment 92028 [details]
screenshot after reinstallation
Comment 7 Alexey Butenko 2009-12-03 02:24:51 UTC
Marek, could you take a look, as I remember you were fixing similar issues with
error highlighting. IMHO it is P3, not P2, since it is not break anything.
Comment 8 hantsy 2009-12-03 02:38:41 UTC
I think this bug must be fixed in this version(before 6.8fcs).
By the way, the project created by the seam scaffold is a freeform project.
Comment 9 Marek Fukala 2009-12-03 02:55:36 UTC
Just from the glimpse I see two problems here:
1) the default xmlns attribute is marked as nonexisting - this is a P3 bug, the error checks doesn't find this attribute in the component's interface, but since this is a generic xml attribute it must not be flagged as error.

2) there is apparently a problem with parsing the seams facelets descriptors or TLDs. I'm downloading seams right now, I'll check the issue in a half an hour.
Comment 10 Marek Fukala 2009-12-03 03:41:26 UTC
There doesn't seem to be a jar file containing a facelets descriptor or at least a tld file for the "http://jboss.com/products/seam/taglib" namespace. Hence all the references to this library are marked as errors. Other facelets libraries like the richfaces works fine, they  have their jars on the project classpath.

Please specify where the descriptors for http://jboss.com/products/seam/taglib library are in the project structure.
Comment 11 Marek Fukala 2009-12-03 03:57:52 UTC
OK, I finally found it - it's in jboss-seam-ui.jar, I'll check why this is not indexed properly while other jars from the same folder are.
Comment 12 Marek Fukala 2009-12-03 04:10:44 UTC
Hmmm, the jboss-seam-ui.jar is not on the project's compile classpath, which is used by the jsf support for indexing the facelets libraries.

Once you add lib/jboss-seam-ui.jar to the proper entry in ${project_home}/nbproject/project.xml the library is parsed and editor works fine for the component usages.

<java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/2">
            <compilation-unit>
                <package-root>src/main</package-root>
                <classpath mode="compile">lib/jboss-seam-ui.jar: [snip]
Comment 13 hantsy 2009-12-03 04:32:05 UTC
Created attachment 92036 [details]
screenshot

I added it, but the error marker did not disappear.
I restarted NetBeans IDE, there is no effect.
Comment 14 Marek Fukala 2009-12-03 06:03:10 UTC
hantsy, as I've written already, there used to be two issues:
1) the xmlns being marked as error
2) the components from "http://jboss.com/products/seam/taglib" library marked as unknown

#2 is caused by the issue with missing compile classpath entry in the project.xml

#1 is unrelated to that and not fixed yet.

On your last screenshot I can see just #2.

Does the #1 problem disappears once you add the jboss-seam-ui.jar jar file to the compile classpath as I suggested? Just this problem can be considered as P1, the second is really minor issue which cannot harm anyone.
Comment 15 hantsy 2009-12-03 07:25:16 UTC
As displayed in the last screenshot, you can see that I'v added the jboss-seam-ui.jar(in the right editor)...

But the problem still occurs and no change, it is same with that before added the jboss-seam-ui jar.

The indicator information on error marker has no different from before.

Yes, when added jboss seamui jar, the s prefix taglib can be recognized.

I think this is a big problem when using facelets as jsf page template. 

It is strange that xhtml is also xml, there is no problem when I use more than one namespace in the Spring configuration file, why xhtml is problematic?

The difference I think is that facelets xhtml mapped the tranditinal taglib tld defs to xml namespace but xml using native dtd or schema to define xml element and attribute.
Comment 16 Marek Fukala 2009-12-03 08:15:41 UTC
>Yes, when added jboss seamui jar, the s prefix taglib can be recognized.
Which was the reason why this issue was P1, wasn't it?

Again, the xmlns attribute being marked as error is a bug which I consider as minor by contrast to the problem with the unrecognized library.

Do you consider the issue with xmlns attribute as a stopper for your workflow? [YES/NO] 

If YES, please explain why.

Thanks.
Comment 17 hantsy 2009-12-03 08:57:05 UTC
Beside the xmlns attribute error marker...The root element attribute name and value code completion also does not work.

This will make user feel it is strange that XHTML is xml, but it works not like xml.

I think if tld is treat as a normal xml schema definition form, like DTD and xml schema, this problem can be fixed easily.
Comment 18 hantsy 2009-12-03 08:58:48 UTC
This is only my idea.
If you think this is not a stopper, you can skip it.
Comment 19 hantsy 2009-12-04 20:02:53 UTC
I think this problem can be categorised as :

1. If xmlns value is missing(the jboss seam ui taglib is missing in the picture but no indication on the xmlns declaration ),the error marker may be marked on it(basically, indicated it is not found in classpath, more effective provide fix action,eg search in classpath, or replace it a known one)...

2. Process the root element as XML(the rich:xxx root element declaration error which complained the xmlns attribute was invalid, I think you must rethink which tags of the taglib(eg. rich:) can be process as root element. I've said if treat tld as a xml definition form, this problem can be fix quickly)...
Comment 20 hantsy 2010-05-11 10:53:57 UTC
It is fixed in NetBeans 6.9 ???
Comment 21 Marek Fukala 2010-05-11 11:54:38 UTC
(TM == Next) ==> No, its not fixed.

And I must admit I'm having troubles trying to understand what the latest state of you problem is. Could you please try to summarize it again for me? 

I'm sorry but I do not understand some of your thoughts/comments much :-|
Comment 22 hantsy 2010-05-11 14:58:01 UTC
Now, NetBeans determin if a xml file is validated by its dtd definition (declared in doctype) or xml schema definition(declared xmlns in root element).
In facelets file(xhtml), some tags are not from standard DTD or xsd file, but from the JSF specific tld file(on the seam framework website,  somebody suggested jsf taglib definition file use xsd directly).

In a word, treat tld as another xml tag definition form(beside dtd, xsd, and relaxng). Then, like provide in dtd and xsd, provide a tldparser to process jsf specific tag in the xhtml file.
Comment 23 Marek Fukala 2010-05-11 15:51:42 UTC
(In reply to comment #22)
> Now, NetBeans determin if a xml file is validated by its dtd definition
> (declared in doctype) or xml schema definition(declared xmlns in root element).
> In facelets file(xhtml), some tags are not from standard DTD or xsd file, but
> from the JSF specific tld file(on the seam framework website,  somebody
> suggested jsf taglib definition file use xsd directly).
> 
> In a word, treat tld as another xml tag definition form(beside dtd, xsd, and
> relaxng). Then, like provide in dtd and xsd, provide a tldparser to process jsf
> specific tag in the xhtml file.

What is the *real* problem? Is that the xmlns attribute being marked as unknown and therefire the file having a "red" status? This is issues is already fixed. Is there anything else *in particular*?
Comment 24 Marek Fukala 2010-05-11 15:53:27 UTC
What is the *real* problem? Is it the xmlns attribute being marked as unknown
and therefore the file having a "red" status? This issue is already fixed.
Is there anything else *in particular*?
Comment 25 Marek Fukala 2010-10-27 10:43:46 UTC
The issue seems to be fixed now. Reporter please reopen if you object and describe the erroneous case.