ke3pup
ke3pup

Reputation: 1895

Adding RichFaces to an existing JBoss Seam application

Given a web application built using Jboss seam with following details:

 dynamic web module: 2.3
 Java : 1.5
 Javascript: 1.0
 Tomcat: 5.0
    activation.jar
    commons-beanutils-1.7.0.jar
    commons-codec-1.3.jar
    commons-digester-1.6.jar
    commons-el-1.0.jar
    commons-fileupload-1.0.jar
    commons-lang-2.1.jar
    commons-logging-1.0.4.jar
    jstl-1.1.0.jar
    jxl.jar
    log4j-1.2.8.jar
    myfaces-api-1.1.5.jar
    myfaces-impl-1.1.5.jar
    standard.jar
    tomahawk-1.1.3.jar

Having looked at RichFaces and what it offers i like to add it to the application and tried (and failed) doing so by creating a new application where it has:

 dynamic web module: 2.5
 Java: 1.5
 Javascript: 1.0
 Tomcat : 6.0

and from what i could muster online to satisfy the Richfaces libraries but also be able to deploy the existing application i added the following libraries to the new project:

    activation.jar
    common-annotations.jar
    commons-beanutils-1.7.0.jar
    commons-codec-1.3.jar
    commons-collections-3.2.jar
    commons-digester-1.8.jar
    commons-discovery-0.4.jar
    commons-el-1.0.jar
    commons-fileupload-1.0.jar
    commons-lang-2.1.jar
    commons-logging-1.1.1.jar
    jsf-api.jar
    jsf-impl.jar
    jsf-tlds.jar
    jstl.jar
    jxl.jar
    log4j-1.2.8.jar
    myfaces-api-1.2.9.jar
    myfaces-impl-1.2.9.jar
    richfaces-api-3.3.3.Final.jar
    richfaces-impl-3.3.3.Final.jar
    richfaces-ui-3.3.3.Final.jar
    standard.jar
    tomahawk-1.1.3.jar

I added needed richfaces tags to web.xml. I can deploy and run the application and can see richfaces skin applied to all controls on page (bluesky), but clearly something is wrong with the setup. link redirection doesn't seem to work (e.g. from login screen to home page...etc) and null exception issues when calling backbean...etc. From what I've read libraries conflicting could be the cause but i've kept the above as removing myfaces or jsf jars won't allow the app to deploy.

My question: Is mixing RichFaces and MyFaces a bad idea (or indeed one shouldn't do it at all?) . MY main reason for adding the above libraries is to be able to run the application we have but also add RichFaces to it, I would appreciate someone to tell me the unnecessary (Conflicting) libraries above and the correct path i should be following to add Richfaces this seam application.

UPDATE:

As suggested, JSF and MyFaces libraries are conflicting and hence i tried to remove one and keep the other. below is the error i get when i removed the JSF libraries jsf-impl.jar jsf-tlds.jar jsf-api.jar and kept the myfaces libraries:

javax.servlet.ServletException: java.lang.NoClassDefFoundError: com/sun/faces/taglib/jsf_core/ViewTag

Caused by:
java.lang.ClassNotFoundException - com.sun.faces.taglib.jsf_core.ViewTag


- Stack Trace
javax.faces.FacesException: javax.servlet.ServletException: java.lang.NoClassDefFoundError: com/sun/faces/taglib/jsf_core/ViewTag
    at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:347)
    at org.apache.myfaces.application.jsp.JspViewHandlerImpl.buildView(JspViewHandlerImpl.java:486)

from what i see i can tell that the error steams from tags such as below:

<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>

Deleting the MyFaces libraries myfaces-api-1.2.9.jar myfaces-impl-1.2.9.jar and keeping the JSF librararies result in HTTP Status 404 with following errors :

