Tomcat won't undeploy ROOT.war - rest

I deployed using the REST API of Tomcat Manager (/manager/text) my application. The war is ROOT.war. When I try to undeploy it using /manager/text/undeploy?path=/ Tomcat fails to undeploy with response:
FAIL - Unable to delete [C:\Program Files\apache-tomcat-7.0.27\webapps\ROOT]. The continued presence of this file may cause problems.
But if I try to use the Tomcat Manager GUI it can undeploy the war
Does someone know how can I solve this problem?
Thanks

Have you tried deleting the ROOT deployed directory manually?
The war's are simply exploded to directories under the webapps folder.

Related

Deploy IVY resolved war file to eclipse tomcat?

I am trying to understand whether it is possible to have an eclipse tomcat runtime configuration that will publish the IVY resolved war files when tomcat is started?
I have created a tomcat server instance in eclipse and pointed it at a catalina configuration which includes a server.xml that specifies the contexts. For example.
<Context docBase="Module1" path="/Module1"/>
Module1 is a resolved war file and I have added the corresponding ivy.xml file to the eclipse tomcat classpath. I can see the war file has been resolved, but I assume I must have to do something extra to get the war files auto deployed on server startup?

Not able to add the Spring jars into EAR under Tomcat Server. note :i added those in WEBINF/lib

i have added all the jars into WEBINF/lib but it is not added into my EAR,
When i add EAR to TOMCAT server i am seeing only one jar,
WEBINF/lib:
all my spring jars,
Tomcat V7.0
->MySpringExampleEAR
->only one jar
so i am getting below exception
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListner in eclipse-jee-kepler-SR2-win32.
I have tried by using Deplyoment assembly.Still am getting the same exception
Currrently not able to attach Image.
Can anybody please help me to resolve this issue?
Is there any solution other than MAVEN deploy for this?
Please read .war vs .ear file
Tomcat does not handle .ear files, only .war files.
If you are using Maven to create a web app that is intended to be deployed to Tomcat, do not use the maven ear plugin.

Deploy helloworld to wildfly using eclipse

I want to deploy my helloworld project to my wildfly (former jboss) application server.
I can use maven mvn install wildfly:deploy and it will deploy the app.
But when I want to use eclipse to run on Server it does nothing.
I don't get a console output or anything which looks like building and deploying.
I added the server runtime to the project and also added the wildfly server.
Why is Eclipse not deploying?
This works for me: do a mvn install in order to build the war and have it at the target folder. Then right-click on wildfly-server. You will see an add-remove option. Click on it, select your project from the list and then add your project to the server. Click finish. If the server is running the project should be deployed.
Another approach would be to simply copy the war from your target directory and place it in the standalone/deployments folder of your wildfly installation.
Make sure that you have stopped the server before copying the war. After you have copied the war to the deployments folder, start he server.
Your application should be deployed successfully.

Import and run WAR on eclipse

I have a subproject in a Virtual Machine with Ubuntu which I compile with Maven and then run with mvn jetty:run.
Maven also packages it as a war.
All of this works fine and does what is expected.
I am trying to import this WAR from another eclipse in Windows so I have done it by Import -> WAR, thus creating a Web application.
I now want to run it from Eclipse so I have created a new Jetty Server and run my application as Run on Server but I am getting Could not find the main class.
What is the proper way of doing this?
Besides, I have tried deploying the application by putting it in the webapps Tomcat directory . I can see it in the Tomcat GUI and launches the index.html but when I tried to access some of the services it throws No service was found
When deploying, in the Tomcat console I can see runtime NoClassDefFoundErrors.
Is there anything that mvn jetty:run does that the tomcat regular deployment does not? How is it possible that this didn't happen in my Virtual Machine? Shouldn't those classes be all in the WAR?
EDIT:
Here is another hint. When I run the project imported from the WAR in the Ubuntu VM, either with Jetty from eclipse or adding it to the webapps folder it works fine.
It is only hen running it on Windows Host Environment when it fails.
The specific NoClassdefFoundErrors thrown on cmd is the following:
Caused by: java.lang.NoClassDefFoundError: org/ow2/frascati/explorer/
api/FraSCAtiExplorer
That is one of the modules fo the main project.
If you try to deploy your war in tomcat's webapps folder, and if you miss a class, then you probably miss a jar in your lib folder. It is probably a jar that is supposed to be provided by the web server.
We need to know which class is missing.
Finally all errors have been solved by doing the following:
First I recompiled the WAR which did work this time under Jetty in Windows cmd. I apologize as this must be due to some error I still don't know, probably sharing the wrong WAR with Windows HOST OS from the beginning.
On the other hand, the Eclipse was solved by moving the Jetty folder out of the "Program Files" directory. It seems the old Jetty 6 adapter Eclipse comes with does not recognize spaces in its route to the server.

Deploying GWT app to tomcat in eclipse

I want to use tomcat server in development mode with GWT. When I use embedded Jetty it deploys application to the current directory(where my war folder is located). So it generates all the files there. How can I configure eclipse to use tomcat server and all the deployment stuff to be copied to tomcat webapps directory. I have tried to use -noserver option in Run conigurations, but it doesn't copy any resource from war directory to server deployment directory.
Can I use tomcat server in such manner?
P.S. i want to solve this problem withou ant or maven
Using my own server in development mode instead of GWT's built-in Jetty instance
You will need to copy the contents of the WAR folder over, but only once.
Have you looked at Eclipse WTP? It allows deploying to a server right from within Eclipse.
For a GWT project, you'd then, in addition, follow that recipe: http://code.google.com/eclipse/docs/faq.html#gwt_in_eclipse_for_java_ee