---
title: "The server does not support version 2.5 of the J2EE Web module specification"
author: "explore"
date: "2010-07-15T11:18:57Z"
tags: []
categories: ["编程语言"]
slug: "the-server-does-not-support-version-2-5-of-the-j2ee-web-module-specification"
draft: false
lastmod: "2010-07-15T11:18:57Z"
id: 713254
url: "https://explore.iteye.com/blog/713254"
---

今天用Eclipse部署一个Web项目Test，报如下错误：The server does not support version 2.5 of the J2EE Web module specification

 

原来创建Test时用的是Tomcat 6.0，而现在用的是Tomcat 5.0。jdk都是用的1.5

Tomcat 5.0最多支持Servlet 2.4

 

解决如下：

在项目根目录下有一个.settings的文件夹，该文件夹下有一个org.eclipse.wst.common.project.facet.core.xml文件，内容如下：

&lt;?xml version="1.0" encoding="UTF-8"?&gt;  
&lt;faceted-project&gt;  
  &lt;fixed facet="jst.web"/&gt;  
  &lt;fixed facet="wst.jsdt.web"/&gt;  
  &lt;fixed facet="java"/&gt;  
  &lt;installed facet="java" version="1.5"/&gt;  
  &lt;installed facet="jst.web" version="2.5"/&gt;  
  &lt;installed facet="wst.jsdt.web" version="1.0"/&gt;  
&lt;/faceted-project&gt;

  把&lt;installed facet="jst.web" version="2.5"/&gt;改为  &lt;installed facet="jst.web" version="2.4"/&gt;

 

此时项目可以部署了，但是页面上的JSTL表达式却都不起作用了，查了点资料，原来还需要把web.xml 2.5的声明改成2.4的声明。

2.5的为：

&lt;web-app xmlns:xsi="[http://www.w3.org/2001/XMLSchema-instance](http://www.w3.org/2001/XMLSchema-instance)"  
 xmlns="[http://java.sun.com/xml/ns/javaee](http://java.sun.com/xml/ns/javaee)" xmlns:web="[http://java.sun.com/xml/ns/javaee/web-app\_2\_5.xsd](http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd)"  
 xsi:schemaLocation="[http://java.sun.com/xml/ns/javaee](http://java.sun.com/xml/ns/javaee) [http://java.sun.com/xml/ns/javaee/web-app\_2\_5.xsd](http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd)"  
 id="WebApp\_ID" version="2.5"&gt;

 

2.4的为：

 

&lt;web-app version="2.4"  
   xmlns="[http://java.sun.com/xml/ns/j2ee](http://java.sun.com/xml/ns/j2ee)"  
   xmlns:xsi="[http://www.w3.org/2001/XMLSchema-instance](http://www.w3.org/2001/XMLSchema-instance)"  
   xsi:schemaLocation="[http://java.sun.com/xml/ns/javaee](http://java.sun.com/xml/ns/javaee)  
   [http://java.sun.com/xml/ns/javaee/web-app\_2\_4.xsd](http://java.sun.com/xml/ns/javaee/web-app_2_4.xsd)"&gt;