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>
Tags :
Founder of Mkyong.com and HostingCompass.com, love Java and open source stuff. Follow him on Twitter, or befriend him on Facebook or Google Plus. If you like my tutorials, consider making a donation to this charity, thanks.

Related Posts

Popular Posts