問題

JSF 2.0 WebアプリケーションをTomcat 6.0.26にデプロイする際、 ”

JSPバージョンのコンテナが2.1

より古い”という例外があり、Tomcatサーバーの起動に失敗しました。しかし、

JSP api v2.1

がプロジェクトクラスのパスに含まれています。なぜTomcatはまだJSPのバージョンが2.1より古いと言っていますか?

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

ここにエラースタックがあります…​

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.

解決策

実際の根本的な原因はわかりませんが、解決策には

el-ri.jar

ライブラリが含まれています

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

__P.Sこのel-ri.jarはデフォルトのhttp://repo1.maven.org/maven2/[Mavenセントラルリポジトリ]で利用できます。

更新 – 21-10-2010

この「el-ri.jar」は古すぎるため、http://download.java.net/maven/2/org/glassfish/web/elから最新の「el-impl-2.2.jar」を使用することをお勧めします-impl/2.2/el-impl-2.2.pom[Java.net]

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