Cannot change version project facet Dynamic web Module 2 5

Cannot change version project facet Dynamic web Module 2 5

If you are getting above exception when trying to change dynamic web module to 2.5 please follow below steps:

  • Change eclipse view to Navigator (Click Window –> Show View –> Navigator)
  • Open file name: org.eclipse.wst.common.project.facet.core.xml and change installed facet=”jst.web” version=”2.5″ as shown below:
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
  <fixed facet="wst.jsdt.web"/>
  <installed facet="java" version="1.5"/>
  <installed facet="jst.web" version="2.5"/>
  <installed facet="wst.jsdt.web" version="1.0"/>
</faceted-project>
  • Now right click proct –> Properties –> Project facet –> Dynamic web module –> 2.5 –> Apply –> OK (Note: If you still get exception close and try again to change project facet)
  • Now you will have to change web.xml as well to make it compatible with Dynamic Web Module 2.5 version as shown below:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://java.sun.com/xml/ns/javaee" 
    xmlns:web="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/web-app_2_5.xsd" 
    id="WebApp_ID" version="2.5">
    
    <display-name>Project Name</display-name>
    

</web-app>
  • Now update maven project: Right Click Project –> Maven –> Update Project…

Leave a Reply

Your email address will not be published. Required fields are marked *

I am not Robot *