0 Replies Latest reply on Aug 26, 2002 7:12 AM by tsangcn

    JSP recompiles everytime hot deploy or restart JBoss

    tsangcn

      I have seem similar questions asked here many times, but with no response (not no solution !!) yet. I asked this question again because I have new findings.

      The JDK I used is Sun's J2SDK 1.4.0_01
      I have not made any changes to my JSP files when I do the testing.

      ** JBoss 3.0.1 [3.0.1 Date:200208062340] with Jetty

      In Linux, the WAR file is unpacked (with JSP) in /tmp/Jetty__8080___mycontext/webapp
      In Windows 2000, the WAR file is unpacked (with JSP) in %TEMP%\Jetty__8080___mycontext\webapp.
      The generated and compiled JSP is in /tmp/Jetty__8080___mycontext in Linux, and %TEMP%\Jetty__8080__mycontext in Windows 2000.
      Everytime I hot deploy my EAR file, the generated and compiled JSP is removed.
      When shutdown JBoss, the generated and compiled JSP is removed. If for some reasons they are not removed when shutdown, the will certainly be removed when restart JBoss.
      So I suspected this is the reason for the recompiling of JSP and thus slow initial page loading everytime when I redeploy my application or restart JBoss.

      Question (1): Is this behavior normal?

      Question (2): I found that the date of the unpacked JSP files is the date when WAR file is unpacked by JBoss.
      But In JBoss 2.4.4, the date of the unpacked JSP files is the same as my original JSP files.
      So this is my another suspection of recompiling of JSP files. Am I right?
      Why in JBoss 2.4.4, it keeps the date of the JSP files, but I JBoss 3.0.1 (and JBoss 3.0.0), the date of the JSP files are not kept?

      ** JBoss 3.0.1 [3.0.1 Date:200208122231] with Tomcat 4.0.4

      In Windows 2000, the WAR file is unpacked in %JBOSS_HOME%\catalina\work\MainEngine\localhost\mycontext
      *** But I cannot find the unpacked JSP files
      The generated and compiled JSP is in the same directory.
      Everytime I hot deploy my EAR file, the generated and compiled JSP is removed.
      When shutdown JBoss, the generated and compiled JSP is removed. If for some reasons they are not removed when shutdown, the will certainly be removed when restart JBoss.
      So I suspected this is the reason for the recompiling of JSP and thus slow initial page loading everytime when I redeploy my application or restart JBoss.

      Question (3): Where is the unpacked JSP files?

      Question (4): When using JBoss with Jetty, in a servlet, getServletContext().getRealPath("/") returns the directory where the WAR file is unpacked.
      But when using JBoss with Tocmat 4.0.4, the getRealPath() returns null.
      Which is correct?
      If Tomcat is correct, how can I get the directory where the WAR file is unpacked?

      Question (5): How to prevent the generated JSP classes from recompile again everytime I redeploy my application or restart JBoss? As I am using JBoss for development and testing, I am wasting a lot of time just waiting for the JSP compiling every time I redeploy my application or restart JBoss.

      Thanks
      CN