• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem with deploying a war file on tomcat

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am trying to deploy a (applet-servlet) war file on tomcat using the ant script. This script runs fine and the deployment is done properly if run from my deployment managers pc. He is using ant 1.5 and jdk 1.4.2_01.
I use 1.6 and jdk 1.4.2_04. Every thing is fine but somehow tomcat still runs the old war, eventhough my new war is ftp-ed to the webapps directory.
Please help.
thanks.
aparna.
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Meenu",

We're pleased to have you here with us on the Ranch, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
Forum Bartender
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
(I'm thinking that this might be more a Tomcat problem, than anything to do with Ant. Let's see if we can track things down...)

What does the Ant script look like that you're using to deploy the WAR on Tomcat? Are you using the Tomcat management API?
 
Apu Shah
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
The ant script executes shutdown.sh and startup.sh to stop and start the tomcat. It ftp's the new war file to the proper location in webapps directory. But some how is still executing the war file.
Following is the part of the ant script :

<target name="deploy" depends="mywar">
- <telnet userid="user" password="pwd" server="myserver.com">
<read>#</read>
<write>su - adm</write>
<read>Password:</read>
<write>password</write>
<read>Which Environment?</read>
<write>${env}</write>
<read>#</read>
<write>shutdown.sh</write>
<read>#</read>
- <!--
rollback
-->
<write>cp /MYAPP /${env}/tomcat/webapps/myapp.war /MYAPP/${env}/webapp/rollback</write>
<read>#</read>
- <!--
del old exploded app directory
-->
<write>rm -Rf /MYAPP/${env}/tomcat/webapps/myapp</write>
</telnet>
- <ftp server="myserver.com" userid="adm" password="password" remotedir="/MYAPP/${env}/tomcat/webapps">
- <fileset dir=".">
<include name="myapp.war" />
</fileset>
</ftp>
- <telnet userid="user" password="pwd" server="myserver.com">
<read>#</read>
<write>su - appsadm</write>
<read>Password:</read>
<write>password</write>
<read>Which Environment?</read>
<write>${env}</write>
<read>#</read>
<write>startup.sh</write>
<read>#</read>
<write>tail -f /MYAPP/${env}/tomcat/logs/stdout.log</write>
<read>EmbededTomcat: Startup time</read>
</telnet>
</target>
- <target name="tdeploy">
- <antcall target="deploy">
<param name="env" value="test" />
</antcall>
</target>


thanks
 
reply
    Bookmark Topic Watch Topic
  • New Topic