You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Shreekanta Prasad <sp...@sapient.com> on 2007/12/27 05:10:31 UTC

Remote deployment in tomcat

 
Hi All,

    I want to deploy my web application(in the form of a war file)
remotely through ant script.
    I have written ant script for that and it is doing deployment
properly to the remote host.
    But still I am getting old application itself new changes are not
getting updated.
    Once we restart the apache it will work.The reason for this "work"
floder of tomcat.
    After restarting the new changes are getting updated to the work
folder.
  
    Is there any way to trigger the tomcat to delete work folder
automatically and create by itself 
    without restart if the .war file modified ?

    Or Is there any trigger event associated with tomcat so that we can
configure so as restarting of tomcat
    occurs if we modify the war file ?

    Hot deployment feature is there in tomacat.

  I am using Tomacat 5.5 not command line startup using as a windows
service(system try icon)
  Operating system is windows 2003 server.
  Ant version is 1.7.0 .



Thanks and Regards -
Shreekanta Prasad
Bangalore,Karnataka
India.



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Remote deployment in tomcat

Posted by Jacob Rhoden <li...@jacobrhoden.com>.
How could Cruise Contol possibly allow you to tell tomcat to (remotely) 
clean its work directory from an ant build script? I use hudson for 
continuous integration so maybe I am missing something.

Marcio Camurati wrote:
> Maybe CruiseControl can help you to make it, it's a project that for create continuous build process scheduled:
>
>
>   


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Remote deployment in tomcat

Posted by Marcio Camurati <ma...@wx7.com.br>.
Hi,

Maybe CruiseControl can help you to make it, it's a project that for create continuous build process scheduled:

http://cruisecontrol.sourceforge.net/

See ya.
Marcio Camurati

 Thu, 27 Dec 2007 00:57:42 -0500, Louis <la...@gmail.com> escreveu:

> Shreekanta Prasad wrote:
> >  
> > Hi All,
> >
> >     I want to deploy my web application(in the form of a war file)
> > remotely through ant script.
> >     I have written ant script for that and it is doing deployment
> > properly to the remote host.
> >     But still I am getting old application itself new changes are not
> > getting updated.
> >     Once we restart the apache it will work.The reason for this "work"
> > floder of tomcat.
> >     After restarting the new changes are getting updated to the work
> > folder.
> >   
> >     Is there any way to trigger the tomcat to delete work folder
> > automatically and create by itself 
> >     without restart if the .war file modified ?
> >
> >     Or Is there any trigger event associated with tomcat so that we can
> > configure so as restarting of tomcat
> >     occurs if we modify the war file ?
> >
> >     Hot deployment feature is there in tomacat.
> >
> >   I am using Tomacat 5.5 not command line startup using as a windows
> > service(system try icon)
> >   Operating system is windows 2003 server.
> >   Ant version is 1.7.0 .
> >
> >
> >
> > Thanks and Regards -
> > Shreekanta Prasad
> > Bangalore,Karnataka
> > India.
> >   
> I work this way with JBoss all the time. In the ant script you can 
> simply code in the call to delete the appropriate work directory.  See 
> the ant <delete> task.
> http://ant.apache.org/manual/CoreTasks/delete.html
> 
> My guess as to the actual problem:
> Since you're copying a file across the network it can take a little 
> while for the transfer to complete. I don't know about Tomcat but in 
> JBoss the container can see the new file and try to unzip it before it's 
> fully copied over. The copy still works but the unzip attempt fails 
> (since the copy isn't done yet) and the hot deploy gets cancelled. The 
> work-around to this is to copy the file to a temp folder other than the 
> deploy directory (where tomcat/jboss expects to find the war). This 
> allows the copy to complete without Tomcat attempting to unzip a partial 
> file. After the <copy> task you then use a <move> to move the file from 
> the temp folder to the deploy folder _on the same server/drive_. Since 
> the move simply updates the file pointer tomcat will only see the file 
> once the operation is complete. This guarantees that tomcat can acutally 
> unzip the file.
> 
> It's quite possible that this is the problem you're having and the empty 
> work directoy isn't a part of it.
> 
> I hope that helps. Best Regards,
> 
> Louis
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 
> 

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Remote deployment in tomcat

Posted by Louis <la...@gmail.com>.
Shreekanta Prasad wrote:
>  
> Hi All,
>
>     I want to deploy my web application(in the form of a war file)
> remotely through ant script.
>     I have written ant script for that and it is doing deployment
> properly to the remote host.
>     But still I am getting old application itself new changes are not
> getting updated.
>     Once we restart the apache it will work.The reason for this "work"
> floder of tomcat.
>     After restarting the new changes are getting updated to the work
> folder.
>   
>     Is there any way to trigger the tomcat to delete work folder
> automatically and create by itself 
>     without restart if the .war file modified ?
>
>     Or Is there any trigger event associated with tomcat so that we can
> configure so as restarting of tomcat
>     occurs if we modify the war file ?
>
>     Hot deployment feature is there in tomacat.
>
>   I am using Tomacat 5.5 not command line startup using as a windows
> service(system try icon)
>   Operating system is windows 2003 server.
>   Ant version is 1.7.0 .
>
>
>
> Thanks and Regards -
> Shreekanta Prasad
> Bangalore,Karnataka
> India.
>   
I work this way with JBoss all the time. In the ant script you can 
simply code in the call to delete the appropriate work directory.  See 
the ant <delete> task.
http://ant.apache.org/manual/CoreTasks/delete.html

My guess as to the actual problem:
Since you're copying a file across the network it can take a little 
while for the transfer to complete. I don't know about Tomcat but in 
JBoss the container can see the new file and try to unzip it before it's 
fully copied over. The copy still works but the unzip attempt fails 
(since the copy isn't done yet) and the hot deploy gets cancelled. The 
work-around to this is to copy the file to a temp folder other than the 
deploy directory (where tomcat/jboss expects to find the war). This 
allows the copy to complete without Tomcat attempting to unzip a partial 
file. After the <copy> task you then use a <move> to move the file from 
the temp folder to the deploy folder _on the same server/drive_. Since 
the move simply updates the file pointer tomcat will only see the file 
once the operation is complete. This guarantees that tomcat can acutally 
unzip the file.

It's quite possible that this is the problem you're having and the empty 
work directoy isn't a part of it.

I hope that helps. Best Regards,

Louis

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org