3 Replies Latest reply: Sep 13, 2007 12:51 AM by 597758 RSS

    Clearing JSP cache in R12 and the "s_jsp_main_mode" parameter

      I would like to share something about clearing JSP cache in an R12 instance that we recently figured out.

      This is basically a cut-paste from our blog.

      There is a change in the default behaviour of handling JSP cache
      in R12 as opposed to 11i. Remember, JSPs were handled by Apache
      Jserv engine in 11i and is being handled by OC4J (10.1.3 AS) in R12.

      In 11i, when we clear cache ($COMMON_TOP/_pages) and try to
      access JSP pages, it gets automatically recompiled. However, this
      is not the case in R12 by default.

      So, in an R12 instance, if you clear _pages and restart apache,
      you will only get a blank screen since AppsLocalLogin.jsp wouldn’t
      get compiled by default. You will not even see a new _pages directory.

      To overcome this, as per Oracle, whenever JSP cache is cleared, we have to run
      “ojspcompile.pl” to recompile ALL jsp pages in the Application.
      This will take roughly around 15 to 20 mts. However, in the real world
      (atleast in the pre-production stage) this is not affordable.

      The solution to this is to change the XML file parameter
      s_jsp_main_mode to a value of “recompile” from the default value of
      “justrun” and run autoconfig. JSP pages will be recompiled automatically
      after this change.

      Hope this tip was helpful.

        • 1. Re: Clearing JSP cache in R12 and the "s_jsp_main_mode" parameter

          Thanks for the tip; I'll add it to my bag of tricks for R12!


          John P.
          • 2. Re: Clearing JSP cache in R12 and the "s_jsp_main_mode" parameter
            I think pre-compiling using ojspcompile.pl is better because there will be no perf impact for end users when they access that page for the first time. Otherwise, first time access of all the pages will be very slow as it has to compile the jsps on the fly..

            Also, I am not sure whether "recompile" mode compiles only those jsps for which cache is removed OR those jsps whose timestamps have changed (i.e. a new version of the jsp has been applied). If it checks the timestamp, then isnt it an overhead for the server as it will do a timestamp check whenever a jsp file is accessed. So in that case "justrun" is better option ..and better to be proactive and pre-compile when any new jsp is applied or cache is removed. And ojspcompile.pl has different options to pre-compile how/which files to be pre-compiled.
            • 3. Re: Clearing JSP cache in R12 and the "s_jsp_main_mode" parameter
              recompile is much better choice in debugging stage.

              The jsp gets recompiled automatically when time stamp changes, ie, no need to clear the cache.