Cannot add a project to a tomcat server in eclipse

混江龙づ霸主 提交于 2019-11-27 10:45:45

问题


I cannot add my project to a server in eclipse - why is that?

I installed all necessary tools (Web Dev, Java EE, Server Adapters, Tomcat itself, everything)

I configured the runtime environments, adjusted all Java Versions to JDK 6 (because it should run on Tomcat 6) but still the left side of the dialogue where I could add recources is empty when creating a new server.

What else could I try?

PS: Using Juno on W7 Prof.


回答1:


You didn't create your project as "Dynamic Web Project", so Eclipse doesn't recognize it like web project. Create new "Dynamic Web Project" or go to Properties -> Projects Facets and check Dynamic Web Module




回答2:


1 .right click on project name in Package Explorer view.
2. select Properties
3. Select Project Facets
4. Click on Runtimes tab
5. check server
6. Click on OK

And now :

  1. right click on server name in Servers view
  2. click on Add and Remove ...
  3. move resources to the right column



回答3:


I fixed this issue as adding Dynamic Web Module to Project Facets

  1. right click on project name in Package Explorer view.
  2. select Properties
  3. Select Project Facets
  4. Activate Dynamic Web Module
  5. Click on OK



回答4:


If you are able to see the project in Eclipse project explorer but unable to see the project while adding the project to the web server, follow project properties -> Project Facets, make sure Dynamic Web Module & Java were ticked.




回答5:


Go to project properties -> Project Facets, make sure Dynamic Web Module & Java were checked.

Apart from it, "Cloud Foundry Standalone Application" needs to be un-checked, if it is already selected. By default, few IDE's pre-select this option.




回答6:


  1. Right-click on project
  2. Go to properties => project factes
  3. Click on runtime tab
  4. Check the box of the server
  5. Then ok

Close the eclipse and start the the server you will able to see and run the project.




回答7:


After following the above steps suggested by the other posters, do the following step

  • Right click on the project
  • Click Maven, then Update Project
  • Tick the check-box "Force Update of Snapshots/Releases", then click OK

you should be good to go now.




回答8:


Steps, I used to resolve:

  1. Double click on Tomcat Server in the Servers tab.
  2. In a dropdown next to Runtime Environment:, select Apache Tomcat your version
  3. Click on save.

Now, you should be able to add to server on right click "Add and Remove"

Note: Additionally, when on clear/run, you get an error for multiple instances, open server.xml and ensure that it contains a single instance of each application and not multiple.




回答9:


In my case:

project properties -> Project Facets, make sure "Dynamic Web Module" is checked and, finally, I put the version number "2.3" instead of "3.0". After that, the Apache Tomcat 5.5 runtime is listed in "Runtimes" tab.




回答10:


In my case, the .project file was read only (It was pulled from source code control that way). Making it writable resolved the issue.

Eclipse Oxygen.




回答11:


For me: It was Eclipse mars which does not support jdk7 so I added jdk8. It worked.



来源:https://stackoverflow.com/questions/15380125/cannot-add-a-project-to-a-tomcat-server-in-eclipse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!