1 2 Previous Next 20 Replies Latest reply on Aug 30, 2002 2:10 AM by tsangcn

    why jsp files recomplie when each I restart the server

    lizhi2002

      I using jboss 3.0.1 and tomcat 4.0.4
      my jsp file recomplies when each I restart the server.
      That make the server very slow /
      Why?
      Anybody help me?

        • 1. Re: why jsp files recomplie when each I restart the server
          tsangcn

          Yes, I just discovered the same problem. Starting from JBoss 3.0.0, each time I restart JBoss, it will recompile the JSP. So after restart of JBoss, the first time I get into a page, it will be very slow. I found that the time of recompile a JSP is much much longer than that needed for JBoss 2.4.4.

          The problem occurs for both JBoss with jetty and tomcat.
          This introduce unnecessary wait time after restart of JBoss.

          Anybody can help to solve the problem?

          • 2. Re: why jsp files recomplie when each I restart the server
            kpandey

            Hi
            I just started playing with JBoss. Looks like a great tool but the lack of docs to get started at a low level (just run some simple web apps) to seems like a big hinderence for more poeple to take up JBoss.

            I finally got 301RC1_tomcat404 up and running and was able to get the sturts-tiles example working by just dropping .war file on server/default/depoy.

            However I also noticed that it recompiles jsps everytime a
            new instance is started.

            I've spent quite sometime searching the site to fix this but haven't been able to find it.

            Does anyone know what properties I need to set to only re-compile if a jsp has changed and not everytime JBoss is started?

            Thanks

            • 3. Re: why jsp files recomplie when each I restart the server
              pascalpt

              You can currently only work around this problem with Tomcat on 3.0.1RC and later versions.

              In the tomcat4-service.xml, add this parameter to the mbean.

              false

              That will do the trick.

              Pascal

              • 4. Re: why jsp files recomplie when each I restart the server
                kpandey

                Thanks, that did it

                • 5. Re: why jsp files recomplie when each I restart the server
                  dudoes

                  Hi, I will be crazy!!!
                  i get a string problem.

                  System recompile the jsp when i reaccess a jsp file, not just after restart JBOSS. System become very slow, i will drop the building.

                  the boss is looking at me,

                  save me.

                  help!!!

                  • 6. Re: why jsp files recomplie when each I restart the server
                    tsangcn

                    Yes, adding the DeleteWorkDirs attributes to tomcat4-service.xml works for tomcat.

                    Is anybody knows similar magic with jetty?

                    Thanks
                    CN

                    • 7. Re: why jsp files recomplie when each I restart the server
                      dudoes

                      the problem is:

                      1. the same application runs slowly at another machine(Windows 2000 Server) because system recompile every jsp file and some page is not displayed when it's access by next time, not after System is restarted or hotly depolyed.

                      2. I have added the line in tomcat4-service.xml, nothing to go better.

                      3. the same application is runing well in my Notebook PC (windows 2000 Professional). when i migrate it to the Server, it's run not well. and it run well several days before.


                      I hope some help to handle it. my heart will be broken by the slow speed and recompiling of JSP. I don't know whether some matter happens with my system, or JAVA'S no second complile is lieing.

                      • 8. Re: why jsp files recomplie when each I restart the server
                        dudoes

                        I think i made it.

                        i have to recompile my application to recreate .ear to redeploy on the server( windows 2000 server), and then system return to run well.

                        but i don't know why it happens.

                        your suggestion about no recompiling after hot deployment is very good.

                        • 9. Re: why jsp files recomplie when each I restart the server
                          pascalpt

                          Hint: recompilation is based on time and file timestamp.

                          • 10. Re: why jsp files recomplie when each I restart the server
                            tsangcn

                            I have the following discovering, please give comment.

                            When JBoss deploy an EAR, it will unpack the EAR into a directory under server/default/tmp.
                            Then it will unpack the WAR into another directory, say JBOSS_TMP.
                            When shutdown JBoss, it will try to delete the stuff into JBOSS_TMP.
                            If for some reason, not successful, it will delete the stuff during restart of JBoss.
                            When a JSP is requested, Jasper is invoked. Jasper will compile the JSP into a servlet and into a servlet class.
                            The generated stuff of JSP are put in anther directory, say SCRATCHDIR, controlled by a parameter "scratchdir" of Jasper.
                            So everytime a JSP is requested, Jasper will compare if the JSP is newer than the stuff in SCRATCHDIR to determine if recompile is needed.

                            What happens is :

                            In JBoss 2.4.4 with Tomcat 3.2.3, JBOSS_TMP and SCRATCHDIR are two different directories. So everything is OK.

                            In JBoss 3.0.0 and 3.0.1, JBOSS_TMP and SCRATCHDIR are the same directory.
                            So whenever you shutdown JBoss, it will delete all stuff in JBOSS_TMP and thus SCRATCHDIR.
                            Then the next time JBoss is restarted, Jasper will do recompile of all JSP as SCRATCHDIR is cleared.

                            In JBoss 3.0.1 with Tomcat, you can control JBoss not to delete the JBOSS_TMP by specifying an attribute in tomcat4-service.xml (thanks to Pascal) as

                            false

                            Then all the stuff remain when JBoss shutdown, and thus no recompilation of JSP when JBoss restarted.
                            At last, I can have fast page loading.

                            But for JBoss 3.0.1 with Jetty, there are no such attribute as DeleteWorkDirs.
                            I have try to specify another location for SCRATCHDIR in web.xml so that JBOSS_TMP and SCRATCHDIR are two different directories.
                            But the JSP are still recompiled next time JBoss is restarted.

                            Then I found that in JBoss 2.4.4 the JSP are unpacked from the WAR file with the file date unchanged.
                            But in JBoss 3.0.1, the date of the JSP are changed to the current date and time !!!
                            So I think this may be another cause the recompilation of JSP.

                            I have WASTE A WHOLE WEEKS TIME to try to stop it from recompile of JSP.
                            And at last, I am still failed.

                            Although JBoss with Tomcat can avoid JSP recompilation, but I have other problem with Tomcat which not found in JBoss with Jetty !!!

                            Thanks
                            CN

                            • 11. Re: why jsp files recomplie when each I restart the server
                              tsangcn

                              I have the following discovering, please give comment.

                              When JBoss deploy an EAR, it will unpack the EAR into a directory under server/default/tmp.
                              Then it will unpack the WAR into another directory, say JBOSS_TMP.
                              When shutdown JBoss, it will try to delete the stuff into JBOSS_TMP.
                              If for some reason, not successful, it will delete the stuff during restart of JBoss.
                              When a JSP is requested, Jasper is invoked. Jasper will compile the JSP into a servlet and into a servlet class.
                              The generated stuff of JSP are put in anther directory, say SCRATCHDIR, controlled by a parameter "scratchdir" of Jasper.
                              So everytime a JSP is requested, Jasper will compare if the JSP is newer than the stuff in SCRATCHDIR to determine if recompile is needed.

                              What happens is :

                              In JBoss 2.4.4 with Tomcat 3.2.3, JBOSS_TMP and SCRATCHDIR are two different directories. So everything is OK.

                              In JBoss 3.0.0 and 3.0.1, JBOSS_TMP and SCRATCHDIR are the same directory.
                              So whenever you shutdown JBoss, it will delete all stuff in JBOSS_TMP and thus SCRATCHDIR.
                              Then the next time JBoss is restarted, Jasper will do recompile of all JSP as SCRATCHDIR is cleared.

                              In JBoss 3.0.1 with Tomcat, you can control JBoss not to delete the JBOSS_TMP by specifying an attribute in tomcat4-service.xml (thanks to Pascal) as

                              false

                              Then all the stuff remain when JBoss shutdown, and thus no recompilation of JSP when JBoss restarted.
                              At last, I can have fast page loading.

                              But for JBoss 3.0.1 with Jetty, there are no such attribute as DeleteWorkDirs.
                              I have try to specify another location for SCRATCHDIR in web.xml so that JBOSS_TMP and SCRATCHDIR are two different directories.
                              But the JSP are still recompiled next time JBoss is restarted.

                              Then I found that in JBoss 2.4.4 the JSP are unpacked from the WAR file with the file date unchanged.
                              But in JBoss 3.0.1, the date of the JSP are changed to the current date and time !!!
                              So I think this may be another cause the recompilation of JSP.

                              I have WASTE A WHOLE WEEKS TIME to try to stop it from recompile of JSP.
                              And at last, I am still failed.

                              Although JBoss with Tomcat can avoid JSP recompilation, but I have other problem with Tomcat which not found in JBoss with Jetty !!!

                              Thanks
                              CN

                              • 12. Re: why jsp files recomplie when each I restart the server
                                tsangcn

                                I have the following discovering, please give comment.

                                When JBoss deploy an EAR, it will unpack the EAR into a directory under server/default/tmp.
                                Then it will unpack the WAR into another directory, say JBOSS_TMP.
                                When shutdown JBoss, it will try to delete the stuff into JBOSS_TMP.
                                If for some reason, not successful, it will delete the stuff during restart of JBoss.
                                When a JSP is requested, Jasper is invoked. Jasper will compile the JSP into a servlet and into a servlet class.
                                The generated stuff of JSP are put in anther directory, say SCRATCHDIR, controlled by a parameter "scratchdir" of Jasper.
                                So everytime a JSP is requested, Jasper will compare if the JSP is newer than the stuff in SCRATCHDIR to determine if recompile is needed.

                                What happens is :

                                In JBoss 2.4.4 with Tomcat 3.2.3, JBOSS_TMP and SCRATCHDIR are two different directories. So everything is OK.

                                In JBoss 3.0.0 and 3.0.1, JBOSS_TMP and SCRATCHDIR are the same directory.
                                So whenever you shutdown JBoss, it will delete all stuff in JBOSS_TMP and thus SCRATCHDIR.
                                Then the next time JBoss is restarted, Jasper will do recompile of all JSP as SCRATCHDIR is cleared.

                                In JBoss 3.0.1 with Tomcat, you can control JBoss not to delete the JBOSS_TMP by specifying an attribute in tomcat4-service.xml (thanks to Pascal) as

                                false

                                Then all the stuff remain when JBoss shutdown, and thus no recompilation of JSP when JBoss restarted.
                                At last, I can have fast page loading.

                                But for JBoss 3.0.1 with Jetty, there are no such attribute as DeleteWorkDirs.
                                I have try to specify another location for SCRATCHDIR in web.xml so that JBOSS_TMP and SCRATCHDIR are two different directories.
                                But the JSP are still recompiled next time JBoss is restarted.

                                Then I found that in JBoss 2.4.4 the JSP are unpacked from the WAR file with the file date unchanged.
                                But in JBoss 3.0.1, the date of the JSP are changed to the current date and time !!!
                                So I think this may be another cause the recompilation of JSP.

                                I have WASTE A WHOLE WEEKS TIME to try to stop it from recompile of JSP.
                                And at last, I am still failed.

                                Although JBoss with Tomcat can avoid JSP recompilation, but I have other problem with Tomcat which not found in JBoss with Jetty !!!

                                Thanks
                                CN

                                • 13. Re: why jsp files recomplie when each I restart the server
                                  tsangcn

                                  I have the following discovering, please give comment.

                                  When JBoss deploy an EAR, it will unpack the EAR into a directory under server/default/tmp.
                                  Then it will unpack the WAR into another directory, say JBOSS_TMP.
                                  When shutdown JBoss, it will try to delete the stuff into JBOSS_TMP.
                                  If for some reason, not successful, it will delete the stuff during restart of JBoss.
                                  When a JSP is requested, Jasper is invoked. Jasper will compile the JSP into a servlet and into a servlet class.
                                  The generated stuff of JSP are put in anther directory, say SCRATCHDIR, controlled by a parameter "scratchdir" of Jasper.
                                  So everytime a JSP is requested, Jasper will compare if the JSP is newer than the stuff in SCRATCHDIR to determine if recompile is needed.

                                  What happens is :

                                  In JBoss 2.4.4 with Tomcat 3.2.3, JBOSS_TMP and SCRATCHDIR are two different directories. So everything is OK.

                                  In JBoss 3.0.0 and 3.0.1, JBOSS_TMP and SCRATCHDIR are the same directory.
                                  So whenever you shutdown JBoss, it will delete all stuff in JBOSS_TMP and thus SCRATCHDIR.
                                  Then the next time JBoss is restarted, Jasper will do recompile of all JSP as SCRATCHDIR is cleared.

                                  In JBoss 3.0.1 with Tomcat, you can control JBoss not to delete the JBOSS_TMP by specifying an attribute in tomcat4-service.xml (thanks to Pascal) as

                                  false

                                  Then all the stuff remain when JBoss shutdown, and thus no recompilation of JSP when JBoss restarted.
                                  At last, I can have fast page loading.

                                  But for JBoss 3.0.1 with Jetty, there are no such attribute as DeleteWorkDirs.
                                  I have try to specify another location for SCRATCHDIR in web.xml so that JBOSS_TMP and SCRATCHDIR are two different directories.
                                  But the JSP are still recompiled next time JBoss is restarted.

                                  Then I found that in JBoss 2.4.4 the JSP are unpacked from the WAR file with the file date unchanged.
                                  But in JBoss 3.0.1, the date of the JSP are changed to the current date and time !!!
                                  So I think this may be another cause the recompilation of JSP.

                                  I have WASTE A WHOLE WEEKS TIME to try to stop it from recompile of JSP.
                                  And at last, I am still failed.

                                  Although JBoss with Tomcat can avoid JSP recompilation, but I have other problem with Tomcat which not found in JBoss with Jetty !!!

                                  Thanks
                                  CN

                                  • 14. Re: why jsp files recomplie when each I restart the server
                                    tsangcn

                                    I have the following discovering, please give comment.

                                    When JBoss deploy an EAR, it will unpack the EAR into a directory under server/default/tmp.
                                    Then it will unpack the WAR into another directory, say JBOSS_TMP.
                                    When shutdown JBoss, it will try to delete the stuff into JBOSS_TMP.
                                    If for some reason, not successful, it will delete the stuff during restart of JBoss.
                                    When a JSP is requested, Jasper is invoked. Jasper will compile the JSP into a servlet and into a servlet class.
                                    The generated stuff of JSP are put in anther directory, say SCRATCHDIR, controlled by a parameter "scratchdir" of Jasper.
                                    So everytime a JSP is requested, Jasper will compare if the JSP is newer than the stuff in SCRATCHDIR to determine if recompile is needed.

                                    What happens is :

                                    In JBoss 2.4.4 with Tomcat 3.2.3, JBOSS_TMP and SCRATCHDIR are two different directories. So everything is OK.

                                    In JBoss 3.0.0 and 3.0.1, JBOSS_TMP and SCRATCHDIR are the same directory.
                                    So whenever you shutdown JBoss, it will delete all stuff in JBOSS_TMP and thus SCRATCHDIR.
                                    Then the next time JBoss is restarted, Jasper will do recompile of all JSP as SCRATCHDIR is cleared.

                                    In JBoss 3.0.1 with Tomcat, you can control JBoss not to delete the JBOSS_TMP by specifying an attribute in tomcat4-service.xml (thanks to Pascal) as

                                    false

                                    Then all the stuff remain when JBoss shutdown, and thus no recompilation of JSP when JBoss restarted.
                                    At last, I can have fast page loading.

                                    But for JBoss 3.0.1 with Jetty, there are no such attribute as DeleteWorkDirs.
                                    I have try to specify another location for SCRATCHDIR in web.xml so that JBOSS_TMP and SCRATCHDIR are two different directories.
                                    But the JSP are still recompiled next time JBoss is restarted.

                                    Then I found that in JBoss 2.4.4 the JSP are unpacked from the WAR file with the file date unchanged.
                                    But in JBoss 3.0.1, the date of the JSP are changed to the current date and time !!!
                                    So I think this may be another cause the recompilation of JSP.

                                    I have WASTE A WHOLE WEEKS TIME to try to stop it from recompile of JSP.
                                    And at last, I am still failed.

                                    Although JBoss with Tomcat can avoid JSP recompilation, but I have other problem with Tomcat which not found in JBoss with Jetty !!!

                                    Thanks
                                    CN

                                    1 2 Previous Next