Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

There is one application where I work where there are still manual builds used i.e manually moving the servlet classes and jsp files from Dev to QA and finally to Prod.

This is the method used in this application which cant be changed for some wierd reasons.BTW this is not the problem.

We did a manual build where we transferred jsp files from QA to PROD recently.

And we noticed that the jsp file content does not correspond to the updated jsp's but have the same content to the jsp file which was present in the server prior to the deployment.

We did not re-start tomcat since jsp files upon updation automatically changes its contents.

This problem persisted even after 6 hours of deployment If we consider the time standards which are different which may cause some delay.

So to fix this we had to individually go into every jsp file and just type something save it and delete this change and save it.Then it worked perfectly.

But finally the jsp file content before and after was never changed we just did this to change the modification date.

If we think in terms of timestamp problem how can this be possible coz the old jsp files which were present in the server prior to deployment was atlest one month old and the ones getting deployed were defenitely newer than that.

Why did this happen? This did not happen when we did same type of deployments earlier.

How can we prevent this from happening in the future.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

I don't know why this happened, but you should be able to force Tomcat to recompile all JSPs by deleting everything under work/Catalina/localhost and restarting Tomcat. The frequency with which Tomcat checks whether JSPs need to be recompiled can also be tuned in web.xml.

share|improve this answer
    
What does doing the above do? And will it cause any side-effects. –  gautam vegeta Dec 14 '12 at 15:56
    
Tomcat (specifically, the Jasper JSP engine) converts JSPs into servlets (.java files) and compiles them into .class files. Those servlets are stored in the work directory. If the work directory is cleared, Tomcat will recompile the JSPs as necessary. Side effects include temporary slowness while recompilation happens. (I've also added a link in my answer to documentation on tuning the recompilation parameters.) –  200_success Dec 14 '12 at 16:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.