2 Replies Latest reply on Oct 14, 2002 6:48 PM by jules

    My problem in JBoss 3.0.2 with Jetty

    tsangcn

      Hello

      I found no big problem in EJB, in connection pool, but I found problem in JSP.

      I have posted the problem already and received valuable suggestions, but the problem still not solved.
      So I post it again, and hope it can be solved.

      I am using JBoss 3.0.2 with Jetty. I deploy my application as a EAR file.
      But everytime I restart JBoss, or redeploy my EAR file, the JSP got recompiled again.
      (THE JSPs ARE NOT MODIFIED!!!). It takes about 15 to 20 seconds for every JSP to recompile.
      This is not acceptable in my development and testing cycle.
      I have try precompile the JSP. But I have some problem. And I think precompile JSP is not good in development and testing cycle.
      I have try deploy my application unpack, and it works fine. But I have the problem of management of classes.
      I found more convenient if I can deploy my application in a EAR file but with JSP compilation only when JSP has changed.

      But now JSP recompilation occurs even when JSP is not changed.

      (1) I suspect it is because during deployment, the WAR in EAR is unpacked (by JBoss, or by Jetty ?) to a temporary directory as indicated by "scratchdir" init parameter or javax.servlet.context.tempdir attribute.
      But the JSP is unpacked with the last modification date changed to the current date.
      So it makes Jasper to think that all JSP is changed, and do the recompilation.

      (2) JBoss or Jetty unpacked the WAR to a temp directory. Jasper compile the JSP to a temp directory.
      But now these two temp directory are the same, and they are differentiated with web context. So when JBoss shutdown, it expect to delete the unpacked stuff, but then delete the JSP generated stuff.
      The JSP generated stuff can be put to another directory by specifying "scratchdir" and "keepgenerated" in webdefault.xml
      But it will not be differentiated with web context. So it will becomes web context dependent, and not easy to manage if I deploy multiple web applications and similar JSP structures.

      Is these are design defect, misunstanding, work to design, .......

      Please help

      Thanks
      CN

        • 1. Re: My problem in JBoss 3.0.2 with Jetty
          bwchan

          I have an example of how to get around this problem in the Liferay Portal distribution. It uses JBoss+Jetty and precompiles all the JSPs and uses some ant tasks to make life easier.

          Check it out at www.liferay.com

          • 2. Re: My problem in JBoss 3.0.2 with Jetty

            I suspect that Jboss is not maintaining the original timestamp on files as it is unpacking them - I will investigate when I have time.

            Why do you think that precompilation during your development and testing cycle is a bad idea - If I suggested shipping all your servlet and web-service code as '.java's and compiling them on the fly the first time they were hit, would that sound like a good idea ? - just because Jasper has a neat trick to save development time does not mean you should use it all the time.

            Have you a particular reason ?

            Jules