Showing posts with label SOA 10g. Show all posts
Showing posts with label SOA 10g. Show all posts

Tuesday, September 8, 2009

Oracle ESB 10.1.3.4 ConsoleTransactionException

While starting Oracle SOA instance, all ESB services are not getting started & refreshed before orabpel service starts. When this happens no service can be accessed from the Oracle ESB and the following exception is sighted in the ESB Console.

An unhandled exception has been thrown in the ESB system. The exception reported is: "oracle.tip.esb.console.exception.ConsoleTransactionException: File repository not initialized.May be ESB bootstrap failed Please review ESB prameters for their correctness. at oracle.tip.esb.console.XMLConsoleManagerImpl.commit(XMLConsoleManagerImpl.java:2317) at oracle.tip.esb.console.XMLConsoleManagerImpl.deleteSystem(XMLConsoleManagerImpl.java:637) at oracle.tip.esb.configuration.servlet.command.DeleteSystemCommand.execute(DeleteSystemCommand.java:34) at oracle.tip.esb.configuration.servlet.CommandServlet.doJob(CommandServlet.java:109) at oracle.tip.esb.configuration.servlet.CommandServlet.doPost(CommandServlet.java:76) at javax.servlet.http.HttpServlet.service(HttpServlet.java:763) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64) at oracle.security.jazn.oc4j.JAZNFilter$1.run(JAZNFilter.java:400) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAsPrivileged(Subject.java:517) at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:414) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:623) at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370) at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871) at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453) at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:313) at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:199) at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260) at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303) at java.lang.Thread.run(Thread.java:595) ".
One of the solution to overcome this issue is to ensure that the ESB services are getting started successfully before orabpel service starts. One can follow the following steps to overcome this issue;

1. Login to the 'Application Manager' (em console) and stop the orabpel service under oc4j_soa. Ensure that the hw_service is also stopped.
2. Now change to the \opmn\bin directory via command prompt and issue the following command
opmnctl stopall
3. Once all services are stopped, issue the following command to start all services
opmnctl startall
4. Login back to the Application Manager console and start the orabpel service under oc4j_soa instance

Now, things should work fine.

Wednesday, September 2, 2009

Oracle ESB org.apache.slide.structure.ObjectNotFoundException

"org.apache.slide.structure.ObjectNotFoundException" exception is thrown in ESB console during runtime. This error occurs when ESB artifacts are developed on JDeveloper and moved from one workspace to another. The JDeveloper will not be able to eventually update the file locations in the related artifacts when the project is moved from one application/workspace to another.

Detailed Error Description: (As logged in ESB Error Trace)

Error occured while transforming payload using XSL "esb:///ESB_Projects/Application1_***/***.xsl". Reason : Could not load XSL transform into the cache for XSL/XSLT "esb:///ESB_Projects/Application1_***/***.xsl"! Reason : org.apache.slide.structure.ObjectNotFoundException: No object found at /files/ESB_Projects/Application1_***!

Solution:
DO NOT move the ESB projects to a different JDeveloper workspace, as this is not supported by Oracle ESB (till 10.1.3.4)

Wednesday, May 27, 2009

Import DVM using Java-Ant

While writing an Ant build script to deploy the BPEL/ESB processes, it became absolutely important to deploy/import the DVMs automatically using Ant build scripts. While surfing thru the web, I came across a piece of Java code that will accomplish this task. I have made few enhancements to the code which will dynamically get the DVM file details from a property file for import.

Pre-Requisites:

1. You will need to import the commons-codec-1.3.jar available in the SOA suite ($SOA_Home\Integration\esb\lib)
2. Download the commons-httpclient-3.1.jar from the internet (Any older version will throw errors!)
3. Import commons-logging.jar from $SOA_Home\Integration\esb\lib folder

Functional Aspects:

a.) The following piece of code will use a property file called ImportDVM.properties which will contain the dynamic parameters such as hostname, port number, username, password and more importantly the dvm file(s) location

b.) Multiple DVM files can be imported at a time by providing a comma (,) separated list of DVM file locations for the "dvm" parameter in the properties file

Java Source Code:

import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.InputStream;
import java.util.Properties;
import java.util.StringTokenizer;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.methods.multipart.FilePart;
import org.apache.commons.httpclient.methods.multipart.MultipartRequestEntity;
import org.apache.commons.httpclient.methods.multipart.Part;
import org.apache.commons.httpclient.methods.multipart.StringPart;

