Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Apache Tomcat »

Re: JSP's not recompiling

David Delbecq

2006-12-18

Replies:

Hi, could this be your problem (considering rsync does set timestamp to
the source timestamps and not the current time)?

1) tomcat start, file X.jsp (version 1) has timestamp t
2) remote content management does a modification, remote X.jsp (version
2) has timestamp t+1
3) in the meanwhile, a client request X.jsp on tomcat, jasper build
X_jsp.class (version 1) with timestamp t+2
4) remote content management does the rsync operation, tomcat's X.jsp
(now version 2) has now timestamp t+1
5) user request X.jsp, jasper compare the X_jsp.class timestamp (t+2) to
X.jsp timestamp (t+1) and concludes X_jsp.class (version 1) is more
recent than X.jsp (version 2) and so does not recompile.


If answer is yes, than you can start fixing your scripts to correctly
update timestamps:)

Whatever, compare the .class timestamp to the .jsp timestamp and check
the .jsp is really timestamped as newer than .class file.


Johnson, David a ?crit :
> We're having some issues with JSP files not being recompiled when they
> should be, and was wondering if anyone can shed some light on it.
>
> We have Jasper set up in development mode, with the following in
> conf/web.xml:
>
> <servlet>
>      <servlet-name>jsp</servlet-name>
>
> <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
>      <init-param>
>         <param-name>fork</param-name>
>         <param-value>false</param-value>
>      </init-param>
>      <init-param>
>         <param-name>development</param-name>
>         <param-value>true</param-value>
>      </init-param>
>      <init-param>
>         <param-name>modificationTestInterval</param-name>
>         <param-value>0</param-value>
>      </init-param>
>      <init-param>
>         <param-name>reloadable</param-name>
>         <param-value>true</param-value>
>      </init-param>
>      <init-param>
>         <param-name>xpoweredBy</param-name>
>         <param-value>false</param-value>
>      </init-param>
>      <load-on-startup>3</load-on-startup>
> </servlet>
>
> The JSP files are being created and updated by a content management
> system on a remote box, and then pushed onto the webserver using Rsync.
>
> Tomcat does not always seem to spot that a file has been updated though,
> and continues to serve the old jsp. I can force a recompile by
> "touch"ing the jsp file, but have no idea why this works, as the rsync
> is updating the timestamps whenever the page is updated anyway.
>
> Any advice would be welcome, it's driving our developers a little mad
> and me with it.
>
> Dave
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@(protected)
> To unsubscribe, e-mail: users-unsubscribe@(protected)
> For additional commands, e-mail: users-help@(protected)
>
>  


---------------------------------------------------------------------
To start a new topic, e-mail: users@(protected)
To unsubscribe, e-mail: users-unsubscribe@(protected)
For additional commands, e-mail: users-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.