02/11/2011 11:47:53 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8165
02/11/2011 11:47:53 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 432 ms
02/11/2011 11:47:53 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
02/11/2011 11:47:53 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.33
02/11/2011 11:47:54 AM org.apache.catalina.core.StandardContext addApplicationLi
stener
INFO: The listener "com.sun.faces.config.ConfigureListener" is already configure
d for this context. The duplicate definition has been ignored.
02/11/2011 11:47:54 AM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
02/11/2011 11:47:54 AM org.apache.catalina.core.StandardContext start
SEVERE: Context [/TestProj] startup failed due to previous errors
02/11/2011 11:47:54 AM org.apache.catalina.loader.WebappClassLoader clearReferen
cesJdbc
SEVERE: The web application [/TestProj] registered the JDBC driver [org.postgres
ql.Driver] but failed to unregister it when the web application was stopped. To
prevent a memory leak, the JDBC Driver has been forcibly unregistered.
02/11/2011 11:47:54 AM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor host-manager.xml
02/11/2011 11:47:54 AM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor manager.xml
02/11/2011 11:47:54 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory ROOT
02/11/2011 11:47:54 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8165
02/11/2011 11:47:54 AM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
02/11/2011 11:47:54 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/15  config=null
02/11/2011 11:47:54 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 767 ms

with the juicy bit being the SEVERE: Error listenerStart.

below is the web.xml i use:

web.xml:

 <?xml version="1.0"?>
 <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
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-app_2_5.xsd">
<context-param>
    <param-name>org.richfaces.SKIN</param-name>
    <param-value>blueSky</param-value>
</context-param>
<context-param>
    <param-name>org.richfaces.CONTROL_SKINNING</param-name>
    <param-value>enable</param-value>
</context-param>
<filter>
    <display-name>RichFaces Filter</display-name>
    <filter-name>richfaces</filter-name>
    <filter-class>org.ajax4jsf.Filter</filter-class>
</filter>
<filter-mapping>
    <filter-name>richfaces</filter-name>
    <servlet-name>Faces Servlet</servlet-name>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>INCLUDE</dispatcher>
</filter-mapping>
<filter>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-  
  class>
    <init-param>
        <param-name>maxFileSize</param-name>
        <param-value>20m</param-value>
    </init-param>
</filter>
<!-- extension mapping for adding <script/>, <link/>, and other resource 
    tags to JSF-pages -->
<filter-mapping>
    <filter-name>MyFacesExtensionsFilter</filter-name>
  javax.faces.webapp.FacesServlet 
        entry -->
    <servlet-name>Faces Servlet</servlet-name>
</filter-mapping>
<filter-mapping>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
</filter-mapping>

<context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>server</param-value>

</context-param>

<context-param>
    <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
    <param-value>true</param-value>

</context-param>

<context-param>
    <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
    <param-value>true</param-value>

</context-param>

<context-param>
    <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
    <param-value>false</param-value>
</context-param>

<context-param>
    <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
    <param-value>true</param-value>

</context-param>
<listener>
    <listener-class>
        org.apache.myfaces.webapp.StartupServletContextListener</listener-
  class>
</listener>
<listener>
    <listener-class>testProj.SessionExpireHandler</listener-class>
</listener>
<servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.faces</url-pattern>
</servlet-mapping>
<filter>
    <filter-name>Faces Servlet</filter-name>
    <filter-class>testProj.SessionHandler</filter-class>
</filter>
<filter-mapping>
    <filter-name>Faces Servlet</filter-name>
    <url-pattern>*.faces</url-pattern>
</filter-mapping>
<!-- Welcome files -->
<welcome-file-list>
    <welcome-file>jsp/index.jsp</welcome-file>
</welcome-file-list>
<session-config>
    <session-timeout>60</session-timeout>

</session-config>

 </web-app>

UPDATE 2:

As suggested the last bit of Mojarra remaining in the lib folder was jsf-tlds.jar which is now removed. Tomcat version i'm running is tomcat-6.0.33. I also updated the myfaces to 2.1 and Tomahawk to 1.1.11 and all related libraries.Below is the updated and full lib jars list:

activation.jar
batik-awt-util-1.6-1.jar
batik-ext-1.6-1.jar
batik-gui-util-1.6-1.jar
batik-util-1.6-1.jar
commons-beanutils-1.7.0.jar
commons-codec-1.3.jar
commons-collections-3.2.1.jar
commons-digester-1.6.jar
commons-el-1.0.jar
commons-fileupload-1.2.1.jar
commons-io-1.3.2.jar
commons-lang-2.4.jar
commons-logging-1.1.1.jar
commons-validator-1.3.1.jar
iText-2.1.2u.jar
jstl.jar
jxl.jar
log4j-1.2.8.jar
mail.jar
myfaces-api-2.1.3.jar
myfaces-impl-2.1.3.jar
Opta2000.jar
oro-2.0.8.jar
postgresql-8.4-701.jdbc3.jar
richfaces-api-3.3.3.Final.jar
richfaces-impl-3.3.3.Final.jar
richfaces-ui-3.3.3.Final.jar
standard.jar
tomahawk20-1.1.11.jar
xml-apis-1.0.b2.jar
xmlParserAPIs-2.0.2.jar

