Sunday, February 22, 2009

Load XSL at runtime on the fly

While working for a project objective, we had lots of stylesheet (XSLT) files in the BPEL processes, which underwent frequent modifications. The XSL files were created and stored under a common folder inside the BPEL process, which required deployment of the BPEL process everytime we made changes to the stylesheets.

This seemed very bad and time consuming, as we were compiling and deploying the entire BPEL process even for the smallest change in the stylesheet. Then I found a solution where the BPEL process would be made to pick up / load the stylesheet during runtime which will be stored at some physical location under the $SOA_Home accessible via a http URL.

By dynamically constructing the http URL in the BPEL process, the BPEL process was able to load the stylesheets dynamically thereby eliminating the tight coupling between the stylesheet configuration & BPEL process.

# Create a folder called "xsl" (user-defined) under the following location;
$SOA_Home\bpel\system\xmllib

# Place all your XSLT files under the xsl folder

# Construct the dynamic HTTP URL as shown below for this folder location in your BPEL process

1. Create a copy operation under the Assign activity which will construct and store the http URL for the xsl folder, and assign the value to a variable; say xsl_variable
concat(substring-before(ora:getProcessURL(),ora:getDomainId()),'xmllib/xsl/',bpws:getVariableData('stylesheet1'))
2. Pass this variable (In this example xsl_variable) as the first parameter to the ora:processXSLT() function

After the above said modifications are performed, the stylesheets can be modified and copied into the xsl folder which will be loaded & transformed by the BPEL processes on the fly.

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