tags:

views:

290

answers:

2

Recently I've been playing around with JSF2.0+Richface 3.3.3, I'm using STS as my IDE and Maven to build my project, but somehow I can't get the following JSF2.0 tags to work:

  • h:button
  • h:link
  • f:metadata
  • f:viewParam (this is the only one my STS autocomplete recognizes)

It just fails during runtime saying it can't find X component.

I do have jsf-api-2.0.2, jsf-impl-2.0.2, richfaces-api-3.3.3.final, richfaces-impl-jsf2-3.3.3.final, richfaces-ui-3.3.3.final, jsf-facelets-1.1.15, jstl-1.0 and obviously "xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" in every .xhtml file, am I missing something?

This is the exact error I'm getting:

<h:button> Tag Library supports namespace: http://java.sun.com/jsf/html, but no tag was defined for name: button

@EDIT: ok nevermind, my teammate found out that its because we're using some external facelets and that we have to wait for RichFaces4.0...

+2  A: 

have you removed the old jsf 1.2 libraries? Check your WEB-INF/lib to see that there is no trace of JSF 1.2 libs.

Also remember that you should update your faces-config file to 2.0

<faces-config version="2.0" xmlns="http://java.sun.com/xml/ns/javaee"
 xmlns:xi="http://www.w3.org/2001/XInclude"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"&gt;

Does it say something when starting the servlet: INFO: Initializing Mojarra 2.0.2 (FCS b10) for context '/nameofyourapplication' (in case you are using Sun implementation of JSF)

pakore
Just in case I double-checked and I have no JSF1.2 libs and the faces-config is also fine and dandy. Oh and it says completely nothing while initializing Mojarra (except that it's being initialized of course). Kinda strange as I can't find anything about this error in google.
Zenzen
Try to clean the project, maybe you have cached libs somewhere.
pakore
Try to deploy the .war inside a servlet container like Tomcat, to see if you still get the same error.
pakore
Already tried both, unfortunately it didn't work.
Zenzen
Are you using Mojarra implementation? Or Apache MyFaces? You can open the .jar to see if the tag is implemented inside.
pakore
@Zenzen: you must have seen an `Initializing Mojarra` entry in server logs. Do you look at the right places? Which server are you using?
BalusC
A: 

Would you confirm that your maven pom.xml file has the following dependency:

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

After completing a mvn clean install on your project directory, search for the jsf jar files in the target directory and ensure that 2.0 jars are found there.

If the issue is still not resolved, then indicate the web container that you are using and how your war is deployed into the server.

Babu