Thursday, June 7, 2012

JBoss 4.2.3 – Empty work directory on shutdown

A common problem I’ve had with customer installations at testing stage is that as they get updated .ear versions, they won’t see the changes made to .jsp pages until someone will manually remove the contents of the jboss\server\default\work directory.

That is because JBoss compiles the JSP pages into class files and persists them in the work directory, with the gain of not having to recompile them on next start. Problem is that it doesn’t seem to recompile them if there’s a timestamp difference between the source jsp and the .class file… Obviously a solution is to pre-compile JSP pages in your application and ship the .class files with your .ear.

But at the same time, an easy solution is to configure JBoss Web deployer to destroy the contents of the work directory at shutdown through configuration.
[...]
  <!-- Flag to delete the Work Dir on Context Destroy -–>
  <attribute name="DeleteWorkDirOnContextDestroy">true</attribute>
[...]

No comments :

Post a Comment