Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dynamic Web Module 3.0 -- 3.1

I have a mavenized codebased configured Spring 3.2.4 web app. When I build the app with Maven/pom.xml first I got an error that web.xml is missing. first I tried to create an empty web.xml. this was the moment when The project facets changed (and I don't know why). It switched from dynamic Web Module 3.0 to 3.1 and this is irreversible. How can I change it again into Dynamic Web Modules 3.0???

enter image description here

Additionally I can't remove the JAX-RS. Trying this it results in:

Failed while uninstalling JAX-RS (REST Web Services) 1.0. org.eclipse.jst.javaee.web.internal.impl.WebAppImpl cannot be cast to org.eclipse.jst.j2ee.webapplication.WebApp 

Later I found out that I can avoid the Maven compile error by inserting the according plugin into pom.xml:

<plugin>     <groupId>org.apache.maven.plugins</groupId>     <artifactId>maven-war-plugin</artifactId>     <version>2.4</version>     <configuration>         <failOnMissingWebXml>false</failOnMissingWebXml>     </configuration> </plugin> 
like image 466
du-it Avatar asked Oct 29 '13 14:10

du-it


People also ask

What is dynamic Web module?

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. Take a look at below image from wikipedia, it's Servlet API history.

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

Show activity on this post. Step 1: Click on Help and then click on “Install New Software”. Step 3: Scroll down to find “Web, XML, Java EE and OSGI Enterprise Development” option and expand it. Step 5: Click next and you should see that the software is installing.


1 Answers

I had similar troubles in eclipse and the only way to fix it for me was to

  • Remove the web module
  • Apply
  • Change the module version
  • Add the module
  • Configure (Further configuration available link at the bottom of the dialog)
  • Apply

Just make sure you configure the web module before applying it as by default it will look for your web files in /WebContent/ and this is not what Maven project structure should be.

EDIT:

Here is a second way in case nothing else helps

  • Exit eclipse, go to your project in the file system, then to .settings folder.
  • Open the org.eclipse.wst.common.project.facet.core.xml , make backup, and remove the web module entry.
  • You can also modify the web module version there, but again, no guarantees.
like image 112
dimoniy Avatar answered Sep 19 '22 21:09

dimoniy