Thursday, March 5, 2009

Tips On Troubleshooting Java Exception Stack Traces

1) Collect Exception Details

NOTE: For OA Framework-based pages use FND Diagnostics and Apache logs. For others use any product-specific log files and Apache logs
Set Profile ‘FND: Diagnostics’ to ON. Reproduce the issue to get the Unexpected Exception page. Click the link in the text: "Click [here] for exception details." Save the whole page and review the Exception that starts with ‘### Detail 0 ###’ only.
Set FND Diagnostics Debug logging on (either to-page or to-file) and check the ouput. See
Note 290614.1 -How To Get Log Files In iProcurement, for steps.
Get the Apache error_log and mod_jserv.log files and check for exceptions.


2) Analyze the Exception Stack Trace.
Use the following example to understand which parts are important and useful to determine areas to investigate, potential causes and solutions.

java.lang.NullPointerException at java.lang.String.(String.java:188) at oracle.apps.icx.por.domain.ReqCustom.validateGLAccount(ReqCustom.java:574) at oracle.apps.icx.por.domain.ReqDistribution.customValidateAccount(ReqDistribution.java:2579) at oracle.apps.icx.por.domain.ReqDistribution.validate(ReqDistribution.java:2653) at oracle.apps.icx.por.domain.ReqLine.validateReqDistribution(ReqLine.java:3948) at oracle.apps.icx.por.domain.Requisition.validateReqDistribution(Requisition.java:571) at oracle.apps.icx.por.apps.CreateReq.validateDistribution(CreateReq.java:144) at oracle.apps.icx.por.apps.CreateReq.requisitionAction(CreateReq.java:130) ...

Within this, the key parts to understand would be:
NullPointerException is the Java Error Type being raised.
java.lang.String. is the core (JDK) Java Method which is raising the above error.
validateGLAccount is the Oracle Method that is using the above core Java Method.
ReqCustom.java:574 is the Oracle Class File Name and Line Number that is making the call to the validateGLAccount method.
ReqDistribution.customValidateAccount is the Parent 'class.method' which is calling the above Method, and so forth down the list (child to parent).

3) Check for Similar Issues on Metalink:

Search on the functionality being used and the Java Error Type.
Search on first and second Oracle Class and Method names. Match any hits to the functionality and the failing Line Numbers.
Compare the file versions of any patches to those in the instance. Apply only those patches with later file versions, and on the same eBusiness Suite (eg. 11.5.10) and Procurement Family Pack (eg. FP.J) version. Always check the patch readme.txt for details.
Use background functionality, exception details and debug logfile hints information, to check instance setups and transaction data, as needed.

4) Understand the Common Java Exceptions

NullPointerException - Means a variable referred to in the code is not available (null). E.g. Profile Option may not be set.
NoClassDefFoundError / NoSuchMethodError / IllegalAccessError - Java code file is missing, or invalid reference is used.
OutOfMemoryException - The JVM cannot allocate more memory for use. Check server resources and AutoConfig and jserv.properties configuration.
ClassCastException / NumberFormatException - Incorrect conversion of a data type (e.g. Character to Number)
[StringArray]IndexOutOfBoundsException - Data being used exceeds the code structure being used for it. This commonly occurs from unexpected database results size.


These points can be used as a general guideline while facing java stack traces

1 comment:

tikitodo said...

there are many ways of fix sql database, try this application if you’d like to get better results