2 Replies Latest reply on Oct 20, 2003 4:05 AM by neilharvey

    JSP Recompilation caused by temporary deploy directory times

    neilharvey

      Hi,
      in Jboss 3.2.2 I am getting the age old problem of jsps being recompiled at every new access after a Jboss restart. Its caused by the fact that my jsps are contained within a WAR which gets exploded to the tmp/deploy directory during deployment.

      All of the timestamps on the jsps in the 'tmp' WAR are therefore current (since they have just been copied there) whereas the previously compiled jsps from earlier deployments which are in the work directory will obviously have older timestamps.

      I know that this is the cause of the recompilation problem because if I touch the older jsp src/classes in the work directory directly after jboss is fully deployed (therefore making them appear newer than those in the exploded war in the tmp/deploy directory) they do not get recompiled.

      Does anyone know of some setting that overides/avoids this behaviour?

      Thanks

      Neil

        • 1. Re: JSP Recompilation caused by temporary deploy directory t
          trbentley
          • 2. Re: JSP Recompilation caused by temporary deploy directory t
            neilharvey

            Hi - I saw your post but I think we are talking about slightly different problems here. My jsps don't get deleted on re-deploy - its just the fact that their timestamps are older than those that are deployed into the tmp directory when jboss restarts that causes the problem.

            Since Jboss automatically copies and explodes my war (which contains the source jsps) into a tmp directory during deployment all of the timestamps of jsps in that war are updated to the current date and time. This means that regardless of the fact that my previously compiled jsps in the work directory are still there they appear to be older than the source jsps so they get recompiled.

            I have solved the problem by writing some code which updates all of the jsp timestamps for existing jsps in the work directory after all applications are deployed. This is done from a call within an initialisation servlet
            which runs when deployment is complete. My previously deployed jsps then have 'younger' timestamps than those in the tmp directory and no re-compilation takes place.

            Thanks TRB

            Neil