Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 178401 - Unable to use Facelets in Maven web project with JSF 2.0
Unable to use Facelets in Maven web project with JSF 2.0
Status: RESOLVED FIXED
Product: javaee
Classification: Unclassified
Component: JSF
7.0
PC Windows 7 x64
: P3 (vote)
: 6.x
Assigned To: issues@javaee
issues@javaee
68patch1-verified
:
: 179349 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-12-09 20:08 UTC by rdelaplante
Modified: 2011-03-04 05:40 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
:


Attachments
screen showing jsf framework (42.86 KB, image/png)
2011-01-23 12:48 UTC, Alniks
Details
no facelets libraries found (76.03 KB, image/png)
2011-01-23 12:48 UTC, Alniks
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rdelaplante 2009-12-09 20:08:35 UTC
I'm using NetBeans 6.8 RC2 on OpenSolaris 2009 11.

I created a Maven web project, chose Java EE 6, and pressed finish. The project properties "frameworks" section shows that JavaServer Faces is used by this project by default.  All of the fields on the Libraries and Configuration tabs are grayed out except Preferred Page Language, which is set to JSP.  There is no Facelets option.  I do see JSF 2.0 is selected on the Libraries tab.  I noticed that the new project wizard created an index.jsp, not an index.xhtml.   When I use the New File wizard to create a Facelets template, there is an error at the bottom that prevents me from continuing: "No Facelets Libraries Found"

When I create a regular Java Web project (not Maven) and select Java EE 6, it lets me configure the frameworks in the new project wizard.  Facelets was available for JSF 2.0, and selected by default. It created an index.xhtml instead of an index.jsp, and it let me create a new Facelet template.
Comment 1 Jaroslav Pospisil 2009-12-10 03:25:00 UTC
This scenario works with Win Vista and FCS.I'll try Opensolaris,but definitelly not P1.
Comment 2 Milos Kleint 2009-12-10 03:31:47 UTC
new project wizard does indeed generate index.jsp, not any xhtml file. that's what the archetype generates. Not sure how it relates to the other facelet problem. reassigning to jsf for evaluation. 
please let me know why 
1. is jsf considered a setup framework in project
2. is there no facelet option
3. what the error when creating facelet means, what j2ee api are the facelets part of.
Comment 3 Jaroslav Pospisil 2009-12-10 03:58:55 UTC
Can't reproduce even on OpenSolaris,JDK 1.6.0_18 with FCS. Try it please with
final 6.8 build and if reproducible there,add more detailed scenario (there's
strange fact,that in just built maven web app you have already JSF
installed,because it can't be selected in wizard as for ant projects).For
now,marking as INCOMPLETE.
Comment 4 rdelaplante 2009-12-10 04:08:14 UTC
I tried again just now. I created a new Maven web project (JEE6), then went to the project properties and saw that no framework was selected.  That is different from the first time I tried, where it added JSF to the new project automatically.

This time I manually added the JSF framework to the project using the project properties.  All of the fields on the tabs are now editable, and Facelets is now an option to choose from.   Once I finished adding JSF to the project, an index.xhtml was added to the project.

After closing the project properties I went to the first project (that had the problem), and looked in the project properties.  The tabs in the framework section are still greyed out, but Facelets is now available and selected.   There is no remove button to remove the framework, just an add button.

I closed the window, and went back to the second project.  Project properties, frameworks tab.  There is a remove button, but it is grayed out (useless), and now all of the fields in the tabs are grayed too.   Facelets is NOT available anymore and JSP is selected!  Why is everything greyed out?  Are they supposed to be editable only when you are adding a framework? 

Now I go back to the first project and look at project properties, frameworks.. and Facelets is gone again.  What the heck? 

This seems buggy to me.
Comment 5 rdelaplante 2009-12-10 04:16:44 UTC
Steps to reproduce:

1) Create new Maven web project, JEE6, default options
2) Go into project properties window, frameworks section.
3) Click add button, select JavaServer Faces and press OK.
4) Verify configuration tab has Facelets selected as preferred page language. Press OK.
5) Open project properties dialog for this project again, and go to frameworks tab.
6) Click the JavaServer Faces row. You will notice that the remove button is greyed out, and all of the fields on both tabs are greyed out except Preferred Page Language on the Configuration tab.  Is this by design or a bug?
7) Preferred Page Language is now JSP, and there is no Facelets option. 
8) Restart the IDE, come back to this screen and Facelets is still missing.
Comment 6 Alexey Butenko 2009-12-10 04:33:22 UTC
(In reply to comment #5)
> Steps to reproduce:
> 
> 1) Create new Maven web project, JEE6, default options
> 2) Go into project properties window, frameworks section.
> 3) Click add button, select JavaServer Faces and press OK.
> 4) Verify configuration tab has Facelets selected as preferred page language.
> Press OK.
> 5) Open project properties dialog for this project again, and go to frameworks
> tab.
> 6) Click the JavaServer Faces row. You will notice that the remove button is
> greyed out, and all of the fields on both tabs are greyed out except Preferred
> Page Language on the Configuration tab.  Is this by design or a bug?

