Wednesday, March 1, 2017

Cannot change version of project facet Dynamic Web Module to 3.0

INTRODUCTION

We may get this error on any of the below cases.
  1. Creating a new Dynamic Web Project
  2. New Maven Maven Project
  3. Importing existing maven project.
Following are the different solution for this issue.

SOLUTION - 1

  1. Select your project
  2. Right click and go to Properties->Project Facets->Change the version 3.0 for Dynamic Web Module & also select Java version higher than JDK 6.
  3. Apply & OK

SOLUTION - 2

If it is a maven project, just add the below to your pom.xml
<build>
 <plugins>
     <plugin>
    <artifactId>maven-compiler-plugin</artifactId>
    <configuration>
<source>1.8</source>
<target>1.8</target>
    </configuration>
  </plugin>
 </plugins>
</build>


SOLUTION - 3

  1. Go to project root folder in your local disk
  2. Go to .settings folder
  3. Open org.eclipse.wst.common.project.facet.core.xml file and change the below
<installed facet="jst.web" version="3.0"/>
  1. Restart the Eclipse and Update your Maven Project.

SOLUTION - 4

  1. Go to web.xml and update the <web-app> below.
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
         http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
   version="3.0">


  1. Clean the Project & Update your Maven Project.
Hope any of the above solutions will resolve this issue.

Happy Knowledge Sharing!!!

No comments :

Post a Comment