Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / July 2007

Tip: Looking for answers? Try searching our database.

Tomcat deploys application multiple times

Thread view: 
luke.borloz@gmail.com - 23 Jul 2007 21:05 GMT
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?
Sanjay - 23 Jul 2007 21:58 GMT
> 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
[quoted text clipped - 5 lines]
> 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?
luke.borloz@gmail.com - 23 Jul 2007 22:28 GMT
> luke.bor...@gmail.com wrote:
> > We have a Tomcat 5.5.23 installation that we have set to unpack and
[quoted text clipped - 10 lines]
> 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.
Manish Pandit - 23 Jul 2007 23:13 GMT
On Jul 23, 2:28 pm, "luke.bor...@gmail.com" <luke.bor...@gmail.com>
wrote:

> > luke.bor...@gmail.com wrote:
> > > We have a Tomcat 5.5.23 installation that we have set to unpack and
[quoted text clipped - 19 lines]
> 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
Mark Jeffcoat - 24 Jul 2007 07:12 GMT
> 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
[quoted text clipped - 5 lines]
> 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.

Signature

Mark Jeffcoat
Austin, TX

christopher@dailycrossword.com - 26 Jul 2007 05:13 GMT
On Jul 23, 1:05 pm, "luke.bor...@gmail.com" <luke.bor...@gmail.com>
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
[quoted text clipped - 5 lines]
> 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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.