Wednesday, December 22, 2010

XSL Refresh 10g

It is always good practice to have all XSD outside the BPEL and ESB project and refer them via http url (or oramds in 11g). All XSL remains in the BPEL or ESB, and changes to XSL requires redeployment.

We have lot of logic in XSL especially in AIA, and lot of XSL can be reused. We thought of exploring the option of doing real time changes to XSL.

Option 1: XSL embedded in BPEL process
If XSL is embedded in BPEL process, the XSL is cached inside the transformation engine. Fortunately, XSL function used by BPEl and ESB provides ways to initialize the cache. com.collaxa.cube.xml.xpath.functions.xml.GetElementFromXSLTFunction provide initializeCache function. So if you deploy a Java class in the same JVM as BPEL RT, then it can call this method and reinit the XSL cache. I did the same, created a Java class which calls GetElementFromXSLTFunction initializeCache and then exposed that piece of code as a WebService.

Here are detailed steps:
  • (one time) Deploy the the XSL Refresh web service (download) to same container as BPEL
  • Change the XSL from $ORACLE_HOME/bpel/domains/domain-name/tmp/.bpel.../.. as your need
  • go to: http://host:port/XSLTRefresh/RefreshXSLTPoolSoapHttpPort and hit invoke
This will ensure that new XSL changes will be in effect immediately. This approach came quite handy during development phase as I could avoid redeploying AIA processes for XSL changes and could have better turn around. Option 2: XSL on Apache Server I think cleaner way would be to Putting XSLs outside the BPEL project and deploy them separately from the BPEL and ESB deployment. E.g.
<from expression="ora:processXSLT('http://host:7777/xsl/Transform_IP_OP_Sample.xsl',bpws:getVariableData('inputVariable','payload'))"/>


BPEL XSL engine doesn't cache the XSL handle if it is http based, but you can use the xsl refresh webservice if you see any issue depending on BPEL version you are using.

Tuesday, December 21, 2010

IE8 with Oracle ESB 10g

We were having issue with ESB console when we upgraded from IE6 to IE8 browser. BPELConsole/AIA/OWSM Console just worked fine with IE8. If you use 10.1.3.5+, I think this issue is fixed, but for lower version of Oracle ESB you can use following to make it compatible with IE8 browser.

For ESB Console:

- Modify following files:

esb-dt-container\applications\esb-dt\esb_console\esb\widgets\InstancesView.js and
esb-dt-container\applications\esb-dt\esb_console\picasso\widgets\widgets.Perspective.js

- In these files look for a line this.myEvents = [""] and comment this line out with "//"

Wednesday, December 15, 2010

How to check JDBC driver version

Oracle Support Note: 396187.1 provides instructions on how to install a sample web application to test the database driver. It works great, and it is pretty simple process as shown below:

1) download drvtest.ear from the Oracle support
2) Deploy it desired container
3) Goto http://:/drvtest/dbdetails.jsp
enter username/password/url
it provide information like below:

JDBC Driver details
=============
JDBC Driver Name is ........ Oracle JDBC driver
JDBC Driver Version is ..... 10.1.0.5.0
JDBC Driver Major Version is 10
JDBC Driver Minor Version is 1
=============
Database Details
=============
Database Product Name is ... Oracle
Database Product Version is Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options



I found couple of issues with drvtest.ear file which forced me to write another sample app:
1. This application opens connection and doesn't close
2. This application is struts based and causes problem when you deploy oc4j_soa container (at least in 10.1.3.3.x). It works fine on other container
3. Some time you want to use data source instead of direct connection

I decompiled the code and modified for my need, and it was very easy to expose that piece of java code as web service and provide two separate operations:

InitialContext initialContext = new InitialContext();
DataSource dataSource = (DataSource) initialContext.lookup(dataSourceName);
connection = dataSource.getConnection();
DatabaseMetaData meta = connection.getMetaData();



1. You can deploy the CustomDriverTest.ear to any oc4j container
2. Goto http://host:port/CustomDriverTest/DriverCheckService?WSDL or http://host:port/CustomDriverTest/DriverCheckService
it provides both operation - test by direct database connection or test by data source.
3. It certainly closes connection after providing db information

JDBC Driver Upgrade for SOA/AIA 10g

