-1

I have a peculiar problem with deploying a spring boot web application with Tomcat . I deploy a spring boot webapplication into tomcat 8.5.8 . The deployment steps follows as below via a pascal script in windows system:

1) Tomcat is stopped
2) A sleep time of 10 seconds is given
3) Then the deployed directory is removed
4) The war file is removed
5) Then the new war file is placed

Sometimes, in webapps directory , the old deployment folders seem to present partially [i.e. the step 3 fails]. Due to that the new war file is not getting exploded. The old deployment directories are also empty within.

I am setting antiresourcelocking to true in my war file . The i use deltree command of pascal to remove my directory

Priya
  • 1,096
  • 4
  • 15
  • 32
  • 1
    Though I have not worked on Pascal script I could suggest few things .Check the tomcat health i mean whether it is down using status code .Either you can use status code 404 or 503.You can increase the sleep time by 20 seconds if you need.Then you can delete the deployed directory by having a Boolean check to confirm the entire folder is deleted and start with war deployment – Pradeep Oct 26 '17 at 08:02
  • 1
    https://www.den4b.com/forum/viewtopic.php?id=1749 and https://stackoverflow.com/questions/21143447/pascal-scripting-check-if-dest-directory-is-empty-and-only-print-yes-no-warnin pls chck these links to check whether destination folder is deleted or not – Pradeep Oct 26 '17 at 08:03
  • Check whether java is still running. If so kill java before removing directory. – Vino Oct 26 '17 at 09:02
  • we are killing the java process and ten we are starting our deployment steps – Priya Oct 26 '17 at 09:05

1 Answers1

1

Note that if you delete the war file without stopping the Tomcat it will delete the corresponding directory in a short time. Also it's worth taking a look at existing tools that can be used to streamline the deployments stack overflow post on deployment

M. Smooth
  • 36
  • 6
  • Yeah , but this war deployment process is a sub process of another patch process where it requires tomcat to be in stopped state – Priya Oct 26 '17 at 08:38