Returning source code line numbers in a Java exception stack
 Technote (troubleshooting)
 
Problem(Abstract)
Information about several methods for returning source code line numbers in a Java exception stack.
 
Cause
IBM Java SDKs use JIT to compile the java code at runtime for improved performance. When an exception occurs in the Java code running in JIT mode, the runtime will fail to write the line number in the printed Exception Stack.

Example: Java Stack for an Exception condition:

Exception thrown : java.lang.NullPointerException
at com.ibm.ws.cache.servlet.ServletWrapper.
prepareMetadataServletWrapper.java(Compiled Code))

at com.ibm.ws.cache.servlet.CacheHook.handleFragment
(CacheHook.java(Compiled Code))

at com.ibm.ws.cache.servlet.CacheHook.handleServlet
(CacheHook.java(Compiled Code))

at com.ibm.ws.cache.servlet.ServletWrapper.service
(ServletWrapper.java(Compiled Code))

at com.ibm.ws.webcontainer.servlet.ServletWrapper.service
(ServletWrapper.java(Compiled Code))

...........................................................................................

 
Resolving the problem
There are multiple ways to debug problems of the type in the example above.
  1. More debug statements can be added to the application code. Application developers need to modify the code and application must be redeployed into the application server.
  2. Disable JIT. This should enable the JVM to print the line numbers for the failing stack. With this option, there may be a significant performance impact. However, this is a quick way to get the line number if performance is not a major concern.
  3. Selectively disable JIT for the failing methods. For this technique, you find the class/methods of interest and configure JVM to disable JIT for those specific classes. For the failing stack in the example above , refer to Selectively disabling JIT options for WebSphere Application Server V3.5, V4.0, V5.0, V5.1 and V6.0 for more information about selectively disabling JIT for the classes of interest.
 
 
Cross Reference information
Segment Product Component Platform Version Edition
Application Servers Runtimes for Java Technology Java SDK
 
 


Document Information


Product categories: Software > Application Servers > Distributed Application & Web Servers > WebSphere Application Server
Operating system(s): z/OS
Software version: 6.0
Software edition:
Reference #: 1223952
IBM Group: Software Group
Modified date: Jan 5, 2007