I've also removed

<!-- Listener, that does all the startup work (configuration, init). -->
<listener>
    <listener-class>
        org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
</listener>

from web.xml (no other changes made). I can deploy the application but navigating to login page gives HTTP Status 500 - and throws an exception as below:

[2011-11-02 15:16:50,775] ERROR: org.ajax4jsf.webapp.BaseXMLFilter - Exception in the filter chain
javax.servlet.ServletException: /jsp/login.facesNo saved view state could be found for the view identifier: /jsp/login.faces
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:205)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:357)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)
    at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
    at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
    at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at com.dbschenker.util.SessionHandler.doFilter(SessionHandler.java:34)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:291)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Thread.java:662)
Caused by: javax.faces.application.ViewExpiredException: /jsp/login.facesNo saved view state could be found for the view identifier: /jsp/login.faces
    at org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:128)
    at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:171)
    at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:189)
    ... 24 more

UPDATE 3:

downgraded myfaces to MyFaces Core 2.0.9 , the exception remains the same as below:

[2011-11-02 16:10:59,260] ERROR: org.ajax4jsf.webapp.BaseXMLFilter - Exception in the filter chain
javax.servlet.ServletException: /jsp/login.facesNo saved view state could be found for the view identifier: /jsp/login.faces
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:205)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:357)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)
    at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
    at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
    at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at com.dbschenker.util.SessionHandler.doFilter(SessionHandler.java:34)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:291)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Thread.java:662)
Caused by: javax.faces.application.ViewExpiredException: /jsp/login.facesNo saved view state could be found for the view identifier: /jsp/login.faces
    at org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:128)
    at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:171)
    at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:189)
    ... 24 more

note sure if this is worth mentioning but following libraries exist in Both tomahawk and myfaces:

##tomahawk#
commons-logging-1.1.1.jar
commons-beanutils-1.7.0.jar
commons-codec-1.3.jar
commons-collections-3.2.1.jar
commons-digester-1.6.jar

#myfaces 2.0.9
commons-beanutils-1.8.3.jar
commons-codec-1.3.jar
commons-collections-3.2.jar
commons-digester-1.8.jar
commons-logging-1.1.1.jar

I'm using the ones that came with tomahawk.

Researching online the above exception has to do with session where page submit is including the id of a server-side view state that no longer exists. is this down to misconfiguration in my web.xml ? note that i'm doing the session handling as below:

web.xml:

  <listener>
    <listener-class>testProj.SessionExpireHandler</listener-class>
</listener>
<filter>
    <filter-name>Faces Servlet</filter-name>
    <filter-class>com.dbschenker.util.SessionHandler</filter-class>
</filter>
<filter-mapping>
    <filter-name>Faces Servlet</filter-name>
    <url-pattern>*.faces</url-pattern>
</filter-mapping>

and in SessionHandler.java:

