WebLogic tuning: JSP pre-compilation

When users call up a JSP page the first time, WebLogic automatically translates the JSP file into a servlet and then compiles that servlet. This process can take over 30 seconds, which could lead to user dissatisfaction. Further, this process is performed serially even on a multiprocessor node - if you have multiple users hitting five different pages, WebLogic compiles these pages one at a time. As a result, we strongly recommend precompiling the JSP pages prior to deployment into production.

To precompile, you need to build the Sterling Selling and Fulfillment Foundation enterprise archive file (smcfs.ear).

Follow these steps:

  1. Export JAVA_HOME=<java installation directory>, where <java installation directory> is the path to the java installation directory. For example, JAVA_HOME=/apps/jdk/java6/.
  2. Export INSTALL_DIR=<ssfs installation directory>, where <ssfs installation directory> is the path to the Sterling Selling and Fulfillment Foundation installation directory. For example, INSTALL_DIR=/apps/indus/foundation.
  3. Export WL_HOME=<weblogic server directory>, where <weblogic server directory> is the WebLogic server directory. For example, WL_HOME=/apps/bea1212/wlserver12.1.2/server.
  4. For WebLogic 12.1.2, export:
    WLS_JARS=${JAVA_HOME}/lib/tools.jar:
    ${WL_HOME}/lib/weblogic.jar:${WL_HOME}/lib/ojdbc6.jar:${JAVA_HOME}
    /jre/lib/rt.jar
  5. Export STERLING_CLASSPATH="${WLS_JARS}:${CLASSPATH}".
  6. Export APPC_CLASSPATH=${WL_HOME}/lib/weblogic.jar:${JAVA_HOME}/lib/tools.jar.
  7. Run the following command:
    ${JAVA_HOME}/bin/java -Xms1024m -Xmx1024m \
                            -Djava.io.tmpdir=${INSTALL_DIR}/tmp \
                            -classpath ${APPC_CLASSPATH} weblogic.appc \
    ${INSTALL_DIR}/external_deployments/smcfs.ear \
                            -forceGeneration \
                            -O \
                            -verbose \
                            -classpath ${YANTRA_CLASSPATH} \
                            ${INSTALL_DIR}/external_deployments/smcfs.ear
Note: For Windows, format the example appropriately.

The precompiled JSPs are stored back into the smcfs.ear file.