It is by design. And actually preferred language is also quite useless now, since it does affect only property in project.properties in Web Application, and nothing in case Maven Web Application.


> 7) Preferred Page Language is now JSP, and there is no Facelets option. 

And this is the only bug I see here. And definitely not P2,
decreasing to P3 

> 8) Restart the IDE, come back to this screen and Facelets is still missing.
Comment 7 Alexey Butenko 2009-12-10 07:00:53 UTC
http://hg.netbeans.org/web-main/rev/6f72542548f7
Comment 8 Petr Jiricka 2009-12-10 07:32:57 UTC
Thanks Alexei. Should we put it into a 6.8 patch?
Comment 9 Alexey Butenko 2009-12-10 07:55:07 UTC
(In reply to comment #8)
> Thanks Alexei. Should we put it into a 6.8 patch?

If you think that it is worth to avoid confusing of the users,
after JSF framework with facelets is added into the project,
then it could be put into the patch.
Comment 10 Quality Engineering 2009-12-11 02:29:57 UTC
Integrated into 'main-golden', will be available in build *200912110200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/6f72542548f7
User: Alexey Butenko <alexeybutenko@netbeans.org>
Log: #178401: Unable to use Facelets in Maven web project with JSF 2.0
Comment 11 Michal Mocnak 2010-01-18 11:11:22 UTC
Verified in trunk
Comment 12 pgebauer 2010-01-19 08:38:34 UTC
The fix has been ported into the release68_fixes repository.
http://hg.netbeans.org/release68_fixes/rev/b3260ab923f7
Comment 13 Michal Mocnak 2010-01-27 15:05:58 UTC
Verified in 68fixes branch
Comment 14 bumble.bee 2011-01-06 02:11:24 UTC
I'm still seeing this problem (or something like it) in Netbeans 7 Beta.  I create a maven web project and it defaults to JSP!  I try to add JSF 2 (w/Facelets) Framework and get errors.  When I try to use new->JSF->Facelets Template the next button is grayed out and the dialog says that a Facelets library cannot be found.
Comment 15 Alniks 2011-01-23 12:44:07 UTC
I am having this problem in Netbeans 7 with maven java ee 6 project. When I try to use a new jsf template wizard: the next button is grayed out and the dialog says that a Facelets library cannot be found.
Comment 16 Alniks 2011-01-23 12:48:07 UTC
Created attachment 105277 [details]
screen showing jsf framework
Comment 17 Alniks 2011-01-23 12:48:43 UTC
Created attachment 105278 [details]
no facelets libraries found
Comment 18 Petr Jiricka 2011-01-24 12:17:11 UTC
I am not sure if this is the same problem as the original report, but I confirm there is a problem. For me, the exact steps to reproduce are:

1. Create a Java EE 6 Maven web project
2. Create New File -> Java Server Faces -> Facelets Template

The dialog displays an error message saying that it can not find any facelets library.

The workaround for me is to go to project properties and add the JSF framework explicitly (leave the defaults as they are). After this, the error message in the Facelets Template wizard disappears and I can create the file.
Comment 19 Martin Fousek 2011-03-03 10:01:58 UTC
Right there were two problems:
- for new maven project couldn't be created JSF Templates
- when user set project server and server JSF libraries it wasn't allowed as well

So for the first case it will react just with warning that server wasn't found and for the second one it should work now.

Fixed in be2b4665fe37.
Comment 20 Martin Fousek 2011-03-03 12:11:25 UTC
*** Bug 179349 has been marked as a duplicate of this bug. ***
Comment 21 Quality Engineering 2011-03-04 05:40:14 UTC
Integrated into 'main-golden', will be available in build *201103040000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/be2b4665fe37
User: Martin Fousek <marfous@netbeans.org>
Log: #178401 - Unable to use Facelets in Maven web project with JSF 2.0


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