Sunday, September 1, 2013

Collecting data for problems with WAS JSP container

When debugging problems related to JSP files, it is often important to get the generated java source for the JSP.

The generated java source for all newly compiled JSP files will be stored in the JSP scratch directory.

Profile_Root/temp/node_name/server_name/EAR_App_Name/WAR_APP_Name/temp 

1. Development phase using RAD.

a. Open the deployment descriptor for the Web Application.
b. Go to Extensions tab.
c. Add a new jsp attribute with name="keepgenerated" and value="true".
d. Save all changes.

2. If you have already deployed your application and are using JSPBatchCompiler to compile JSPs, then you can specify the keep generated option for the JSP batch compile

Run the following JSPBatchComplier command"-

Run the JspBatchCompiler.sh or JspBatchCompiler.bat on the failing JSP with -keepgenerated option as per the following example. The -keepgenerated option will generate _*.java file while compiling JSP to _*.class file. To determine the enterpriseapp.name and webmodule.name.

JspBatchCompiler 

install_root/profiles/profile_name/bin/JspBatchCompiler.sh -enterpriseapp.name application_name -webmodule.name webapplication_name -cell.name cell_name -node.name node_name -server.name server_name -filename jsp_file -keepgenerated true -forceCompilation true -log.level FINEST > jspbatchcompiler.out 2>&1

3. If the application is already deployed and you do not want to use the JSP Batch compiler, you can modify the configuration file to do the same as in step 1, above

a. Edit the ibm-web-ext.xmi located in WEB-INF file for the installed Web application.
    Edit file in:- WebSphere_Home/config folder
b. Add the line as shown below, indicated by bold and underline, after the webApp element in the same file:

<webappext:WebAppExtension xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:webappext="webappext.xmi"
xmlns:webapplication="webapplication.xmi"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmi:id="WebAppExtension_1"
reloadInterval="3"
reloadingEnabled="true"
additionalClassPath=""
fileServingEnabled="true"
directoryBrowsingEnabled="false"
serveServletsByClassnameEnabled="true">
<webApp href="WEB-INF/web.xml#WebApp"/>
<jspAttributes xmi:id="JSPAttribute_1"
name="keepgenerated" value="true"/>
</webappext:WebAppExtension>

4. Enable trace log on WAS.

For WAS V7.0:

*=info:com.ibm.ws.webcontainer*=all:
com.ibm.wsspi.webcontainer*=all:
HTTPChannel=all:GenericBNF=all:
com.ibm.ws.jsp=all