IBM Support

Cognos ICM Web - Tomcat web server responds with a 500 HTML code when a web form is requested in the browser

Technote (troubleshooting)


Problem(Abstract)

When JVM is parsing the Java code to generate the output, depending on the number of objects instantiated and used, the memory heap can reach the maximum amount (threshold) defined at startup.

Symptom

User logs in the Web Portal and tries to access a complex web form.
When generating the web form HTML output, the Java Virtual Machine (JVM) goes out of memory, and a “HTML 500” error code is displayed to the user, along with a Java error message:

java.lang.OutOfMemoryError: Java heap space

java.io.CharArrayWriter.write(Unknown Source)
java.io.PrintWriter.write(Unknown Source)
com.opensymphony.module.sitemesh.filter.RoutablePrintWriter.write(RoutablePrintWriter.java:144).

Cause

When JVM is parsing the Java code to generate the output, depending on the number of objects instantiated and used, the memory heap can reach the maximum amount (threshold) defined at startup.

Environment

Web Portal application deployed on Apache Tomcat web server, running or Windows or Linux

Diagnosing the problem

Tomcat will output the full exception list, along with a root cause message, when this kind of issue manifest.
The error message would look similar to:

HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
Exception
org.apache.jasper.JasperException: javax.servlet.ServletException: java.lang.OutOfMemoryError: Java heap space
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:522) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:398)
….
root cause
java.lang.OutOfMemoryError: Java heap space
java.io.CharArrayWriter.write(Unknown Source)
java.io.PrintWriter.write(Unknown Source)
com.opensymphony.module.sitemesh.filter.RoutablePrintWriter.write(RoutablePrintWriter.java:144)
….
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.16 logs.

Resolving the problem

The JVM has to be closed and started with new memory thresholds parameters.
Because starting and stopping JVM is usually done by executing a shell script or a bat file, edit the start-stop script and add the following parameters in the startup line:

-Xms<Initial JVM Memory size> -Xmx<Maximum JVM Memory size>

Example of starting JVM with an initial heap memory size of 512M that can be auto extended to 1024M:

-Xms512M -Xmx1024M

Locating the startup options:

- If running Tomcat as a Windows service, check the Apache feather icon in the systray (or when absent, run Monitor Tomcat from the start menu). Doubleclick the feather icon and go to the Java tab. There you can configure the memory parameters

- If running Tomcat on Linux, locate the script “catalina.sh” and add the flags above

Document information

More support for: Cognos Incentive Compensation Management
Cognos Incentive Compensation Management

Software version: 7.0.4, 7.1.1, 7.2.1, 7.3.0, 8.0, 8.0.1

Operating system(s): Windows

Software edition: All Editions

Reference #: 1636851

Modified date: 10 May 2013


Translate this page: