Showing posts with label Java. Show all posts
Showing posts with label Java. Show all posts

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

Wednesday, February 4, 2009

How to load all the java files required in an Oracle Applications 11.5.10.2 Instance

- Verify all the java files listed in the adldjava.drv under the location $AD_TOP/admin/driver


Usually for a 11.5.10.2 environment, the following jar files are present.

loadjava asf java/jar asfleadshare.jar

loadjava asg java/jar asgmtran.jar

loadjava csf java/jar csflf.jar

loadjava csf java/jar csflf.jar

loadjava cz java/jar czdb.jar

loadjava eam java/jar eampmsch.jar

loadjava eam java/jar eamwkbch.jar

loadjava ecx java/jar ecxutils.jar

loadjava fnd java/3rdparty/stdalone xmlparserv2.zip

loadjava fnd java/jar fndsec.jar

loadjava ibe java/jar ibeeos.jar

loadjava ieu java/jar ieutrans.jar

loadjava inv java/jar invdbtrx.jar

loadjava pay java/jar payproc.jar

loadjava pay java/jar payutil.jar

loadjava per java/jar perimage.jar

loadjava per java/jar perkpiclient.jar

loadjava wms java/jar wmscrtzn.jar

loadjava xtr java/jar xtrintrp.jar


- run adadmin and select the following options

- Generate JAR files

- Generate Applications Files menu

- Generate product JAR files

Answer "YES" when "Do you wish to force regeneration of all jar files? " is asked


- Reload those JAR files

- Under adadmin, select the following options

- Compile/Reload Applications Database Entities menu

- Reload JAR files to database

This will load the jar files listed in $AD_TOP/admin/driver/adldjava.drv


- Verify the loaded java objects using the query


select count(*) from dba_objects where owner = 'APPS' and object_type like '%JAVA%';


- Reload following jar files manually since they are not loaded by adadmin, according with the output of the $AD_TOP/admin/driver/adldjava.drv


cd $IAS_ORACLE_HOME

. ../.env

loadjava -user apps/apps -v -force -resolve $CSF_TOP/java/jar/csflf.jar

loadjava -user apps/apps -v -force -resolve $CZ_TOP/java/jar/czdb.jar

loadjava -user apps/apps -v -force –resolve $EAM_TOP/java/jar/eampmsch.jar

loadjava -user apps/apps -v -force -resolve $EAM_TOP/java/jar/eamwkbch.jar

loadjava -user apps/apps -v -force -resolve $ECX_TOP/java/jar/ecxutils.jar

loadjava -user apps/apps -v -force -resolve $ECX_TOP/java/jar/ecxprocess.jar

loadjava -user apps/apps -v -force -resolve $FND_TOP/java/3rdparty/stdalone/xmlparserv2.zip

loadjava -user apps/apps -v -force -resolve $FND_TOP/java/jar/fndcct.jar

loadjava -user apps/apps -v -force -resolve $INV_TOP/java/jar/invdbtrx.jar

loadjava -user apps/apps -v -force -resolve $INV_TOP/java/jar/invlabel.jar

loadjava -user apps/apps -v -force -resolve $ITG_TOP/java/jar/itgv1.jar

loadjava -user apps/apps -v -force -resolve $JTF_TOP/java/jar/jtfaoljdepen.zip

loadjava -user apps/apps -v -force -resolve $PER_TOP/java/jar/perimage.jar

loadjava -user apps/apps -v -force -resolve $PER_TOP/java/jar/perkigfclient.jar

loadjava -user apps/apps -v -force -resolve $PER_TOP/java/jar/perkpiclient.jar

loadjava -user apps/apps -v -force -resolve $WMS_TOP/java/jar/wmscrtzn.jar

loadjava -user apps/apps -v -force -resolve $XTR_TOP/java/jar/xtrintrp.jar


- Remove the classes comes with $PAY_TOP/java/jar/payproc.jar - These classes should not be in the database and they are not in the fresh database either :


dropjava -user apps/apps -verbose $PAY_TOP/java/jar/payproc.jar


- Run adadmin and select "compile APPS schema" option to validate all the invalid objects and verify if any invalid JAVA Objects left using sql below, there shouldn't be any.


select object_type, dbms_java.longname (object_name), status

from dba_objects

where owner = 'APPS'

and object_type like '%JAVA%' order by 1,2,3;