58

I have created a Dynamic web project, but I am not able to deploy it into Apache Tomcat Server 6.0. I am getting this error when I try to deploy my project:

There are No resources that can be added or removed from the server.

6
  • how you are deploying manually or through eclipse...need details.... Commented Jul 8, 2014 at 6:13
  • @AbhishekMishra:while hitting localhost:8080 itself i am getting "http status 404 Error
    – Thiru
    Commented Jul 8, 2014 at 6:29
  • in web.xml check whether their is any welcome file is there or not ..?? Commented Jul 8, 2014 at 6:31
  • Follow the instructions given in this question's answer Commented Jul 8, 2014 at 6:34
  • @AbhishekMishra: i can see web.xml file under server it has <welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> <welcome-file>index.jsp</welcome-file> </welcome-file-list>
    – Thiru
    Commented Jul 8, 2014 at 6:45

12 Answers 12

109

For this you need to update your Project Facets setting.

Project (right click) -> Properties -> Project Facets from left navigation.

If it is not open...click on the link, Check the Dynamic Web Module Check Box and select the respective version (Probably 2.4). Click on Apply Button and then Click on OK.

enter image description here

1
  • don't see java 11 there
    – Tupac
    Commented Mar 15, 2022 at 18:29
14

Check whether your Java version is compatible with the project. Right click the project>>Properties>>Project Facets>>Java check the version is compatible with your project.

2
  • 3
    This ans might be useful because I did the same mistake while selecting the version of Java.. Thanks! Commented Aug 17, 2016 at 10:29
  • don't see java 11 there
    – Tupac
    Commented Mar 15, 2022 at 18:29
7

if your project maven based, you can also try updating your project maven config by selecting project. Right click project> Maven>Update Project option. it will update your project config.

0
7

I used mvn eclipse:eclipse -Dwtpversion=2.0 in command line in the folder where I had my pom.xml. Then I refreshed the project in eclipse IDE. After that I was able to add my project.

2
  • Is this for an older version of maven (not m2e)?
    – Mark W
    Commented Jun 3, 2016 at 8:53
  • Believe it or not! This is a life saver command.
    – Basil
    Commented May 17 at 14:19
6

The issue is incompatible web application version with the targeted server. So project facets needs to be changed. In most of the cases the "Dynamic Web Module" property. This should be the value of the servlet-api version supported by the server.

In my case,

I tried changing the web_app value in web.xml. It did not worked.

I tried changing the project facet by right clicking on project properties(as mentioned above), did not work.

What worked is: Changing "version" value as in jst.web to right version from

org.eclipse.wst.common.project.facet.core.xml file. This file is present in the .setting folder under your project root directory.

You may also look at this

4

I didn't find the Dynamic Web Module option when I clicked on the link, then I have installed Maven(Java EE) Integration for Eclipse WTP from the Eclipse Marketplace.Then, the above steps worked.

2

I encountered this error even though the Project Facets were set appropriately. The problem was that the "Runtime Environment" property was not set on the server:

Empty Runtime Environment for Eclipse Tomcat

It simply needed to be set to the appropriate Runtime:

Runtime Environment for Eclipse Tomcat

2

The issue is it is missing Dynamic Web Module facet definition. Run the following at command line

mvn eclipse:eclipse -Dwtpversion=2.0

After build is success, refresh the project and you will be add the web project to server.

1

The only thing that worked for me was creating a

.java-version

file with "oracle64-1.8.0.112" as the only entry ( use something that is 1.6+ )

Make sure you have dynamic web module facet turned on.

1

Right click on the project, select properties and then select "Targeted Runtimes". Check if Tomcat is selected here.

Targeted Runtimes

0

First check Project Facets setting as most replies had been answered.

Then check the Runtime Server is also aligned with the appropriate JRE.

In my case, I updated project JRE System Library and JDK compiler to 1.8, but original Tomcat server is setting up on JRE 1.7,after upgraded to 1.8,the issue is resolved. enter image description here

0

Eclipse allow run de dynamic project with Tomcat, if there are in project servlet files. Case there are only html files, and there aren´t java files, will not possible and Eclipse show up de message: There are No resources that can be added or removed from the server. You need create java files for run de project in Tomcat. Thanks!

1
  • Please edit your answer to fix your English. Share your versions of Eclipse and Tomcat and describe how it works with these versions. They're not the same as 10 years ago.
    – Sybuser
    Commented May 12 at 5:57

Not the answer you're looking for? Browse other questions tagged or ask your own question.