Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot change version of project facet Dynamic Web Module to 3.0?

I am using maven to create a dynamic webapp in Eclipse. I added some folders like src/test/java and src/test/resources. Also I changed the library in Java Build Path to obtain the JavaSE-1.7. It's all OK up to here.

When I tried to change the Projects Facet Dynamic Web Module something went wrong. I had change the Java to 1.7 in the same place. And it still told me, cannot change version of project facet Dynamic Web Module to 3.0.

I have changed everything that would effect the changing I think.

like image 824
EdgarZeng Avatar asked Aug 08 '13 09:08

EdgarZeng


People also ask

What is Dynamic Web Module version?

Dynamic Web Module version correlates with Servlet API version . Ideally a Servlet is an object that receives a request and generates a response based on that request.

How do I fix the dynamic Web project missing in Eclipse?

Step 1: Click Help -> Install New Software. Step 2: In Work with add http://download.eclipse.org/releases/oxygen. If you are using any other Eclipse product like Neon then replace oxygen with neon. Step 3: Now expand checkbox with name Web, XML, Java EE and OSGi Enterprise Development.


5 Answers

Another way is to edit the project facet configuration file itself: org.eclipse.wst.common.project.facet.core.xml

Change the dynamic web module version in this line to 3.0 - <installed facet="jst.web" version="2.5"/>

And then:

  1. Right-click on the project (in the Project Explorer panel).
  2. Select Maven » Update Project (or press Alt+F5)

You'll find this file in the .settings directory within the Eclipse project.

like image 66
enkor Avatar answered Oct 18 '22 22:10

enkor


I updated my web.xml

<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">
    <display-name>Servlet 3.0 Web Application</display-name>
</web-app>

and then just Maven -> Update Project ...

like image 29
Sydney Avatar answered Oct 18 '22 23:10

Sydney


I think I had the same problem as you. My web.xml had version 2.5 while the project had the (right-click on Project-> Properties-> Project Facets->) Dynamic Web Module 2.3.

Although I tried to change the version from 2.3 to 2.5 ECLIPSE did not permit it. Solution: I removed the check mark under the heading Dynamic Web Module, I saved and I had Update Project. Automatically re-awakening is entering the box with the correct version. I use Eclipse Kepler.

p.s.: look at the comments of Jonathan just below, very useful.

like image 34
pagurix Avatar answered Oct 18 '22 22:10

pagurix


  1. Click on your project folder.
  2. Go to Window > Show View > Navigator
  3. Go to Navigator and expand the .settings folder
  4. Open org.eclipse.wst.common.project.facet.core.xml file

    <?xml version="1.0" encoding="UTF-8"?>
    <faceted-project>
      <fixed facet="wst.jsdt.web"/>
      <installed facet="jst.web" version="2.3"/>
      <installed facet="wst.jsdt.web" version="1.0"/>
      <installed facet="java" version="1.8"/>
    </faceted-project>
    
  5. Change the version like this <installed facet="jst.web" version="3.1"/>

  6. Save
  7. Just update your project. Right Click on The Project Folder > Maven > Update Project > Select the Project and click 'Ok'

Just this worked to me.

like image 54
aabarbosa Avatar answered Oct 18 '22 23:10

aabarbosa


I had the same issue and I even tried to remove the project and add it again. What did the trick was to remove the .settings directory.

like image 45
Adrian Ber Avatar answered Oct 18 '22 23:10

Adrian Ber