JSF 2.0 + Tomcat : It appears the JSP version of the container is older than 2.1…

Problem

While deploying JSF 2.0 web application to Tomcat 6.0.26, hits the “JSP version of the container is older than 2.1” exception and failed to start the Tomcat server. But the JSP api v2.1 is included in the project class path, why the Tomcat is still saying that JSP version is older than 2.1?


    <dependency>
	 <groupId>javax.servlet.jsp</groupId>
	 <artifactId>jsp-api</artifactId>
	 <version>2.1</version>
    </dependency>

Here’s the error stacks…


SEVERE: Critical error during deployment: 
   ...
Caused by: com.sun.faces.config.ConfigurationException: 
It appears the JSP version of the container is older than 2.1 and unable to 
locate the EL RI expression factory, com.sun.el.ExpressionFactoryImpl. 

If not using JSP or the EL RI, make sure the context initialization parameter, 
com.sun.faces.expressionFactory, is properly set.

Solution

Not really sure the root cause of it, but the solution is include the el-ri.jar library


  <dependency>
     <groupId>com.sun.el</groupId>
     <artifactId>el-ri</artifactId>
     <version>1.0</version>
  </dependency>

P.S This el-ri.jar is available at the default Maven central repository.

Note
The JSF 2.0 released note didn’t mention about this el-ri.jar dependency library, that’s weird.

Updated – 21-10-2010

This “el-ri.jar” is too old, it’s recommended to use the latest “el-impl-2.2.jar”, from Java.net


     <dependency>
	  <groupId>org.glassfish.web</groupId>
	  <artifactId>el-impl</artifactId>
	  <version>2.2</version>
     </dependency>

6 comments on “JSF 2.0 + Tomcat : It appears the JSP version of the container is older than 2.1…

  1. It could be also possible, that a wrong EL-Implementation was defined inside the web.xml file.
    In one case, JUEL EL was implementated, but JBOSS EL was declared. Replacing the broken definition fixed the issue.

    Example for JBoss EL:

    com.sun.faces.expressionFactory
    org.jboss.el.ExpressionFactoryImpl

    Example for JUEL EL:

    com.sun.faces.expressionFactory
    de.odysseus.el.ExpressionFactoryImpl

    Reply
  2. After I’ve put the el-impl 2.2 dependency I got the following error:
    javax.servlet.ServletException: FacesContext must not be null
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:606)
    root cause

    java.lang.IllegalArgumentException: FacesContext must not be null

    Reply
  3. Just some update if someone get the error like me…
    I get the El parsing error for JSF Table manipulation example
    I solved it put I have include to jars AS suggested by mkyong
    el-api-2.2.jar
    el-impl-2.2.jar
    jstl-impl-1.2.jar

    and also one context parameter in web.xml for new EL version

    com.sun.faces.expressionFactory
    com.sun.el.ExpressionFactoryImpl

    thanks Mkyong
    for this valuable resource

    Reply

Leave a Comment

Your email address will not be published. Required fields are marked *