Wednesday, June 9, 2010

Large SAP BAPIs failing with java.lang.OutOfMemoryError

OutOfMemory errors are commonly seen while processing large BAPIs, where XML data returned from the SAP Adapter is huge(eq. >10MB).

While processing the BPEL process either fails at the transform phase with “java.lang.OutOfMemoryError: Java heap space” Or the BPEL process doesn’t instantiate and you see errors like below in the console "java.lang.IllegalStateException: Commit called with no active transaction."


Common log files to be checked for these errors are :


1. OPMN : $ORACLE_HOME\opmn\logs\default_group~oc4j_soa~default_group~1.log

2. OC4J: $ORACLE_HOME\j2ee\OC4J\logs\oc4j\log.xml

3. Adapter : $ORACLE_HOME\adapters\application\config\targetname\logs\jca_xxx.log


Solution:

1. Increase the heap size of server. Modify the opmn.xml and increase the java start-parameters for oc4j_soa. Example: -–Xmx2048M –Xms1024M -XX:MaxPermSize=256M
While processing the BPEL process either fails at the transform phase with “java.lang.OutOfMemoryError: Java heap space” Or the BPEL process doesn’t instantiate and you see errors like below in the console "java.lang.IllegalStateException: Commit called with no active transaction."

Common log files to be checked for these errors are :

1. OPMN : $ORACLE_HOME\opmn\logs\default_group~oc4j_soa~default_group~1.log

2. OC4J: $ORACLE_HOME\j2ee\OC4J\logs\oc4j\log.xml

3. Adapter : $ORACLE_HOME\adapters\application\config\targetname\logs\jca_xxx.log

Solution: 1. Increase the heap size of server. Modify the opmn.xml and increase the java start-parameters for oc4j_soa. Example: -–Xmx2048M –Xms1024M -XX:MaxPermSize=256M

2. Adjust transaction-timeout settings. This can be done at 3 places : syncMaxWaitTime in BPEL Console, transaction-timeout parameter in $Oracle_Home\j2ee\home\config\transaction-manager.xml and transaction-timeout parameter in $Oracle_Home\j2ee\home\application-deployments\orabpel\ ejb_ob_engine\orion-ejb-jar.xml

3. Also set "Audit Trail Logging Level" from BPEL Console to "minimal".

4. Bounce the SOA server for changes to take effect and retest the issue.

No comments:

Post a Comment