Tomcat deploys application multiple times

Discussion in 'Java' started by luke.borloz@gmail.com, Jul 23, 2007.

  1. Guest

    We have a Tomcat 5.5.23 installation that we have set to unpack and
    auto deploy WARs. It seems that when I SCP the WAR file into the
    webapps directory on the server, Tomcat is trying to redeploy the app
    multiple times while it's copying. I'm running an ANT script to
    compile, WAR and SCP. The whole process takes about 50 seconds. Is
    there a way to set a delay on the auto-deploy from the time Tomcat
    sees the new WAR in the directory until it actually tries to deploy
    it, or is there some other way to keep Tomcat from trying to deploy
    before the whole file reaches the server?
    , Jul 23, 2007
    #1
    1. Advertising

  2. Sanjay Guest

    wrote:
    > We have a Tomcat 5.5.23 installation that we have set to unpack and
    > auto deploy WARs. It seems that when I SCP the WAR file into the
    > webapps directory on the server, Tomcat is trying to redeploy the app
    > multiple times while it's copying. I'm running an ANT script to
    > compile, WAR and SCP. The whole process takes about 50 seconds. Is
    > there a way to set a delay on the auto-deploy from the time Tomcat
    > sees the new WAR in the directory until it actually tries to deploy
    > it, or is there some other way to keep Tomcat from trying to deploy
    > before the whole file reaches the server?
    >

    Why can't you stop the server, deploy and start it up or copy the file
    to a temp location and copy to deploy directory only after entire file
    is copied via scp?
    Sanjay, Jul 23, 2007
    #2
    1. Advertising

  3. Guest

    On Jul 23, 5:05 pm, Sanjay <> wrote:
    > wrote:
    > > We have a Tomcat 5.5.23 installation that we have set to unpack and
    > > auto deploy WARs. It seems that when I SCP the WAR file into the
    > > webapps directory on the server, Tomcat is trying to redeploy the app
    > > multiple times while it's copying. I'm running an ANT script to
    > > compile, WAR and SCP. The whole process takes about 50 seconds. Is
    > > there a way to set a delay on the auto-deploy from the time Tomcat
    > > sees the new WAR in the directory until it actually tries to deploy
    > > it, or is there some other way to keep Tomcat from trying to deploy
    > > before the whole file reaches the server?

    >
    > Why can't you stop the server, deploy and start it up or copy the file
    > to a temp location and copy to deploy directory only after entire file
    > is copied via scp?


    I could do that, but the point of doing everything in the ANT script
    is to make it easy. Having to stop the server or copy from one
    location to another would no longer be as easy. The real problem is
    that we are using Hibernate and from what I understand it is prone to
    memory leaks. So, each time we redeploy an application, it eats up
    more memory and causes java.lang.OutOfMemoryError: PermGen space
    errors. If we could somehow fix Hibernate, (in theory) it wouldn't
    matter how many times the app deployed.
    , Jul 23, 2007
    #3
  4. On Jul 23, 2:28 pm, "" <>
    wrote:
    > On Jul 23, 5:05 pm, Sanjay <> wrote:
    >
    > > wrote:
    > > > We have a Tomcat 5.5.23 installation that we have set to unpack and
    > > > auto deploy WARs. It seems that when I SCP the WAR file into the
    > > > webapps directory on the server, Tomcat is trying to redeploy the app
    > > > multiple times while it's copying. I'm running an ANT script to
    > > > compile, WAR and SCP. The whole process takes about 50 seconds. Is
    > > > there a way to set a delay on the auto-deploy from the time Tomcat
    > > > sees the new WAR in the directory until it actually tries to deploy
    > > > it, or is there some other way to keep Tomcat from trying to deploy
    > > > before the whole file reaches the server?

    >
    > > Why can't you stop the server, deploy and start it up or copy the file
    > > to a temp location and copy to deploy directory only after entire file
    > > is copied via scp?

    >
    > I could do that, but the point of doing everything in the ANT script
    > is to make it easy. Having to stop the server or copy from one
    > location to another would no longer be as easy. The real problem is
    > that we are using Hibernate and from what I understand it is prone to
    > memory leaks. So, each time we redeploy an application, it eats up
    > more memory and causes java.lang.OutOfMemoryError: PermGen space
    > errors. If we could somehow fix Hibernate, (in theory) it wouldn't
    > matter how many times the app deployed.


    If you put anything with *.war in $TOMCAT_HOME/webapps, tomcat will
    pick it up as a part of its hotdeploy monitor regardless of the
    integrity. I'd recommend scp-ing it as another extension (like .myapp)
    and then once its copied completely, rename it to .war. This will
    ensure tomcat never picks up a partial file, and this is doable via
    ant as you pointed out.

    -cheers,
    Manish
    Manish Pandit, Jul 23, 2007
    #4
  5. "" <> writes:

    > We have a Tomcat 5.5.23 installation that we have set to unpack and
    > auto deploy WARs. It seems that when I SCP the WAR file into the
    > webapps directory on the server, Tomcat is trying to redeploy the app
    > multiple times while it's copying. I'm running an ANT script to
    > compile, WAR and SCP. The whole process takes about 50 seconds. Is
    > there a way to set a delay on the auto-deploy from the time Tomcat
    > sees the new WAR in the directory until it actually tries to deploy
    > it, or is there some other way to keep Tomcat from trying to deploy
    > before the whole file reaches the server?
    >


    This isn't an answer to the question you asked, but
    have you seen the Tomcat Manager ant tasks at
    http://tomcat.apache.org/tomcat-5.5-doc/manager-howto.html
    ?

    I use the deploy task to manage everything, but if you
    need to keep the "secure" in your secure copy, you could
    use the start and stop tasks to prevent Tomcat from trying
    to unpack the war until the SCP finishes.

    --
    Mark Jeffcoat
    Austin, TX
    Mark Jeffcoat, Jul 24, 2007
    #5
  6. Guest

    On Jul 23, 1:05 pm, "" <>
    wrote:
    > We have a Tomcat 5.5.23 installation that we have set to unpack and
    > auto deploy WARs. It seems that when I SCP the WAR file into the
    > webapps directory on the server, Tomcat is trying to redeploy the app
    > multiple times while it's copying. I'm running an ANT script to
    > compile, WAR and SCP. The whole process takes about 50 seconds. Is
    > there a way to set a delay on the auto-deploy from the time Tomcat
    > sees the new WAR in the directory until it actually tries to deploy
    > it, or is there some other way to keep Tomcat from trying to deploy
    > before the whole file reaches the server?


    I had this exact problem. it was easy to fix -- my ISP / managed host
    added some incorrect settings in one of the conf files server.xml or
    the main web.xml. I cleaned up these files by reverting to the
    example versions and the problem went away
    , Jul 26, 2007
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?bWF2cmlja18xMDE=?=

    SetAuthCookie works some times and fails some times?

    =?Utf-8?B?bWF2cmlja18xMDE=?=, Mar 23, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    500
    =?Utf-8?B?bWF2cmlja18xMDE=?=
    Mar 23, 2006
  2. =?Utf-8?B?bWF2cmlja18xMDE=?=

    Forms Authentication Fails some times and not some times???

    =?Utf-8?B?bWF2cmlja18xMDE=?=, Mar 28, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    484
    =?Utf-8?B?bWF2cmlja18xMDE=?=
    Mar 28, 2006
  3. Terry Reedy

    SF deploys SA, lauds P & BC

    Terry Reedy, Aug 31, 2003, in forum: Python
    Replies:
    3
    Views:
    286
    mackstann
    Aug 31, 2003
  4. Max2006
    Replies:
    4
    Views:
    729
    Steven Cheng[MSFT]
    Oct 2, 2007
  5. Jack Steven
    Replies:
    2
    Views:
    418
    Chris Rebert
    Mar 9, 2009
Loading...

Share This Page