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
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
try edit your WEB.XML file. Check on top of file
**http://java.sun.com/xml/ns/j2ee/web-app_3_0.xsd" >**
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:)
open project folder and goto .settings and open org.eclipse.wst.common.project.facet.core.xml change version like this.
This is a more detailed answer, expanding on existing ones.
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>
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.
Right click on your project, Maven > Update Project