1

My WAR project was working fine but when I updated to latest version of STS (3.5.0.M2) I get the following error:

Cannot change version of project facet Dynamic Web Module to 2.4

Paul Drummond
  • 6,043
  • 6
  • 30
  • 38
  • 1
    possible duplicate of [Cannot change version of project facet Dynamic Web Module to 3.0?](http://stackoverflow.com/questions/18122336/cannot-change-version-of-project-facet-dynamic-web-module-to-3-0) – Georgian Apr 20 '14 at 15:55

4 Answers4

3

try edit your WEB.XML file. Check on top of file

**http://java.sun.com/xml/ns/j2ee/web-app_3_0.xsd" >**
borino
  • 19
  • 2
3

open project folder and goto .settings and open org.eclipse.wst.common.project.facet.core.xml change version to that matching with the one in web.xml

then Maven -> Update Project

you will observe that the error is no more:)

Amol Dixit
  • 611
  • 7
  • 13
1

open project folder and goto .settings and open org.eclipse.wst.common.project.facet.core.xml change version like this.

sumit sharma
  • 1,067
  • 8
  • 24
0

This is a more detailed answer, expanding on existing ones.

web.xml

Check your web.xml file. Make sure you're using the correct XML namespace and version attributes.

Here's an example of the current version (4.0):

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xmlns="http://xmlns.jcp.org/xml/ns/javaee"
  xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
  version="4.0">
  <display-name>project</display-name>
  
  <!-- servlet configuration here -->
</web-app>

Project Facets

The version in the web.xhm should match what you have in your project facets (right click your project select properties > project facets) under Dynamic Web Module.

project facets

Update Maven

Right click on your project, Maven > Update Project

Jason
  • 2,382
  • 1
  • 16
  • 29