Mantis - Resin
Viewing Issue Advanced Details
2767 feature always 07-03-08 13:04 07-06-08 18:44
stbu  
ferg  
normal  
closed 3.1.6  
fixed  
none    
none 3.2.0  
0002767: MultiThreaded JspPrecompileListener
I have a large number of JSP's and when deploying a new version with an updated .war file, the com.caucho.jsp.JspPrecompileListener is precompiling all the JSP's, but it's only using one thread.

This consumes a lot of time and the startup of the web-app is delayed. It would be nice to have separate threads or instances of this JSP-Precompiler. I've already tried with two listener's but the second one is never doing anything.

This is the structure of the testcase web-app:

$RESIN/webapps/precomp
$RESIN/webapps/precomp/WEB-INF
$RESIN/webapps/precomp/WEB-INF/classes
$RESIN/webapps/precomp/WEB-INF/tmp
$RESIN/webapps/precomp/WEB-INF/work
$RESIN/webapps/precomp/t1
$RESIN/webapps/precomp/t1/sub1
$RESIN/webapps/precomp/t1/sub1/t1_sub1.jsp
$RESIN/webapps/precomp/t2
$RESIN/webapps/precomp/t2/sub2
$RESIN/webapps/precomp/t2/sub2/t2_sub2.jsp


The resin.conf contains this:

      <web-app id="/precomp" root-directory="webapps/precomp">
        <log path='WEB-INF/debug.log' timestamp='[%H:%M:%S.%s] ' format=" ${app.contextPath} ${log.level} ${log.loggerName} ${log.message}">
          <logger name="com.caucho" level="finest"/>
        </log>

        <!-- The first listener, should compile all JSP's in subfolder 't1' -->
        <listener>
          <listener-class>com.caucho.jsp.JspPrecompileListener</listener-class>
          <init>
            <fileset>
              <include>/t1/**/*.jsp</include>
            </fileset>
          </init>
        </listener>

        <!-- The second listener, should compile all JSP's in subfolder 't2' -->
        <listener>
          <listener-class>com.caucho.jsp.JspPrecompileListener</listener-class>
          <init>
            <fileset>
              <include>/t2/**/*.jsp</include>
            </fileset>
          </init>
        </listener>
      </web-app>


But only the first one is working - the WEB-INF/work/_jsp contains only _t1 subfolder with compiled JSP's.


It would be even better, if there would be only one listener with an Init-Param to specify the number of threads for the JSP Precompile, such as:

        <listener>
          <listener-class>com.caucho.jsp.JspPrecompileListener</listener-class>
          <init>
            <compile-threads>3</compile-threads>
            <fileset>
              <include>/t1/**/*.jsp</include>
              <include>/t2/**/*.jsp</include>
            </fileset>
          </init>
        </listener>


There are no notes attached to this issue.