Alex
Alex

Reputation: 505

Eclipse interaction with Tomcat - cannot undeploy applications

My problem is that if I use Eclipse to deploy my Web Application (via Run As->Run Server), I cannot undeploy it, as within Tomcat Manager the undeploy link against the Application is not highlighted. If I manually put in the URL I get the following Error:

FAIL - Context /TomcatBasic is defined in server.xml and may not be undeployed

Im using Eclipse Galileo, and Tomcat 6.0.20

The steps I have followed are:

1) Within Eclipse, I use the Server view, to create a new Tomcat Server.

However by default when you "Run Server", it seems that applications are run within Eclipse ? When looking at the Tomcat Manager no application was deployed even though Eclipse was running it

To overcome this I did the following. In the Servers view within Eclipse: - Right click on the Tomcat Server, and select Properties. In the Properties window I clicked the button "Switch Location". - Right click on the Tomcat Server, and select open. In the following dialog box I modified "Server Location" to select "Use Tomcat installation", and then I change the "Server path" to C:/apache-tomcat-6.0.20 and the "Deploy path" to C:/apache-tomcat-6.0.20

2) Create a Dynamic Web Application.

In the "New Dynamic Web Project" windown I select Apache Tomcat as the "Target Runtime" and "Configuration". Click Finish.

3) Right click on the project and "Run As" -> "Run on Server".

The application now gets deployed to the Tomcat Application Server as required. HOWEVER I cannot undeploy it when I log onto Tomcat Manager.

Any help please will be greatly appreciated !

Upvotes: 1

Views: 2910

Answers (2)

smartnut007
smartnut007

Reputation: 6423

You can do this from within the UI.

Within eclipse, in the Package Explorer you can see the Servers along with the other projects.

1) Stop the tomcat runtime.

2) Package Explorer > Servers > Tomcat7 > Server.xml

Here search for <Context> tag and delete the one corresponding to the web application you would like to undeploy.

3) Make sure save the server.xml file and close it.

4) you are good to go.

At least this worked for me :-).

Upvotes: 0

John Schneider
John Schneider

Reputation: 12

I think all you need to do is manually undeploy the webapp under the directory that eclipse is deploying it to.. .metadata.plugins\org.eclipse.wst.server.core

if you have to you can also edit the servers.xml file.. you should find it at:

.metadata.plugins\org.eclipse.wst.server.core\tmp0\conf\servers.xml

Upvotes: -2

Related Questions