Oracle SOA suite comes with 10.1.0.5 version of JDBC driver, which is pretty old I believe. If you are using newer version of database, it is worth upgrading the JDBC driver of SOA Suite or AIA to the database version you are using.

If you are using 11g database, then 11g version of database driver does cause some problem with AIA console and EBS WF_Event complex payload, but as long as 10g version is concerned it is quite easy migration.

For instance, we were using 10.2.0.5 version of database and wanted to upgrade to 10.2.0.5 JDBC drivers:

1. Download 10.2.0.5 specific JDBC drivers from below
http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html

2. Copy all jar files to $ORACLE_HOME/JDBC10205/lib directory

3. Add following to $ORACLE_HOME/j2ee/CONTAINER_NAME/config/server.xml:

    <shared-library name="oracle.jdbc" version="10.2.0.5">
<code-source path="/aiaapp/oracle/product/10.1.3.1/OracleAS_1/JDBC10205/lib/classes12.jar"/>
<code-source path="/aiaapp/oracle/product/10.1.3.1/OracleAS_1/JDBC10205/lib/classes12_g.jar"/>
<code-source path="/aiaapp/oracle/product/10.1.3.1/OracleAS_1/JDBC10205/lib/classes12dms.jar"/>
<code-source path="/aiaapp/oracle/product/10.1.3.1/OracleAS_1/JDBC10205/lib/classes12dms_g.jar"/>
<code-source path="/aiaapp/oracle/product/10.1.3.1/OracleAS_1/JDBC10205/lib/ojdbc14.jar"/>
<code-source path="/aiaapp/oracle/product/10.1.3.1/OracleAS_1/JDBC10205/lib/ojdbc14_g.jar"/>
<code-source path="/aiaapp/oracle/product/10.1.3.1/OracleAS_1/JDBC10205/lib/ojdbc14dms.jar"/>
<code-source path="/aiaapp/oracle/product/10.1.3.1/OracleAS_1/JDBC10205/lib/ojdbc14dms_g.jar"/>
<code-source path="/aiaapp/oracle/product/10.1.3.1/OracleAS_1/j2ee/home/lib/ojms-provider.jar"/>
<code-source path="/aiaapp/oracle/product/10.1.3.1/OracleAS_1/jdbc/lib/ocrs12.jar"/>
<code-source path="/aiaapp/oracle/product/10.1.3.1/OracleAS_1/opmn/lib/ons.jar"/>
<code-source path="/aiaapp/oracle/product/10.1.3.1/OracleAS_1/rdbms/jlib/aqapi.jar"/>
<import-shared-library name="oracle.dms"/>
<import-shared-library name="oracle.gdk"/>
</shared-library>


4. Change $ORACLE_HOME/j2ee/CONTAINER_NAME/config/system-application.xml file:
(add : min-version="10.2.0.5)
    <import-shared-library name="oracle.jdbc" min-version="10.2.0.5"/>



5. bounce the server

6. check the driver version (http://chintanblog.blogspot.com/2010/12/how-to-check-jdbc-driver-version.html)

Thursday, December 2, 2010

OPMN Ping timeouts

I did this exercise quite a while ago and thought of posting as I encountered this issue again. Basically, opmn manages all containers and does health check. It can restart the container if container doesn't respond in timely fashion. In opmn log file, it shows up as : [libopmnoc4j] Forcefully Terminating Process. During heavy load or temporary network failure, this is not desired behavior so it is better to control and fine tune such parameters.

It is pretty scattered documentation on different parameters, so thought of putting them together. OPMN algorithm documentation can be found at :

By default opmn just comes with stop/start and restart timeout, which are used just during start/stop and restart as name suggest, but the run time algorithm uses different ping parameters:

Different ping option from OPMN
1. OS Process Check: Every 2 seconds OPMN queries the OS with the managed process id to see if it has terminated.
2. Forward Ping: Periodically, 20 seconds by default, OPMN sends a ping message to the managed process and expects a result within 20 seconds.
3. Reverse Ping: Every 20 seconds managed process sends OPMN a ping notification.

Forward ping can be fine tuned with ping attribute in opmn.xml
Reverse ping can be set using "reverseping" parameters in opmn.xml