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 177018 - Need to update Mojarra in GF: <h:***> Errors in xhtml file for Maven JSF 2.0 projects
Summary: Need to update Mojarra in GF: <h:***> Errors in xhtml file for Maven JSF 2.0 ...
Status: VERIFIED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: JSF Editor (show other bugs)
Version: 6.x
Hardware: PC Linux
: P1 normal (vote)
Assignee: Marek Fukala
URL:
Keywords:
Depends on:
Blocks: 177500
  Show dependency tree
 
Reported: 2009-11-17 13:00 UTC by jcampbell
Modified: 2010-12-07 09:15 UTC (History)
5 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 jcampbell 2009-11-17 13:00:50 UTC
All <h:> items (such as <h:head> or <h:body>) show up as errors (Error Message: "The component library Html Basic does not contain such a component") in a Maven JSF 2.0 project.

Reproduce
1. Install fresh nightly Netbeans 6.8 (I used 200911170201)
2. Activate Web and Java SE
3. Add Glassfish v3 Server
4. Create a new Maven Web Application
5. Go to properties > Frameworks (of the newly created project)
6. Add "JSF ServerFaces"
7. Open the index.xhtml file (under "Web Pages")

Results:
Basic .xhtml file show with 2 errors; 1 for the <h:head> and one for the <h:body>

When I put my mouse cursor over the error, I get the message "The component library Html Basic does not contain such a component"

Expected Results:
No errors

Notes:
- I first saw this bug in 200911160201 build and is still appearing in 200911170201 build
- This bug does NOT happen in 200911091156 build
Comment 1 jcampbell 2009-11-17 13:02:27 UTC
Additional note: This bug does not occur in native NetBeans Web Application projects (only Maven Web Applications)
Comment 2 Marek Fukala 2009-11-18 02:41:48 UTC
I fixed this yesterday - see issue #176891

However the problem with the h:body and h:head being underlined remains since the library descriptor in the currently bundled jsf2.0 impl in glassfish are obsolete (the issue already fixed in Mojarra).

I'll keep this issue opened for the jsf-imp.jar update task.
Comment 3 Jindrich Sedek 2009-11-18 03:30:48 UTC
This issue should be P1, since most of XHTML files are full of false errors in maven projects, we should keep this issue open till we get bundled new version of glassfish with new version of Mojara.
Comment 4 Petr Jiricka 2009-11-18 05:49:35 UTC
Cc'ing Alexey, who will be updating the JSF 2.0.x library.
Comment 5 jcampbell 2009-11-18 08:42:46 UTC
FYI.... 

I JUST updated my dev NetBeans to 200911171401 and I updated my JSF 2.0 jar dependencies, in my pom.xml, to the latest version of Mojarra (2.0.2-b05) and I STILL get errors on <h:***>
Comment 6 Marek Fukala 2009-11-18 08:54:08 UTC
That's correct - the bundled jsf2.0 library which is used as a fallback when there isn't any jar file providing the descriptors is found on the classpath hasn't been updated yet so it still contains the old descriptors.

The only way how you can NOW get rid of the problem is to use a build which contains the fix of issue 176992 (fixed before few hours) and then add a dependency to mojarra2.0.2-05 artifact.
Comment 7 Jindrich Sedek 2009-11-19 03:02:49 UTC
Incorrectly marked missing attribute "contentType" in this code should be also fixed in new version of moraja:
----------------------
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
      xmlns:f="http://java.sun.com/jsf/core">
    <f:view contentType="text/html; charset=iso-8859-1"/>
