Showing posts with label BPEL. Show all posts
Showing posts with label BPEL. Show all posts

Thursday, December 6, 2012

ORABPEL-05250 Error

I faced ORABPEL-05250 error during my composite deployment with below message.


[08:54:32 AM] Error deploying archive sca_QueryCommitmentDetailsBRMCommsProvABCSImpl_rev1.0.jar to partition "default" on server soa_server1 [http://myserver:8001]
[08:54:32 AM] HTTP error code returned [500]
[08:54:32 AM] Error message from server:
There was an error deploying the composite on soa_server1: Deployment Failed: Error occurred during deployment of component: QueryCommitmentDetailsBRMCommsProvABCSImpl to service engine: implementation.bpel, for composite: QueryCommitmentDetailsBRMCommsProvABCSImpl: ORABPEL-05250


BPEL Document provides below explanation for error code ORABPEL-05250, but this information is generic and insufficient for analysis.

ORABPEL-05250
severity: 10
type: error
name: Error deploying BPEL suitcase
description: An error occurred while attempting to deploy the BPEL
suitcase file \"{0}\"; the exception reported is: {1}
To rectify this problem, you need to increase the log level and need to analyze the problem from the log file step by step.

Increase loglevel to debug mode.
  • Oracle 10g: default.collaxa.cube.engine.deployment set it to ‘debug’
  • Oracle 11g: oracle.soa.bpel.engine.deployment set it to ‘TRACE:32 (FINEST)’
I used 11g, so referred soa_server1.log and soa_server1.out to debug, after receiving deployment error. I found detailed error message in soa_server1.out as below.



This error got escaped during compilation in Jdeveloper and it was strange partnerLinkType and role in wsdl is proper and it is same as what is provided in .bpel file partnerlink element.
I changed the partnerRole and partnerLinkType name both in .bpel and wsdl file and redeployed the composite. Now no error, problem got resolved.

ORABPEL-05250 error can occur for number of reasons like ‘disk memory full’, ‘XSD / WSDL imports are unavailable or unreachable’ etc., proper analysis of log file will help out in resolving this problem.

Thursday, March 22, 2012

Oracle BPEL configuration settings to handle large payload/document

Processing of big payload in BPEL process may result in following problem.


1) OutOfMemoryError - Increase the java heap size

Refer my previous posts on how to increase the heap.

2) Process hangs with out result - This occurs due to huge number of activities generated during bpel instance processing.

Process hangs due to maximum number of in-memory activities. You may get "Instance not found in datasource" or "Maximum request depth exceeded" errors. Process will also throw 'TimeOut' error for synchronous processes after reaching the tansaction-timeout duration.

To solve this problem, we need to add 'dspMaxRequestDepth' property in $ORACLE_HOME/bpel/domains/default/config/domain.xml file.

This property sets the maximum number of in-memory activities to process within the same request. After processing an activity request, Oracle BPEL Process Manager attempts to process as many subsequent activities as possible without jeopardizing the transactionality of the request. Once the activity processing chain has reached this depth, the instance is dehydrated and the next activity is performed in a separate transaction. The default value is 600 activities.

Please add below set of property elements in domain.xml and restart the server to take effect of the changes. Here in below property, I have set the maximum in-memory activities as 4000.

<property id="dspMaxRequestDepth">
<name>Maximum number of in memory activities</name>
<value>4000</value>
<comment><![CDATA[
This property sets the maximum number of in-memory activities to process within the same request. After processing an activity request, Oracle BPEL Process Manager attempts to process as many subsequent activities as possible without jeopardizing the transactionality of the request. Once the activity processing chain has reached this depth, the instance is dehydrated and the next activity is performed in a separate transaction.
<p/>
If the request depth is too large, the total request time can exceed the application server transaction timeout limit.
<p/>
The default value is 600 activities.
]]></comment>
</property>

3) Time out error - Increase the timeout setting

How to configure timeout setting will come in my next posting.

Sunday, January 29, 2012

Issues and Solutions - Part I

Issue: javax.naming.NameNotFoundException: ejb_ob_engine_DeliveryBeanLocal not found

Solution: InvocationMode property should be removed from bpel.xml or composite.xml, otherwise InvocationMode property should be set in all bpel and esb processes involved in same transaction.

----------------------------------------------------------------------------------------------------------------

Issue: Oracle ESB crossreference, populateXRefRow is not populating the data in xref table


Solution: populateXRefRow doesn't populate the cross reference data if the process is failed, cross reference entry will be rolled back after the process failure. Ensure process gets completed successfully to view the cross reference data.

Sunday, October 23, 2011

How to increase BPEL and ESB log level

BPEL Log:
1. Login to BPEL Console
2. Navigate to link Configuration->Logging
3. At the bottom of the page select ‘All’ in ChangeAll combo box.
4. Goto $ORACLE_HOME/opmn/logs and view default_group~<DOMAIN_NAME>~default_group~1.log file.

