title: How to do grace hot-deployment on Tomcat (non-stop)
body: <p>Our production is running on LB+TOMCAT, We use our own custom made SAFE-DEPLOY tool to deploy the changes into the production.As our system is committed to provide 24/7 availability, the tool deploys the changes as follows</p>
  
  <p>Total servers used  for a particular service are  divided into groups. Let us assume it is divided into 2 groups and they stop one group,deploy changes and start the group. After first group is completed, they  deploy changes to the other group.In most cases, it works well without any issue.</p>
  
  <p>The problem is caused by a special case. One service generates a token that client takes it as credential,now we changed the token's format, if we use same deploy approach ,there should be some potential issues.ie.group1 stop and deploy new code then restart (it's OK),group2 stop (prepare to deploy new code),now error may happen when group2 deploys, because during that time group1 may receive the old format token that generated by group2 (1.when group1 is deploying, group2 runs old code,2.group2 is stopped cannot process request),client gets a error which shows token is wrong,but it's not real wrong token.</p>
  
  <p>I have a solution is, make our code can process both new format token and old format token,but only generates new format token, after 1 day running, we can do a deployment that only process new format token. I guess it works fine, but it's not grace.</p>
  
  <p>My question, is there any grace deploy approach that makes server can handle both old formatted token that has been generated and new formatted token without any code change.</p>
  
  <p>BTW:I find a reference,<a href="https://serverfault.com/questions/307701/whats-the-best-practice-for-hot-redeployment-of-wars-to-tomcat">best practice hot deploy on tomcat</a>,it only works for tomcat 7, our working tomcat is 6.0.26.</p>