Escolar Documentos
Profissional Documentos
Cultura Documentos
Applies to:
SAP Enterprise Portal 6.0 onwards. For more information, visit the Portal and Collaboration homepage.
Summary
This article explains how to analyze the root cause for the Portal Runtime Error in portal applications. It
provides a step-by-step guide to locate the line of code that has caused the error.
Author:
Melwyn Monis
Author Bio
Melwyn Monis is a SAP Certified NetWeaver Portal Consultant from L&T Infotech with over 3.5 years of SAP
experience. Has worked in various SAP NetWeaver areas such as Portal, KM, Web Dynpro for Java, Adobe
Forms and VC. Has experience in Btexx easyWCM 2.0 a third party Content Management tool that
provides and manages any service or content within the SAP NetWeaver Portal.
Root Cause Analysis for the Portal Runtime Error in Portal Applications
Table of Contents
Background ......................................................................................................................................................... 3
Assumptions ....................................................................................................................................................... 3
Viewing the Error in the SAP NetWeaver Administrator ..................................................................................... 4
Understanding the JSP Class Concept .............................................................................................................. 5
Locating the Java file .......................................................................................................................................... 5
Step 1 Accessing the Tool ........................................................................................................................... 5
Step 2 Locating the Application ................................................................................................................... 5
Step 3 Fetching the Correct file .................................................................................................................... 6
Step 4 Copying the Source Code ................................................................................................................ 6
Step 5 Finding the Exception in the Source Code ....................................................................................... 7
Conclusion .......................................................................................................................................................... 8
Related Content .................................................................................................................................................. 8
Disclaimer and Liability Notice ............................................................................................................................ 9
Root Cause Analysis for the Portal Runtime Error in Portal Applications
Background
While viewing the output of portal applications at runtime we often come across the Portal runtime error
message on the screen. This error message may indicate either a logical exception or a syntax exception or
some other general exception which has stalled the execution and hence the display of the output. For an
application developer it is now a task of analyzing and resolving the error.
The problem here is, finding out the root cause of the error is not as easy as it seems. The error message
that is displayed on the portal screen is as follows:
It does not provide the line number or cause of the error. To get the details about the exception, one needs
to lookup the error either in the Log Viewer or the NWA.
Assumptions
This article assumes the reader has a good understanding of the following topics and hence will not be a part
of this article:
Usage of the SAP NetWeaver Administrator tool (SAP NWA) / Log Viewer
Root Cause Analysis for the Portal Runtime Error in Portal Applications
The error message displayed in the figure above only provides us with the exception type that has occurred
i.e. java.lang.NullPointerException. It does not provide us with detailed information about the error though.
This is true especially in portal applications containing Java Server Pages (jsp). These are typically portal
applications of type JSPDynPage components.
If an error occurs due to code in the .jsp file, the log file entry does not provide us with the line number in the
jsp code that has caused the error. Instead, it provides the line number of the internally generated files. In
this case _sapportalsjsp_SampleJSP.java file as shown in the above figure.
Root Cause Analysis for the Portal Runtime Error in Portal Applications
Root Cause Analysis for the Portal Runtime Error in Portal Applications
As per the log file entry for the error, we need to use the _sapportalsjsp_SampleJSP.java file. The log file
entry indicates that line nos. 24, 40 and 147 are the lines of code where the exception has occurred.
Step 4 Copying the Source Code
To find the above line numbers click on the view link for _sapportalsjsp_SampleJSP.java. A popup window
will appear which will display the source code of the selected file. However, the source code that is displayed
in the browser window does not contain line numbers.
Root Cause Analysis for the Portal Runtime Error in Portal Applications
Using the highlighted line, you will now be able to identify the root cause of the error. As in the figure above,
it is clear that a Null Pointer Exception occurred due to the fact that an operation was performed on a string
variable containing a null value.
Root Cause Analysis for the Portal Runtime Error in Portal Applications
Conclusion
This technique for finding the root cause of the Portal Runtime Error proves very handy for applications
containing complex JSPs. It can be used to track logical as well as syntax errors. It reduces the effort spent
trying to debug the jsp using print statements and also aids the developer in easily tracing the errors
encountered using standard SAP tools.
Related Content
Log Viewer Basics
Portal Applications
SDN Portal e-Learning Catalog
For more information, visit the Portal and Collaboration homepage.
Root Cause Analysis for the Portal Runtime Error in Portal Applications