public class ImportDVM {
public static void main(String[] args) {
Properties props = new Properties();
try {
InputStream in = Class.forName("ImportDVM").getResourceAsStream("ImportDVM.properties"); // Properties file to define your dynamic parameters
props.load(in);
String esbHost = props.getProperty("hostname");
int esbPort = Integer.parseInt(props.getProperty("port"));
String username = props.getProperty("username");
String password = props.getProperty("password");
String fileLocation = props.getProperty("dvm"); //dvm file location
StringTokenizer st = new StringTokenizer(fileLocation, ",");
while (st.hasMoreTokens()) {
String dvm = st.nextToken();
importDVM(esbHost, esbPort, username, password, dvm);
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
public static void importDVM(String esbHost, int esbPort, String username, String password, String fileLocation) {
try {
InputStream is = null;
HttpClient client = new HttpClient();
int responseCode = 0;
client.getHttpConnectionManager().getParams().setConnectionTimeout(90000);

// Authenticate
String authUrl = "http://"+esbHost+":"+esbPort+"/esb/j_security_check?j_username="+username+"&j_password="+password;
GetMethod auth = new GetMethod(authUrl);
responseCode = client.executeMethod(auth);

// ImportDVM
File targetFile = new File(fileLocation);
PostMethod post = new PostMethod("http://"+esbHost+":"+esbPort+"/esb/esbConfiguration/executeCommand?action=ImportDVM");
post.setRequestHeader("User-Agent", "ESB Client/1.0");
//StringPart s1 = new StringPart("importType","map");
//StringPart s2 = new StringPart("importMode","overwrite");
//FilePart f1 = new FilePart(targetFile.getName(), targetFile);
Part[] parts = {new StringPart("importType","map"), new StringPart("importMode","overwrite"), new FilePart(targetFile.getName(), targetFile)};
System.out.println(Part.getLengthOfParts(parts));
post.setRequestEntity(new MultipartRequestEntity(parts, post.getParams()));
responseCode = client.executeMethod(post);
System.out.println("Response code: " + responseCode);
is = post.getResponseBodyAsStream();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
int c;
while ((c = is.read()) != -1) {
baos.write((char)c);
}
byte[] responseBody = baos.toByteArray();
post.releaseConnection();
String response = new String(responseBody);
System.out.println(response);
} catch (Exception e) {
e.printStackTrace();
}
}
}

Executing from Ant:

So far so good. Now it turns out to be very simple. Just compile the class and call this using the "java" ANT task.
You got a class not found exception huh? Yup, you have forgotten to keep the Java class location in your classpath.

We are now good to go!

Wednesday, April 22, 2009

Customizing BPEL Process Instance Titles

When there were several BPEL process instances getting created in the BPEL console, it often really becomes hard to identify a instance for tracking/debugging purposes. Since, all the BPEL process instances use a generic naming convention consisting of an unique instance id (sequence generated within Oracle BPEL PM) and the BPEL process name; all instances would hold the same name except for the change in instance id.

In order to give a valid instance name for the BPEL processes, you can make use of the setTitle(String str1); method inside a Java Embedding activity inside the BPEL process, which will ensure that the 'str1' parameter is set as the instance title for all instances created for this BPEL process. You can pass dynamic run-time parameters and customize the BPEL instance titles, so that the BPEL instances can be identified more uniquely in a business sense. This also enables easy & effective instance tracking from the BPEL console.

Saturday, March 14, 2009

Lost BPEL Instances? - Use Force Dehydration

There will be many instances when it will be really puzzling to find out whether the BPEL instance was triggered or not, where we often say that the "BPEL instance is lost". Actually, in reality, the BPEL process could have resulted in some kind of exception during the process which gets suppressed completely by the BPEL PM and the instance neither gets persisted or dehydrated in the orabpel schema nor shown up in BPELConsole.

This will be really troublesome, as we will not be able to identify whether the problem lies in the external system driving the BPEL instance or within the BPEL process itself after consumption of data. In such cases, you can use the checkpoint(); Java method inside a Java embedding activity to force the instance to be dehydrated as soon as the instance gets triggered in BPEL. This will ensure that the BPEL instance is shown up in the BPEL console if it is instantiated. You can use the following piece of code in your BPEL process to force dehydration.

<bpelx:exec name="CheckPointOne" language="java" version="1.5">
<![CDATA[checkpoint();]]>
</bpelx:exec>

Now, all your BPEL instances will be available in the BPELConsole for debugging issues that are not actually propagated/thrown to BPELConsole by the OPMN.

However, there are certain drawbacks while using the force dehydration mechanism, as this will cause drop in performance of the BPEL process during run-time due to the additional overhead of persisting the instance whenever this method is called. So please make justified use of this method before using this.

Sunday, February 8, 2009

Oracle BPEL HTTP Server Down after applying patch 10.1.3.3

We have encountered few issues while starting the oracle SOA suite after applying SOA patch 10.1.3.3. The HTTP server was still down after the SOA suite restart.

On analyzing the HTTP_Server~1.log file available under $SOA_Home\opmn\logs, the following error was logged.

Syntax error on line 278 of $SOA_Home/apache/apache/conf/httpd.conf:Cannot load $SOA_Home/apache/apache/modules/apachemoduleossl.dll into server: (127) The specified procedure could not be found

This issue might occur if there are few DLL files pertaining to SSL missing or unavailable for the HTTP server start. If you are not using the SSL advantage, then the quick fix is to comment out the following sections of httpd.conf file (Key in # infront of the line to comment).

<ifdefine>
LoadModule ossl_module modules/ApacheModuleOSSL.DLL
</ifdefine>


# Include the SSL definitions and Virtual Host container

include "D:\product\10.1.3.1\OracleAS_1\Apache\Apache\conf\ssl.conf"

Now, restart the Oracle SOA instance & the Http Server should run.

Tuesday, February 3, 2009

Oracle BPEL Remote Deployment using Ant

In the last post, we have seen how to compile & deploy the Oracle BPEL & ESB processes in the local OAS (Oracle Application Server on SOA Suite 10.1.3.3) using automated Ant build scripts. In this blog, I will try to explain the remote server deployment of Oracle BPEL processes.

This essentially means that we will be able to run the Ant build script on local machine & deploy the compiled code on to remotely located servers on the network. To explain this with a practical scenario, we can have a build server which has the completed build setup with 2 build scripts - One which will run at regular time intervals (Daily) to check for the integrity of builds & another which can be triggered at desired time to deploy on to test environments.

The following segment of code must be added on to the build script which does the remote server deployments.

Step 1:
Download the classes here and place them in the following location;

$Oracle_SOA_Home\bpel\system\classes\com\collaxa\cube\ant\taskdefs

Step 2:
Add the following task definition to your Ant build script.

<taskdef classname="com.collaxa.cube.ant.taskdefs.RemoteDeployOverHttp"
name="deploySuitcase">


Step 3:

Compile all the required BPEL processes, so that the corresponding jar files are generated in the output folders.

Step 4:

Add a target element in the Ant build script as shown below, which takes care of deploying the compiled BPEL processes to the remote Oracle SOA @ the domain specified.

<target name="deploy">
<deploySuitcase host="$host_ip" port="$SOA_port"
domain="default" password="$SOA_pwd">
<fileset dir="${basedir}">
<include name="bpel_Process1_1.0.jar"/>
</fileset>
</deploySuitcase>
</target>

The host_ip, SOA_port, SOA_pwd are parameters that will be extracted from the external properties file during run-time.

The <deploySuitcase> is the custom Ant task which takes care of deploying the jar files of compiles BPEL processes defined within the <fileset> element. You can included any number of BPEL jars that will be deployed to the remote server specified.

Courtesy: Clemen's SOA Blog

Monday, January 12, 2009

Oracle BPEL/ESB Automated Build using Ant

In this post, we will see how to use Apache Ant effectively in compiling & deploying Oracle BPEL/ESB projects. In any SDLC, we come across situations where it becomes very hard to detect the integrity of builds at earlier stages which leads to eleventh hour hiccups.
Ant build scripts comes to the rescue, providing custom tasks for compiling & deploying the Oracle BPEL & ESB projects in the OAS (We will see remote server deployments in subsequent posts).
Think of a script which runs at regular time intervals; say 2300 hrs every day and reports if there are any issues during compilation/deployment time. Wouldn't that be great to see the reports at your sight before getting along with development activities everyday. We made use of an open-source utility called "CruiseControl" for automating the Ant build scripts which we will see how to orchestrate.
Pre-Requisites:
  • Oracle SOA suite 10.1.3.3 installed and configured
  • Apache Ant 1.7.0
  • jaxb 2.0.0
  • commons-httpclient-3.0.1.jar
Identification of BPEL & ESB processes:
Before preparing the Ant build scripts, it is very essential to identify the Oracle BPEL & ESB candidates that would be subject to continuous integration. Also, it is important to capture the order of deployments of these processes.
Wrapper Ant build script:
We can write a wrapper Ant build script which will call the "automatically created" Ant build scripts while creation of BPEL processes & we will leverage the Ant task described in the next section to register ESB projects wherever required.
Compiling & Deploying Oracle BPEL processes:
By default, whenever an Oracle BPEL process is created in JDeveloper, an ant build script will be created which takes care of compiling and deploying that particular BPEL. For orchestrating the automated builds, we will take advantage of these build scripts to continuously integrate the BPEL processes.
Following piece of code shows the process of triggering the process-deploy Ant task available within the BPEL_Process1 BPEL project from the wrapper Ant script.
<target name="BPEL_Process1" description="run BPEL_Process1">
<property name="BPEL_Process1.file.path" value="#Location of BPEL_Process1"/>
<xmlproperty file="${BPEL_Process1.file.path}/bpel/bpel.xml"/>
<echo>Building BPEL_Process1...</echo>
<ant antfile="${BPEL_Process1.file.path}/build.xml" target="process-deploy">
<property name="basedir" value="${process.dir}/${BPEL_Process1.file.path}" />
<property name="process.name" value="BPEL_Process1"/>
</ant>
</target>

Registration of ESB Projects:
Ant comes up with a specialized task for registering the Oracle ESB projects into the SOA server.
1. Extract ESBMetadataMigration.jar from $SOA_Home\Integration\esb\deployment\documentation.zip
2. Modify the following properties in the ESBMetadataMigrationTaskdefs.xml
<project name="ESBMetadataMigrationTaskdefs">
<property name="commons.httpclient.home" value="#commons-httpclient jar location"/>
<property name="jaxb.v2.0.2.home" value="#jaxb jar location"/>
<property name="soa.suite.home" value="#Oracle_SOA_Home"/>
<property name="esb.home" value="#ESBMetadataMigration.jar location"/>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Custom ant task definitions, to enable import. - This section should be treated as immutable upon installation. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<dirname property="imported.basedir" file="${ant.file.ESBMetadataMigrationTaskdefs}"/>
<taskdef resource="oracle/tip/esb/client/anttasks/antlib.xml">
<classpath>
<pathelement location="${esb.home}/ESBMetadataMigration.jar"/>
<pathelement location="${commons.httpclient.home}/commons-httpclient-3.0.1.jar"/>
<pathelement location="${soa.suite.home}/lib/xmlparserv2.jar"/>
<pathelement location="${soa.suite.home}/integration/esb/lib/commons-logging.jar"/>
<pathelement location="${soa.suite.home}/integration/esb/lib/commons-codec-1.3.jar"/>
<pathelement location="${soa.suite.home}/integration/esb/lib/oraesb.jar"/>
<pathelement location="${jaxb.v2.0.2.home}/lib/activation.jar"/>
<pathelement location="${jaxb.v2.0.2.home}/lib/jaxb-api.jar"/>
<pathelement location="${jaxb.v2.0.2.home}/lib/jsr173_1.0_api.jar"/>
<pathelement location="${jaxb.v2.0.2.home}/lib/jaxb-impl.jar"/>
</classpath>
</taskdef>
</project>

3. Import the following config files in your ant build script
<import file="${bpel.home}/utilities/ant-orabpel.xml"/>
<import file="${ESBMetaDataLoc}/ESBMetadataMigrationTaskdefs.xml"/>

4. Final step to register the ESB projects;
<target name="ESB_1" description="run ESB_1">
<echo>Registering ESB_1...</echo>
<deployESBProjects esbMetadataServerHostname="${http.hostname}"
esbMetadataServerPort="${http.port}"
userName="${admin.user}"
password="${admin.password}">
<esbProject directory="${ESB_1.file.path}"/>
</deployESBProjects>
</target>

Configuring CruiseControl:
Now that we have written the wrapper Ant build script to orchestrate the Oracle BPEL/ESB deployments, we can make use of the <target> task to call each of the other targets in the necessary sequence using the 'depends' attribute.
This Ant script can now be made available in the CruiseControl tool which will take care of executing this build script at specified time intervals. config.xml is the CruiseControl configuration file available within the CruiseControl installation directory where we can configure various settings like time of build, mail triggers, reports etc...
A little deep dive into the CruiseControl configurations will allow you to configure css settings, mail templates etc...
Please post your comments if you need clarifications/help which I will try to resolve ASAP.

Thursday, January 1, 2009

Oracle BPEL console throws 'No domains accessible to the user logged in.'

A common issue that is faced in Oracle BPEL development phase by a developer is "No domains accessible to the user logged in." This might be due to several reasons which I will try to elaborate in this blog based on my past experience in resolving this issue.

Check 1:
First checkpoint where we can identify the detail of error description is checking the following log files;
Domain Log: $SOA_Home\bpel\domains\default\logs\domain.log ('default' is the default domain name)
- This log file will be created everytime the SOA service is started and will log any domain level startup issues
OPMN Log: $SOA_Home\opmn\logs\OC4J~oc4j_soa~default_group~1.log
- This log file will log all the BPEL process specific logs (creation/termination)
System Log: $SOA_Home\bpel\system\logs\orabpel.log
- System level logging is provided for infrastructure, AXIS, and WSIF issues

All these log files should give a clear picture about the error which might be causing this issue, based on which you can take necessary actions.

Check 2:
Check whether the database on top of which Oracle SOA suite was installed is up & running. If not, ensure the RDBMS listener is running & restart SOA service.

Check 3:
The Oracle SOA suite will be installed on top of a database (Oracle Lite/external Oracle DB), where three schemas would have been created during installation namely Orabpel, Oraesb, Orawsm. These schemas might have got corrupted (or) their passwords might have got changed which throws "No domains accessible to the user logged in." error in Oracle BPEL console. Ensure all 3 schemas are present in the database and their passwords are intact as specified in the datasources.xml/during installation and restart SOA service after corrections.

Check 4:
If any class files have been added in the SOA suite, ensure they are properly compiled and deployed @ $SOA_Home\bpel\system\classes.

Check 5:
If you have added any custom xpath functions for use in the BPEL process, you might have added entries in the $SOA_Home/bpel/system/config/xpath-functions.xml. Ensure that this file is well formed.

Check 6:
If you have deployed any BPEL process recently after which the Oracle BPEL console throws this error, there might be high chance for issues in the deployed BPEL process.
All deployed BPEL processes will be picked up from the following location. Take backup of the existing processes, delete all entries and then restart SOA service.
$SOA_Home\bpel\domains\default\tmp ('default' is the default domain name)

One or more of the above described checks should resolve this issue.

Monday, December 29, 2008

Dealing Transaction time-out(s) in Oracle BPEL & ESB processes

This post would cover the various transaction timeout properties & configurations of Oracle BPEL/ESB projects that can be of great help mitigating timeout issues during runtime arising due to several performance issues.

We had a synchronous BPEL process which would calculate, extract and generate generic XML content for use by other child BPEL processes, which were designated for various operations. The synchronous BPEL process would be called by main BPEL process which will manage the entire workflow. We had no issues in this process until the XML content generated by the synchronous process was fast & within the transaction time-out limits.

For transactions involving complex logic calculations & huge data extractions, the synchronous BPEL process took plenty of time to respond which resulted in transaction time-outs and the BPEL processes never proceeded to completeness.


To overcome this issue, we increased the transaction time-out parameters which can be configured in the Oracle SOA suite. Please note that the following settings are applicable for Oracle SOA suite 10.1.3.3 advanced installation.....
Config 1:
While introducing receive activity in a BPEL process anticipating a response from an Asynchronous BPEL process after an invoke, if the transaction times out; configure the following setting in the BPEL console which will increase the time-out duration.

This is the maximum time the process receiver will wait for a result before returning. Results from asynchronous BPEL processes are retrieved synchronously via a receiver that will wait for a result from the container.
  • Login to BPEL Console
  • Click on Manage BPEL Domain
  • Update the syncMaxWaitTime property to an increased value (Default is 45 sec) depending on the requirement
Config 2:
Modify the transaction-timeout property in the orion-ejb-jar.xml file available under the following location;
$SOA_Home\j2ee\oc4j_soa\application-deployments\orabpel\ejb_ob_engine\orion-ejb-jar.xml

There will be several session beans available in this config file - all of which should be configured with the same value for the transaction-timeout.
Config 3:

Modify the transaction-timeout property in the transaction-manager.xml file available under the following location;
$SOA_Home\j2ee\oc4j_soa\config\transaction-manager.xml

Please note that this timeout value should be greater than the values configured in Config 1 & 2. In essence this value should be larger than syncMaxWaitTime & transaction-timeout configured in orion-ejb-jar.xml file [Config 2].

Config 4:
While using Oracle Enterprise Service Bus (ESB), there can be transcation timeouts while transacting with other BPEL processes or during deployment of ESB projects via Oracle JDeveloper. For the former, Config 3 would suffice & for the latter, configure the xa_timeout parameter in esb_config.ini located in SOA suite at the following location;
$SOA_Home\integration\esb\esb_config.ini

Note that whenever an ESB initiates a transaction, timeout specified in the esb_config.ini will take precedence.
The above specs are gathered from the following resources;http://download.oracle.com/docs/cd/B31018_01/relnotes.1013/relnotes/esb.htm
http://download-west.oracle.com/docs/cd/B31017_01/integrate.1013/b28981/app_trblshoot.htm#sthref3957