</html>
---------------------
Comment 8 Alexey Butenko 2009-11-19 03:26:19 UTC
(In reply to comment #4)
> Cc'ing Alexey, who will be updating the JSF 2.0.x library.

Library updated by Nov 18th nightly bits.
Comment 9 Marek Fukala 2009-11-23 03:00:41 UTC
The issue is already fixed - the bundled web.jsf20 library has been updated, and the latest GF bundled with IDE already contains the updated Mojarra's descriptors.
Comment 10 jcampbell 2009-11-23 09:30:42 UTC
This bug STILL exists in 200911220201 (following "Reproduce" steps in the first comment)
Comment 11 jcampbell 2009-11-23 10:13:33 UTC
Other notes:  I was able to make the bug go away if I changed the version number of the dependencies in the the pom.xml

FROM:

        <dependency>
            <groupId>javax.faces</groupId>
            <artifactId>jsf-api</artifactId>
            <version>2.0</version>
        </dependency>
        <dependency>
            <groupId>com.sun.faces</groupId>
            <artifactId>jsf-impl</artifactId>
            <version>2.0.2-b02</version>
        </dependency>

TO:

        <dependency>
            <groupId>javax.faces</groupId>
            <artifactId>jsf-api</artifactId>
            <version>2.0.2-b07</version>
        </dependency>
        <dependency>
            <groupId>com.sun.faces</groupId>
            <artifactId>jsf-impl</artifactId>
            <version>2.0.2-b07</version>
        </dependency>


SO.... In my opinion... The default versions of the jsf-impl and jsf-api need to be fixed/updated (set to 2.0.2-b07 (or greater) when adding JSF framework on a Maven Web application) in order to mark this bug fixed.
Comment 12 Petr Jiricka 2009-11-23 11:21:57 UTC
It looks like this depends on bug 177141. Cc'ing Milos.
Comment 13 Milos Kleint 2009-11-24 02:00:38 UTC
com.sun.faces:jsf-impl:2.0.2-b07
seems to be present in the java.net repository so we only need to update the jsf20 lib's pom volume.

however I could not find the
javax.faces:jsf-api:2.0.2-b07 artifact in the repository.
Comment 14 Alexey Butenko 2009-11-24 03:33:17 UTC
(In reply to comment #13)
> com.sun.faces:jsf-impl:2.0.2-b07
> seems to be present in the java.net repository so we only need to update the
> jsf20 lib's pom volume.
> 
> however I could not find the
> javax.faces:jsf-api:2.0.2-b07 artifact in the repository.
I've found it under com/sun/faces
pushed into web-main
here the diff for QE to review: http://hg.netbeans.org/web-main/rev/1e6ef46b794d
Comment 15 Martin Schovanek 2009-11-24 10:01:56 UTC
Verified by QE at web-main.
Comment 16 Marek Fukala 2009-11-24 10:18:35 UTC
the fix look ok to me, approved.

fixed in release68#31ee994757b8
Comment 17 Martin Schovanek 2009-11-25 03:22:42 UTC
Verified at the release68 by QE.
Comment 18 Quality Engineering 2009-11-25 16:58:58 UTC
Integrated into 'main-golden', will be available in build *200911251400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/1e6ef46b794d
User: Alexey Butenko <alexeybutenko@netbeans.org>
Log: #177018: Updated pom values
Comment 19 alanobject 2010-11-21 03:02:51 UTC
I know this bug has been marked as fixed but I am still having this problem in 7.0 Beta.  

My dependencies include:

        <dependency>
            <groupId>com.sun.faces</groupId>
            <artifactId>jsf-api</artifactId>
            <version>2.1.0-SNAPSHOT</version>
            <type>jar</type>
        </dependency>
        </dependency>
        <dependency>
            <groupId>com.sun.faces</groupId>
            <artifactId>jsf-impl</artifactId>
            <version>2.0.2-b10</version>
        </dependency>

Which according to the comments above should fix this problem.  Should this bug be reopened?
Comment 20 kumm 2010-11-28 10:56:57 UTC
I have this problem too with my maven web project.
Version: Dev 201011280001.

All my xhtml files show error in editor at h:head, and h:body lines.

'Error: Element head from namespace http://java.sun.com/jsf/html not allowed as child of XHTML element "html" in this context ....'

Sure, h:head is an not xhtml element, so the message is correct. Same case for h:body.

At DOCTYPE line a warning says: 'skipping entity [dtd]'
I don't know what this exactly means. 

The 'solution' is:
at this DOCTYPE line click on the warning icon, and switch off the xhtml syntax check.

I don't know whether is it the right way.
Comment 21 Marek Fukala 2010-12-07 09:15:22 UTC
the original issue has been fixed, what you report is a duplicate of another issue 192486 -  Common JSF elements such as h:head and h:body elements are marked as errors