ESB Log:
1. Login to EnterpriseManager(em) console
2. Click on <CONTAINER_NAME>-> Administration -> Logger Configuration(GoTo Task) -> Root Logger(+)
3. Set oracle.tip.esb.server.common and oracle.tip.esb.server.service to INFO or lower level
4. Goto $ORACLE_HOME/j2ee/< DOMAIN_NAME >/log/ <DOMAIN_NAME>_default_group_1/oc4j and view log.xml

Friday, July 16, 2010

BPEL Best Practices

-Use Assign activity instead of Transform Activity where ever possible since it take less memory.

–Do not import or add XSD files in a ZIP file into a BPEL project. Always extract the XSD files from a ZIP file before importing them.

–Do not include any special characters in the project name (such as periods). If you do include special characters, errors appear when you attempt to compile your project

–The bpel.xml file content is only read into memory when the file is opened. Therefore, if you change the content of bpel.xml after the file is opened, the changes are not made in memory. After changing the content of the BPEL file, close and reopen the file for the changes to take effect.

–Do not edit the bpel.xml file through a combination of Oracle JDeveloper and a text editor such as Notepad or Wordpad. Use only a single editing environment such as Oracle JDeveloper.

–Do not edit the bpel.xml file, BPEL files, and WSDL files while changing the
design of the process. If you want to edit a file:
1. Ensure that the BPEL files are not being edited in Oracle JDeveloper. If they are being edited (that is, a tab for that file is visible), close it and save changes as needed.
2. Edit the required file and save the changes

–Oracle BPEL Process Manager does not support SOAP-encoded arrays.(soapenc:arrayType).
Use one of the following workarounds:
* Apache Axis supports document-literal style services. This means you can change the service to not use soapenc:arrayType.
* A wrapper can be placed around the service (also using Apache Axis) so that the BPEL process talks to the document literal wrapper service, which in turn calls the underlying service with soapenc:arrayType.
* Call a service with soapenc:arrayType from BPEL, but construct the XML message more manually in the BPEL code. This enables you to avoid changing or wrapping the service. However, each time you want to call that service from BPEL, you must take extra steps

–If you use large binary attachment files in SOAP messages with Oracle Database Lite, your BPEL process may not complete processing, which can cause you to run out of system memory. Oracle Database Lite is largely for testing purposes. To use large binary attachment files in SOAP messages, use an Oracle Database as your dehydration store

–Use TCP tunneling to view SOAP messages exchanged between the BPEL process flow and the Web service (including those containing the
correlation ID). You can see the exact SOAP messages that are sent to, or received from, services with which a BPEL process flow communicates.

–Instead of manually entering an expression, you can press Ctrl and then the space bar in the Expression field. Scroll through the list of values that appears and double-click the value you want. Edit the value as necessary. As you enter information, a trailing slash can appear. This means you are being prompted for additional information. Either enter additional information, or press the Esc key and delete the trailing slash to complete the input of information.

–Do not copy and paste the expression syntax shown in this document into Oracle JDeveloper. This is because the single and double quotation marks are sometimes not compatible with Oracle JDeveloper. Instead, use the Expression Builder window or press Ctrl and then the space bar to use the XPath Building Assistant.

–When you deploy a process with the same name and version, you are prompted to overwrite the currently-deployed BPEL process or deploy to a new version number. The best practice is to always deploy to a new version (as described in this tutorial). Redeploying a process with the same version can have consequences, such as instances being marked as stale.

Monday, May 17, 2010

Invoke BPEL using Java API

This article helps you in kick start of creating your own BPEL console or automate program to do certain activities which BPEL console can perform.

All the operations performed in BPEL console can be created using the java API.

BPEL processes can be invoked using a Java API. The API will differ depending upon the type of operation involved. One way operation has an input message without result. Two way operations send and receive the message.

Refer Java API : http://download.oracle.com/docs/cd/B31017_01/integrate.1013/b28986/toc.htm

Note: orabpel.jar files should be added in the classpath


package com.bpel.client;

import com.oracle.bpel.client.*;
import com.oracle.bpel.client.dispatch.*;

import java.util.Map;
import java.util.Properties;


public class InvokeBPEL
{

/**
*
* @author Ziaur Rahuman S
*/
public static void main(String[] args)
{

Properties props = new Properties();

props.setProperty("orabpel.platform", "ias_10g");
props.setProperty("java.naming.factory.initial",
"com.evermind.server.rmi.RMIInitialContextFactory");
props.setProperty("java.naming.provider.url",
"opmn:ormi://hostname:6003:oc4j_soa/orabpel");
props.setProperty("java.naming.security.principal", "oc4jadmin");
props.setProperty("java.naming.security.credentials", "oc4jadm1n");
props.setProperty("dedicated.connection", "true");


String xml = "<SyncHelloWorldProcessRequest><input>World</input></SyncHelloWorldProcessRequest>";

try {
// Create instance of Locator object with domain name and password as arguement
Locator locator = new Locator("ocoetest", "oc4jadm1n", props);
IDeliveryService dService = (IDeliveryService) locator.lookupService(IDeliveryService.SERVICE_NAME);

// Create normalized message with payload
NormalizedMessage nm = new NormalizedMessage();
nm.addPart("payload", xml);

// Invoke two way operation
NormalizedMessage response = dService.request("SyncHelloWorld","process",nm);
Map payload = response.getPayload();

// Invoke one way operation
//dService.post("AsyncHelloWorld","initiate",nm);

System.out.println("SyncHelloWorld Invoked Successfully !!!");

} catch (Exception e)
{
e.printStackTrace();
}


}
}