import java.io.IOException;
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class SessionHandler implements Filter {
    private String  timeoutPage;

    public void init(FilterConfig filterConfig) throws ServletException {
    }

    public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) throws IOException, ServletException {
        if ((request instanceof HttpServletRequest) && (response instanceof HttpServletResponse)) {
            HttpServletRequest httpServletRequest = (HttpServletRequest) request;
            HttpServletResponse httpServletResponse = (HttpServletResponse) response;
            if (isSessionControlRequiredForThisResource(httpServletRequest)) {
                if (isSessionInvalid(httpServletRequest)) {
                    try {
                        httpServletRequest.getSession().setAttribute("sexpiremessage", ApplicationConstant.SESSION_EXP);
                        RequestDispatcher rd = httpServletRequest.getRequestDispatcher("/jsp/login.faces");
                        String timeoutUrl = httpServletRequest.getContextPath() + "/" + getTimeoutPage();
                        httpServletResponse.sendRedirect(timeoutUrl);
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                    return;
                }
            }
        }
        try {
            filterChain.doFilter(request, response);
        } catch (Exception e) {
            // e.printStackTrace();
        }
    }

    private boolean isSessionControlRequiredForThisResource(HttpServletRequest httpServletRequest) {
        String requestPath = httpServletRequest.getRequestURI();
        boolean controlRequired = !(requestPath.endsWith("/login.faces"));
        return controlRequired;
    }

    private boolean isSessionInvalid(HttpServletRequest httpServletRequest) {
        boolean sessionInValid = false;
        try {
            sessionInValid = (httpServletRequest.getRequestedSessionId() != null) && !httpServletRequest.isRequestedSessionIdValid();
            if (httpServletRequest.getSession().getAttribute(ApplicationConstant.SESSION_INFO_KEY) == null)
                sessionInValid = true;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return sessionInValid;
    }

    public void destroy() {
    }

    public String getTimeoutPage() {
        return "jsp/login.faces";
    }

    public void setTimeoutPage(String timeoutPage) {
        this.timeoutPage = timeoutPage;
    }
}

thought not clear to me why the exception is thrown!

Upvotes: 0

Views: 2169

Answers (1)

BalusC
BalusC

Reputation: 1108852

You're mixing JSF implementations. Those are from Mojarra:

jsf-api.jar
jsf-impl.jar
jsf-tlds.jar

(I've only never seen jsf-tlds.jar, they seem to originate somewhere else, what does its /META-INF/MANIFEST.MF file say?)

Those are from MyFaces:

myfaces-api-1.2.9.jar
myfaces-impl-1.2.9.jar

This isn't allowed. They will only conflict each other. You should choose and use the one or the other.

See also:


Update:

As per your update, the following exception with MyFaces,

java.lang.ClassNotFoundException - com.sun.faces.taglib.jsf_core.ViewTag

suggests that you've still Mojarra TLD files somewhere in the classpath. Either packaged in a JAR (usually, jsf-impl.jar, but that jsf-tlds.jar is very suspicious, I'd really be curious where you got it from and what they contain), or as loose .tld files. In other words, your runtime classpath is still dirty with a mix of Mojarra and MyFaces implementations. Cleanup Webapp/WEB-INF/lib, Webapp/WEB-INF/classes, Tomcat/lib, JRE/lib, etc.

And the following info with Mojarra,

INFO: The listener "com.sun.faces.config.ConfigureListener" is already configured for this context. The duplicate definition has been ignored.

This is either a bug in Tomcat (which version exactly are you using? a similar bug was fixed in 6.0.18) or you have unnecessarily repeated it as a <listener> in web.xml. It should already be automatically initialized by the TLD file on any JSP 2.0 compatible container such as Tomcat 5.5 and newer, regardless of whether you're using MyFaces or Mojarra.

The following error with Mojarra,

SEVERE: Error listenerStart

is possibly caused because you've a MyFaces specific listener in your web.xml:

<listener>
    <listener-class>
        org.apache.myfaces.webapp.StartupServletContextListener
    </listener-class>
</listener>

Remove it altogether. You don't need it at all for both MyFaces/Mojarra on a JSP 2.0 compatible container.

Coming back to the jsf-tlds.jar, what Mojarra version exactly are you using and where did you get it from? You are aware that you are supposed to download the libs from the official manfacturer's site? Mojarra is available at http://javaserverfaces.java.net. The Tomcat 6.0 compatible 1.2_15 (or, preferably, 2.0.6) are available there. It's composed of 2 JAR files jsf-api.jar and jsf-impl.jar. No mysterious jsf-tlds.jar file. JSF 2.0 offers by the way enormously a lot of advantages over JSF 1.2. If you can, I strongly recommend to make that upgrade step as well.


Update 2: You didn't tell anything about the exception, so I can't be specific. But this doesn't look right:

myfaces-api-2.1.3.jar
myfaces-impl-2.1.3.jar

JSF 2.1 requires a Servlet 3.0 compatible container, while Tomcat 6.0 is a Servlet 2.5 container. You need JSF 2.0 instead. Pick MyFaces 2.0.x or Mojarra 2.0.x, but not 2.1.x. If you really need JSF 2.1, upgrade Tomcat to 7.0.

Upvotes: 1

Related Questions