Igor,
I figured it out. If you set the deployOnStartup attribute to true, but
the autoDeploy attribute to false, the war files that are in the webapps
folder at the time of startup will load. Then you can run the manager via
script (command line). Simply pass the undeploy command to the manager to
the context you want to remove and let it finish. It will remove the war
and the application directory. Then I ran the command to deploy again via
curl. This time it waited until the entire war was uploaded before it
deployed it.
It took me a while to figure out it was a combination of deployOnStartup
and autoDeploy. Of course there was ZERO incling that this was the problem
and I had to re-re-re-read the docs very carefully to figure this out.
Finally decided to try a hunch and it actually paid off. It might be a
good idea to add this to the wiki or some place with common trouble
shooting problems.
Just my $.02.
- Josh
On Fri, Oct 26, 2012 at 6:37 PM, Igor Cicimov icici...@gmail.com wrote:
On 27/10/2012 5:27 AM, Josh Gooding josh.good...@gmail.com wrote:
Hey group,
I'm working with Tomcat 7's manager application for text deployments. I
am
having a bit of a quirky issue here. I am deploying a web application
that
is approx 75MB as a war file that uses Tomcat's ROOT context.
Is there a way that I can get tomcat to NOT start auto-deploying
immediately when the manager is invoked with a deploy / update command?
Something like a check to see if the web application has fully uploaded?
Is there currently a work around for this?
When I run the command: curl -k --upload-file ROOT.war
https://[manageruser]:[pwd]@[fqd
name]:8443/manager/text/deploy?path=/ROOTwar=ROOT.warupdate=true, I get
many different exceptions.
I dont think its tomcat fault it is you telling it to deploy with the above
command while the upload is still in progress. You should search for some
kind of delay or timeout in curl or find other way of doing this.
If I go to push the webapp as a new application, I an riddled with
multiple exceptions:
SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Invalid or unreadable WAR file :
error
in opening zip file
at
org.apache.naming.resources.WARDirContext.setDocBase(WARDirContext.java:141)
SEVERE: Exception fixing docBase for context []
java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
and of course how could I forget
SEVERE: Error deploying web application archive
/opt/apache-tomcat-7.0.30/webapps/ROOT.war
java.lang.IllegalArgumentException: addChild: Child name '' is not
unique.
A simple restart fixes this... but that's really counter intuitive and
very
invasive.
Obviously there is something that I am doing wrong, but I can't figure it
out. What I see happening is that TC is getting the file, and instead of
waiting for the entire file (the web app is 75MB), tries to immediately
redeploy it.
1 - Is there a way to force tomcat to wait until the uploading of the
application is complete?
2 - If so, how?