Friday, April 23, 2010

Java program to get the input xml/receive data from bpel instance

This java program helps in recover the input message for the given set of instances. The BPEL process name and instance id should be given as input in the instances.txt file as shown below.

SyncHelloWorld=370001
SyncHelloWorld=370002

BPELInstance.java

package client;

import com.oracle.bpel.client.IBPELDomainHandle;
import com.oracle.bpel.client.IInstanceHandle;
import com.oracle.bpel.client.Locator;
import com.oracle.bpel.client.ServerException;
import com.oracle.bpel.client.util.WhereCondition;

import java.io.File;
import java.io.IOException;
import java.io.StringWriter;

import java.util.Properties;
import java.util.Scanner;

import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;

import oracle.xml.parser.v2.XMLDocument;

import org.w3c.dom.NodeList;


public class BPELInstance {
public static void main(String[] args) throws ServerException,
IOException {
try {

Properties props = new Properties();
WhereCondition whCnd;
String processName;
Locator locator;
int value;

props.setProperty("orabpel.platform", "ias_10g");
props.setProperty("java.naming.factory.initial",
"com.evermind.server.rmi.RMIInitialContextFactory");
props.setProperty("java.naming.provider.url",
"opmn:ormi://hostname:6003:oc4j_soa/orabpel");
props.setProperty("java.naming.security.principal", "oc4jadmin");
props.setProperty("java.naming.security.credentials", "password");
props.setProperty("dedicated.connection", "true");

locator = new Locator("default", "password", props); // Provide the domain name and password
System.out.println("Connected to the Server");
File fFile =
new File("C:\\Zia\\Automation\\Client\\instances.txt");
Scanner scanner = new Scanner(fFile);
IBPELDomainHandle domain = locator.lookupDomain();
while (scanner.hasNextLine()) {
Scanner scanner1 = new Scanner(scanner.nextLine());
scanner1.useDelimiter("=");
if (scanner1.hasNext()) {
processName = scanner1.next();
value = Integer.parseInt(scanner1.next());
//System.out.println("ProcessName = " + processName + " Instance = " + value);
WhereCondition whereProcessId =
new WhereCondition("process_id = ?");
whereProcessId.setString(1, processName);
whCnd = new WhereCondition("cikey = ?");
whCnd.setInt(1, value);
whereProcessId.append("and").append(whCnd);

IInstanceHandle instances[] =
locator.listInstances(whereProcessId);
if (instances != null && instances.length > 0) {
System.out.println("*** Recovering " + processName +
"[" + value + "] ***");
String auditTrail = instances[0].getAuditTrail();
//System.out.println("\n\n"+auditTrail);
XMLDocument xmlDoc =
Utility.getXMLDocumentFromString(auditTrail);
if (xmlDoc != null) {
NodeList nodeList =
xmlDoc.selectNodes("//details[@id]");

if (nodeList != null) {
System.out.println("@@@@@@@@@" +
nodeList.getLength() +
"@@@@@@@@@");
if (nodeList.getLength() > 0) {
System.out.println("### Getting the data from AuditDetails ###");
String auditDetails =
instances[0].getAuditDetails(0);
System.out.println(auditDetails);
} else {
System.out.println("### Getting the data from AuditTrail ###");
XMLDocument xmlDoc1 =
Utility.getXMLDocumentFromString(Utility.getNodeValueByXPath(xmlDoc,
"/audit-trail/event/details/text()"));
NodeList nl =
xmlDoc1.getDocumentElement().getElementsByTagName("part");
StringWriter sw = new StringWriter();
Transformer serializer =
TransformerFactory.newInstance().newTransformer();
serializer.transform(new DOMSource(nl.item(0).getFirstChild()),
new StreamResult(sw));
String result = sw.toString();
System.out.println(result);
}
}
//System.out.println("******************* End Recovery Steps ***********************");
}
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
}

Output

Connected to the Server
*** Recovering SyncHelloWorld[370001] ***
@@@@@@@@@0@@@@@@@@@
### Getting the data from AuditTrail ###
<?xml version="1.0" encoding="UTF-8"?>
<ns1:SyncHelloWorldProcessRequest xmlns:ns1="http://xmlns.oracle.com/SyncHelloWorld">
<ns1:input>JavaTest</ns1:input>
</ns1:SyncHelloWorldProcessRequest>
*** Recovering SyncHelloWorld[370002] ***
@@@@@@@@@0@@@@@@@@@
### Getting the data from AuditTrail ###
<?xml version="1.0" encoding="UTF-8"?>
<ns1:SyncHelloWorldProcessRequest xmlns:ns1="http://xmlns.oracle.com/SyncHelloWorld">
<ns1:input>OracleSoaTest</ns1:input>
</ns1:SyncHelloWorldProcessRequest>