Thursday, December 24, 2009

Starting Weblogic after reboot

Here is a (linux) script that can be used during for starting Oracle Weblogic during startup and shutdown of the machine. The script only a framework that is at the various run-levels. The actual code of stopping and starting WLS is in another script (/home/oracle/bin/wls.sh).

Create the folloing script in /etc/init.d (as root)

/etc/init.d/oracle-wls
#!/bin/bash
#
# /etc/rc.d/init.d/oracle-wls
#
# Starts the weblogic environment
#
# chkconfig: 2345 90 10
# description: Oracle-WLS Daemon

# processname: oracle-wls

source /etc/rc.d/init.d/functions

### Default variables
SYSCONFIG="/etc/sysconfig/oracle-wls"

### Read configuration
[ -r "$SYSCONFIG" ] && source "$SYSCONFIG"

RETVAL=0
prog="/home/oracle/bin/wls.sh"
desc="Oracle WLS Daemon"
SU=/bin/su
SHELL=/bin/bash

START_AS_USER=oracle

start() {
echo -n $"Starting $desc ($prog): "
$SU -s $SHELL $START_AS_USER -c "$prog start" > /dev/null 2>&1
RETVAL=$?
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
echo
}

stop() {
echo -n $"Shutting down $desc ($prog): "
$SU -s $SHELL $START_AS_USER -c "$prog stop" > /dev/null 2>&1
RETVAL=$?
[ $RETVAL -eq 0 ] && success || failure
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
return $RETVAL
}

case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
RETVAL=$?
;;
condrestart)
[ -e /var/lock/subsys/$prog ] && restart
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|restart|condrestart}"
RETVAL=1
esac

exit $RETVAL

Make the script known the O/S for the various boot levels (as root):
chkconfig --add oracle-wls  && chkconfig oracle-wls on
You can test the script (as root)

# service oracle-wls stop
Shutting down Oracle WLS Daemon (/home/oracle/bin/wls.sh): [ OK ]

# service oracle-wls start
Starting Oracle WLS Daemon (/home/oracle/bin/wls.sh): [ OK ]

Monday, November 09, 2009

SCA a step forward or a just hype?

When Oracle introduced the new version of the Oracle SOA Suite 11g, it introduced a new abstraction layer, the Service Component Architecture (SCA).

The SCA can be seen from a technical point of view, as a container that holds a set of SOA components. These components interact with each other and can be exposed to the outside world as a service. The components itself can call external services, these are called references.

From functional point of view, the SCA is an abstract object that contains a set of business requirements. These requirements are implemented via the various SOA components and are hidden to the outside world.

The biggest advantage of the SCA, is the way the business can talk to the IT and vice versa. With the introduction of SOA technology a few years ago, the two worlds come together. SCA is the finally the bridge of these two worlds. With SCA the business can talk about their requirements and their information flows that need to be processed and orchestrated. While the IT can listen and map the requirements to the different SCA composites with their SOA components, without having discussions with the business on the implementation.

Earlier I wrote a dutch article when I discussed if SOA itself is a hype. In my opinion it is not. The same applies for SCA. It is a next step in the evolution of integration. Think about when we used technologies such as hub-spoke model, EIS, EAI and technologies such as CORBA etc.

While SCA is relative new, the main discussion on SCA composite, how big or how small we make the SCA. Do we design small SCA composites with a few business requirements or do we design large SCA composites that holds a large number of business requirements. The answer is always in the middle. It depends on the non functional requirements of the customer.

When implementing a green field project based on SCA, the SCA composite can be designed to handle particulare business requirements. Examples are:
  • OrderHandling - handle all the requirements of an order; create/update/change
  • CustomerInfo - Handle all the business requirment of the customer
Aoother view is from technical/implementation view. SCA composite can be designed for handling 'low' level functionality.
  • ProcessNotifications - handle all notifications from and to other systems
  • MaintainCRMInfo - handle all requests to the CRM system; update/delete/query/etc
  • ProcessJMSMessgae - hanle all the message from the vaious JMS queues
Using an existing SOA application to migratie to SCA, the most common approach is to migrate it 1-on-1. This makes every component in your old SOA application an SCA composite. This is the fastest way to by into the SCA world. The next step is to use the benefits of SCA; combine multiple SCA composites into a single composite.

A architectural decision should be made how we build the the SCA. With SOA/SCA it is all about re-usability. Are we designed SCA's based on the business flow or are we desiging SCA's from technical point of view. To goal is to find the correct balance. You want to design a service once and reuse it many times. From that point of view you would build small SCA's. But you could also choose for a large SCA's with multiple services that are exposed to the outside world. But in this case, the SCA is relative large, which increases the maintainability.

What you want is to define and design services and create composites that reference to this services. This will result that the service is designed once and reused many times.

Technically I think this is possible with the Oracle SOA Suite rel 11g, but it needs some hand-craft. We should manually change the composite.xml file and change the references and wiring within the composite. We could also use tools as subversion to create references with composites. This is with the option 'external:'. But again it needs some hand-craft.

The SCA is the next step of making the bridge between business and technology smalleras it already was with SOA, but we are not there yet. I would like to have a SCA 'reference' functionality and also inheritance. I hope that the team of OASIS team will look into this.

Monday, November 02, 2009

SOA 11g; start and stop

Ever wondered why there are no start and stop scripts for your complete domain? So do I :-). There are scripts to stop a single admin server or a managed server, but there is no start and stop all your servers during shut-down or a reboot. You have to create your own. Here are my scripts.

They are straight forward, and split into 3 parts:
  1. Stop WLS servers
  2. Start WLS servers
  3. A script used during boot/shutdown
The start script
This script will start the admin server and the two managed servers; soa_server1 and bam_server1
#!/bin/bash

O=$WLS_HOME/domains/soadomain

echo Starting Admin Server
nohup $O/bin/startWebLogic.sh &

echo sleep 60
sleep 60

echo Starting SOA Server
nohup $O/bin/startManagedWebLogic.sh soa_server1 &

echo sleep 120
sleep 120

echo Starting BAM Server
nohup $O/bin/startManagedWebLogic.sh bam_server1 &

The stop script
This script will stop the servers in the descending order.
#!/bin/bash
O=$WLS_HOME/domains/soadomain

echo Stopping SOA Server
$O/bin/stopManagedWebLogic.sh soa_server1

echo Stopping BAM Server
$O/bin/stopManagedWebLogic.sh bam_server1

echo Stopping the Admin Server
$O/bin/stopWebLogic.sh

The oracle-wls script
This script is used within Linux/Unix environment during start-up or shutdown. You should copy this into /etc/init.d directory.

Then make symbolic links for each Unix run-level to start or to top the WLS environment.

These symbolic links will start the WLS environment.

ln -s /etc/init.d/oracle-wls /etc/rc2.d/S99oracle-wls
ln -s /etc/init.d/oracle-wls /etc/rc3.d/S99oracle-wls
ln -s /etc/init.d/oracle-wls /etc/rc4.d/S99oracle-wls
ln -s /etc/init.d/oracle-wls /etc/rc5.d/S99oracle-wls

These symbolic links will stop the WLS environment.

ln -s /etc/init.d/oracle-wls /etc/rc0.d/K10oracle-wls
ln -s /etc/init.d/oracle-wls /etc/rc1.d/K10oracle-wls

#!/bin/bash
#

# Source fuction library
if [ -f /lib/lsb/init-functions ]
then
. /lib/lsb/init-functions
elif [ -f /etc/init.d/functions ]
then
. /etc/init.d/functions
fi

# Set path if path not set (if called from /etc/rc)
case $PATH in
"") PATH=/bin:/usr/bin:/sbin:/etc
export PATH ;;
esac

RETVAL=0
ORACLE_START_SCRIPT=/home/oracle/bin/startSOA.sh
ORACLE_STOP_SCRIPT=/home/oracle/bin/stopSOA.sh
SU=/bin/su

if [ $(id -u) != "0" ]
then
echo "You must be root to run the configure script. Login as root and then run the
configure script."
exit 1
fi

start() {
echo "Starting Oracle WLS Instance."
$SU -s /bin/bash $ORACLE_OWNER -c "$ORACLE_START_SCRIPT" > /dev/null 2>&1
RETVAL=$?
if [ $RETVAL -eq 0 ]
then
echo
else
echo Failed to start Oracle WLS Instance.
RETVAL=1
fi
return $RETVAL
}

stop() {
echo Shutting down Oracle WLS Instance.
$SU -s /bin/bash $ORACLE_OWNER -c "$ORACLE_STOP_SCRIPT" > /dev/null 2>&1
RETVAL=$?
echo
if [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$LSNR
then
return $RETVAL
fi
}

# See how we were called
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload|force-reload)
stop
start
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|restart}"
exit 1
esac

Wednesday, October 28, 2009

Tuning BPEL and Weblogic 9.2

This article describes how to optimize Oracle BPEL process manager (10.1.3.4) running on Oracle WebLogic Server (9.2).

WebLogic Server

JDK Version

Use the latest SUN Java Virtual Machine. This can be downloaded from the SUN web site, currently JDK5 build 21 is available:

http://java.sun.com/javase/downloads/index_jdk5.jsp


Unpack this JVM into $WLS_HOME/wls and point the admin and managed servers to this new JDK;

$WLS_HOME/user_projects/domains/SOADomain/bin/setDomainEnv.sh

Oracle certification on JVM can be found here:

http://www.oracle.com/technology/software/products/ias/files/oracle_soa_certification_r3_10.1.3_matrix.xls


Memory settings
Configure the heap and memory size correctly. Do not increase the Java Heap size to large. This could lead into swapping or too much overhead in JVM. In general I suggest to set the -Xms and -Xmx equal and make these 1. Leave at least 30% memory for de rest; O/S, Apache...

Garbage collection is happening when the BPEL PM is overloaded with tasks. Full garbage collection will take place. A parameter that influences this behavior a bit, is to reduce the Java stack size. By default the stack size is 512KB. This is for each thread. If you have short running processes, they do not occupy a large stack. You can reduce the stack size. Use the value -Xss128k or even -Xss96k.

The permanent generation holds data needed by JVM to describe objects that do not have an
equivalence at the Java language level. Eg: objects describing classes and methods. Consider setting –XX:MaxPermSize equal to –XX:PermSize to minimize major collections.

If the servers contains multiple CPUs (cores) whe can use aggressive heap JVM flag. This option inspects the machine resources and attempts to set various parameters to be optimal for long-running, memory allocation-intensive jobs.

Summary; set the memory settings to:

-Xms1024m -Xmx1024m -XX: -Xss128k -XX:MaxPermSize=512m -XX:PermSize=512m -XX:+AggresiveHeap

Note; performance tests should be carried to find the optimal values. This is a best practice recommendation.

JTA timeouts
Be default the global transaction time-out period of WLS is set to 90 seconds. In a BPEL PM environment this is to low. Asynchronous processing can run longer before there state is dehydrated. Increase the global JTA time-out to 3600 seconds.

WLS Console -> SOADomain -> Configuration -> JTA

BPEL Process Manager

Dehydration store
In high throughput environments, locks can occur in the database that will hold up the BPEL PM from running. This can be improved by increasing the number actions in data block of the database:
  • alter table CUBE_INSTANCE initrans 16;
  • alter table CUBE_SCOPE initrans 16;
Threads
Per domain the threads can be set that are used for synchronous processing (InvokeThreads) and a-synchronous processing (EngineThreads). By default they are
  • dspInvokeThreads 20
  • dspEngineThreads 30
I would recommend setting these values to the default on all domains.

Note; performance tests should be carried to find the optimal values. This is a best practice recommendation.

Datasources
The connection pool size must be greater than or equal to the sum of the dspMaxThreads property value in Oracle BPEL Control. If you have configured multiple domains, add all dspMaxThreads property values and compare that value with the data source's max-connections value. The default max-connections on WLS is 15.

Maximum DB Connections >= For-Each-Domain(dspInvokeThreads + dspEngineThreads)

Increase the maximum value of the data sources:
  • jdbc/BPELServerDataSourceWorkflow
  • jdbc/BPELServerDataSource

Note: Check also the time-out parameters; Statement Timeout; Maximum Waiting for Connection; Inactive Connection Timeout

Time-out
By default a synchronous process can run for maximum 45 seconds. After this period BPEL PM will mark this instance as failed. Increase this parameter to a higher value. During load test we have seen that this value can be to lows.
Change this time out in the BPEL Admin console.

syncMaxWaitTime 120

BPEL Processes
Any process in the BPEL is dehydrated to the database. There are processes, such as monitoring; auditing or processes that execute simple tasks that are not needed to be dehydrated. This can be achieved by disable dehydration and only dehydrate in case of a failure.
Put in those BPEL process, in their BPEL.XML file the following options:

<configurations>
<property name="inMemoryOptimization">true</property>
<property name="completionPersistPolicy">faulted</property>
<property name="completionPersistLevel">All</property>
</configurations>

Adapters
Make sure that all adapters, database and JMS configuration are using JNDI entries that point to data sources or JMS factories/modules. It is not allowed that they have local connection definitions.

In a cluster environment, you expect that adapters doing the same work on two different nodes might encounter a race condition. So you would like to configure a singleton adapter. This note describes how to do it.

In BPEL.XML file of the polling process:

<activationagents>
<activationAgent className="oracle.tip.adapter.fw.agent.jca.JCAActivationAgent"
partnerLink="JMSRead">
<property name="portType">Consume_Message_ptt</property>
<property name="clusterGroupId">adapterCluster</property>
<property name="clusterAcrossSubnet">false</property>
</activationagent>
</activationagents>

Logging
Reduce the log level in the BPEL console. Most of the logging is set to 'ALL' in this case the default domain, while the Poland domain has the default configuration.

Reducing the logging results in smaller readable log files. If you put everything on ALL, as it is now, you get too much information and some information is only needed for Oracle Support. It is recommended to:


Put everything to INFO

Then set:
default.collaxa.cube.activation DEBUG
default.collaxa.cube.engine.delivery DEBUG
default.collaxa.cube.engine.deployment DEBUG
default.collaxa.cube.services DEBUG
default.collaxa.cube.ws DEBUG
default.collaxa.cube.xml DEBUG

Changes can be applied without restarting the server.

Note: In production environment set the log level to Info and set the audit level to production.

References:

http://download.oracle.com/docs/cd/B31017_01/core.1013/b28942/tuning_bpel.htm
http://orasoa.blogspot.com/2007/01/tuning-bpel-in-nutshell.html
http://download.oracle.com/technology/tech/soa/soa_best_practices_1013x_drop3.pdf
http://puchaanirudh.blogspot.com/2009/01/jvm-tuning-for-soa-suite-applications.html
http://blogs.sun.com/jonthecollector/entry/presenting_the_permanent_generation
http://forums.oracle.com/forums/thread.jspa?messageID=3344909&#3344909
http://forums.oracle.com/forums/thread.jspa?threadID=962571
http://java.sun.com/docs/hotspot/gc5.0/gc_tuning_5.html

Friday, October 23, 2009

Learing Oracle SOA 11g

As I execute SOA 11g training for customers and colleagues in SOA 11g. There is always need to learn Oracle SOA 11g on your own. There are people who just do it, download, install en run. People who read the Oracle documentation and people who are reading external books. On these books is:

Due to my blog, the publisher send me a copy to review this book to find my opinion.

I am always sceptic about books. Apart of the content the book must be handsome, having a good index and printed on nice paper.

I have read the book, I a must say the book is good when you want to start with Oracle SOA 11g and you have experience with SOA, but also when you just want to start with SOA 11g technology.

The book gives you a breadth overview on the SOA 11g components;
  • Service Component Architecture
  • Installation
  • Mediator
  • BPEL
  • Event Driven Network
  • Human Tasks
  • Service Bus
  • Security
  • Adapters
  • Business Activity Monitor
  • Service Data Objects
  • Business-2-Business
Experienced people will read this book very quickly and learn it efficiently. Less experienced people use this book as a guide through the new Oracle SOA 11g technology.

The book contains a lot screen-shots and clear examples. These examples can be download from here. Another nice SOA 11g example application and docs, click here.

One disadvantage... I miss the upgrade chapter. How to migrate from SOA 10g to SOA 11g, but that is described here.

Wednesday, October 07, 2009

FMW SOA 11g and DHCP

During my trainings sessions forFMW SOA 11g, some of the attendees had issues with deploying and / or testing composites. They all had installed FMW SOA 11g on there laptop and used Microsoft Windows XP. We solved this issue by forcing FMW SOA 11g to be listening to localhost.

By default installation of FMW SOA 11g, the weblogic server is listen to any netwrok card (WIreless, Cabled, VMWare, loopback etc...).

To force SOA 11G to listen to local host apply the following settings.

Change in your config.xml file, from the WLS Domain directory, that the Admin server and soa_server the listen adress to localhost (user_projects/domains/soa_domain/config):
      <server>
<name>AdminServer</name>
<listen-address></listen-address>
</server>
<server>
<name>bam_server1</name>
<ssl>
<name>bam_server1</name>
<listen-port>9002</listen-port>
</ssl>
<machine>LocalMachine</machine>
<listen-port>9001</listen-port>
<listen-address></listen-address>
</server>
<server>
<name>soa_server1</name>
<ssl>
<name>soa_server1</name>
<listen-port>8002</listen-port>
</ssl>
<machine>LocalMachine</machine>
<listen-port>8001</listen-port>
<listen-address></listen-address>
</server>

Into:

<server>
<name>AdminServer</name>
<listen-address>localhost</listen-address>
</server>
<server>
<name>AdminServer</name>
<listen-address>localhost</listen-address>
</server>
<server>
<name>bam_server1</name>
<ssl>
<name>bam_server1</name>
<listen-port>9002</listen-port>
</ssl>
<machine>LocalMachine</machine>
<listen-port>9001</listen-port>
<listen-address>localhost</listen-address>
</server>
<server>
<name>soa_server1</name>
<ssl>
<name>soa_server1</name>
<listen-port>8002</listen-port>
</ssl>
<machine>LocalMachine</machine>
<listen-port>8001</listen-port>
<listen-address>localhost</listen-address>
</server>

Replace your local hostname in (user_projects/domains/soa_domain/config):

echo "$1 managedserver1 http://*vijfhuizen*:7001"
...
ADMIN_URL="http://vijfhuizen:7001"

Into
echo "$1 managedserver1 http://*localhost*:7001"
...
ADMIN_URL="http://localhost:7001"

Set the SCA CallbackURLK and serverURL! This is done in the file:

YOUR_SOA_DOMAIN/config/soa-infra/configuration/soa-infra-config.xml
...
<datasourceJndi>jdbc/SOALocalTxDataSource</datasourceJndi>
<txDatasourceJndi>jdbc/SOADataSource</txDatasourceJndi>
<serverURL>http://localhost:8001</serverURL>
<callbackServerURL>http://localhost:8001</callbackServerURL>
<cache-config>
...
Restart the SOA Application Server.

Friday, September 25, 2009

Cold failover (contingency server)

When bringing SOA projects into production one of the questions raises about availability. Not all customers will have a full high available RAC database and high available application server.

One simple solution is to create a cold fail-over scenario. Oracle provides also other mechanisms and solution on high availibility, but in this case I want to explain am simple solution for a Oracle SOA environment. The example is based on Oracle SOA 10g (10.1.3) but the mecahnism/concept could also apply on Oracle SOA 11g .

In this example we have an Oracle SOA suite running on a single server and there is a spare server in place. In case the server is not availble for some reason, we would like to bring up the SOA environment as quickly as possible. This can be done by starting the spare server. That's all.

The spare server should be configured in advantage. This is how to prepare the spare server.

Prerequisites:
  • The spare server has his own IP adres and host name.
  • A virtual hostname is available.
  • The original SOA server is configured with virtual host name.
Preparation:
  • Copy the $ORACLE_HOME from the original server.
  • Execute the script 'chgiphost.sh' in $ORACLE_HOME/chgip/scripts
  • Point virtual hostname to ip adres of the spare server
Fail over:
  • Make sure the original server is down
  • Start the spare server
Restrictions
  • The spare server may NOT be runing while original server is up and vice versa.

Each time when you deploy Java applications to the server (ex. Worklist Application) , you should make a copy of the $ORACLE_HOME from the original server to the spare server. This does not apply for BPEL or ESB (or SCA) while they are stored in the database and retrieved from the database during start-up.

The trick why this simple fail over will work, is the fact it is using a virtual hostname. This hostname is used within the SOA Suite configuration. Further more, we have copied the whole $ORACLE_HOME installation that implies also connection confiugration such as datasources. The only thing we should do is to change the 'hard' IP adress and hostname after the copy with the chiphost.sh script.

Wednesday, September 02, 2009

Oracle SOA Suite 10.1.3.5

A new version of the Oracle SOA Suite is available, version 10.1.3.5. This is a patch release. It can be downloaded here. The list of fixed bugs and new features can be found here (pdf).

A new version of Oracle JDeveloper is also available. This is more or less a patch release to be in sync with Oracle Application Server 10.1.3.5. The bugs fixed are more releated to ADF/Security/BC4J.

Update: This patch only runs on Oracle OC4J application server. There will be a post 10.1.3.5.1 patch set coming that will make the release available for Oracle Weblogic Server 10g.

Tuesday, August 11, 2009

New version of WLS & SOA Available

Oracle WebLogic Server 11gR1 (10.3.2) is now available

OTN

eDelivery
The WLS 11gR1 (10.3.2) product will be surfaced on eDelivery

My Oracle Support
To get WLS 11gR1 10.3.2 Upgrade Installers, got to metalink.oracle.com and select "Patches and Updates".

  • Product or Family (Advanced Search) Product is: "Oracle WebLogic Server"
  • "Release is": "10.3.2.0" (at the very bottom under Oracle WebLogic Server)
  • Select appropriate Platform
  • Additionally, the patch numbers for the WLS 11gR1 (10.3.2) Upgrade Installers are:

  • Patch ID: 9082222 - WLS 11gR1 (10.3.2) Upgrade Installer (win)
  • Patch ID: 9082213 - WLS 11gR1 (10.3.2) Upgrade Installer (linux)
  • Patch ID: 9082202 - WLS 11gR1 (10.3.2) Upgrade Installer (solaris)
  • In Process - WLS 11gR1 (10.3.2) Upgrade Installer (generic)
WLS Documentation
http://download.oracle.com/docs/cd/E15523_01/wls.htm

11gR1 Library
http://download.oracle.com/docs/cd/E15523_01/index.htm

Saturday, August 01, 2009

SOA 11g: Preferences

As we used preferences in BPEL very often, we expeted to use this in 11g as well. But within the BPEL editor and in the SCA editor there is no button to apply preferences. the function ora:getPreference() is available, but were do we apply this preferences.

The solution is there and writtin in:

http://download.oracle.com/docs/cd/E12839_01/integration.1111/e10224/bp_app_deploydesc.htm#SOASE11121

Preferences can be set at composite level and these preferences are defined at particular levels; BPEL, Partnerlink.

To use BPEL properties defined the properties in composite.xml.

In the composite:

...
<property name="bpel.bpel.preference.myPreference">HelloThere</property>
</component>

In the BPEL file

ora:getPreference(myPreference)

Wednesday, July 15, 2009

SOA 11g: Event driven composites

One of the new features in SOA 11g is the event driven notifications. As the documentation describes it is not about messaging but sending events to the SOA 11g Server. Within a composite (SCA) you are able to define events. These events are described in a name and the payload. The payload is based on a message structure (XSD).

To use this event, the composite to subscribe to this event or use this event for publishing. Using this event can be defined in the mediator.
The mediator can me subsribed to this event or publish an event.

Thinking more in this event behaviour, what is the purpose? Before the 11g release we act on 'events' via queues (AQ / JMS) or via database (Polling) of file system. So why should we use it? This question I was asking myself.... and I found the answer. Apart of the event definition language (EDL) , standardization etc, there is a good reason to use this mechanism by default in your SCA applications.

Think about the next 'old' business flow, simplified. In this example 2 systems deliver data to the application. This data is handled in the BPEL process in chich the data is enriched, checked and transformed to a canonical data format. Then the message is put on the message bus and routed further.

If we need to add an new system, for example system C , we need to create a new BPEL process or service and add a routing rule in the message to handle this message.

With event driven architecture, we can make service independent of each other, guaranteed delivered and are decoupled. But the biggest advantage is that we are able to add composites that need to be handled without touching the other composite.

This is the EventProvider, simplied, it accepts a message that message is passed as an event to SOA 11g Server.

System A


System B



This is the EventHandler, it is subscribed to an event, then the payload is extracted and send to the files adpater (example).

If we need to add another composite, we do not need to add an routing rule, we just add the composite, transform the message and send this event to the SOA 11g Server. There is no direct routing between the EventProvider and the EventHandler! It is decoupled!

An example of this code can be downloaded here.

So how does it works? The provider composites and the event-handler composite must have an identical event definition. These definitions must be the same;
  • Even definition name
  • Event name
  • Event message
Then in the provider composites publish this event via the mediator, while the event-handler composite is subscribed to this event.

Note: If different composite are subscribed to the same event, all this composites will be triggered and an composite instance is created.


Thursday, July 02, 2009

Getting started with Oracle SCA, SOA, BPEL, OSB, AIA

(updated: 2 july 2009)
As I do SOA projects for a few years, many users are just entering this service oriented architecture world. For me the technology is common sense and I expect often that Service Oriented Arcitecture (SOA), Business Process Execution Language (BPEL), Enterprise Service Bus (ESB) is well known. But off-course this is not the case. When I started working with SOA/BPEL/ESB it was, and still is, a steep learning curve. The Oracle developers world comes from a traditional approach; thinking in functions and entities and since Java came to us, we are even thinking about objects and inherited them.

With SOA it is different, you have to think about processes; functional and technical. The gap between the functional people and technical people is reduced. Processes are part of the business, otherwise they do not have any reason for existence. While processes are running, the can fail, wait on other process, they finish, started, run in parallel etc. So SOA is a mind shift from the traditional development approach point of view.

In July 2009 the major milestone was reached, release 11g is out. This release has technically a new foundation; the Oracle WebLogic server; running on Java 1.6; new enterprise manager console for all FMW components and last but not least the service component architecture (SCA)
In 2008 Oracle announced the Oracle Application Integration Architecture. This is an add-on on the Oracle SOA Suite, which defines an abstract message layer that can be used to interface various systems; Siebel / SAP / Protal BRM / Cordys via a centralized system (Oracle SOA + AIA). This messages layers are created specific for different industries, for example the telecommunication market.

To start with Oracle SOA here are some of useful links:

Oracle SOA Suite general

Oracle SOA Suite software

Oracle Application Integration Architecture
Documentation
Installation
Performance
API
Tutorials
Oracle Blogs
Oracle Forum
Oracle General
Useful tools
Webservice standards

Wednesday, July 01, 2009

Oracle SOA Suite 11gR1 download avaiable

At last it is there. FInally we can use the new featrues of Oracle Weblogic Server 11gR1, Oracle SOA Suite 11gR1. It is available for download!

http://www.oracle.com/technology/software/products/middleware/index.html

Saturday, June 06, 2009

Oracle 11g Fusion Middleware available

As everybody using the current Oracle SOA Suite and Oracle Service Bus, we known that there is a new version coming, 11g.

An announcement will take place by Charles Philps and Thomas Kurian on the new Oracle Fusion MIddleware.

Join Oracle President Charles Phillips and Oracle Senior Vice President Thomas Kurian for the launch of Oracle Fusion Middleware 11g on July 1, 2009, at the Andrew W. Mellon Auditorium in Washington, D.C. from 10 a.m. to 3:00 p.m. Eastern time.

Be the first to hear about the product strategy and latest features in the newest release of Oracle Fusion Middleware. Whether your business focus is on products, services, people, or government, don't miss this chance to gain critical insight into the relevance of Oracle Fusion Middleware 11g for your business.

ORACLE FUSION MIDDLEWARE 11g LAUNCH

See also the Wall Street Journal

http://online.wsj.com/article/BT-CO-20090605-714157.html

A new version of the Oracle Service Bus (OSB 10.3.1) is now available, quick list of new OSB features:
  • JCA Transport with certified JCA adapters
  • Support for generating config.jar from command line or ant task.
  • Enhancements to native MQ Series Transport.
  • New APIs to support the SOA Management Pack for OSB.
Download it here.


Tuesday, June 02, 2009

Base64 enconding

Updated for SOA 11g

Within the SOA suite you can handle binary data. Sometime you need this data passed through the system for notification. For example sending the data as an attachment via mail.

Within BPEL you can call the notification system and create your attachments. But before that this binary data should be decoded to an ascii format of the mail server can handle this.

The data needs to be Base 64 encoded. There are no default BPEL functions to decode or encode data. We can solve this by creating our own embedded Java function in the BPEL process.

This java function will pickup XML data and encode this into Base64 format. The Java code to to this is here:

New 11g:
String base64 = ((oracle.xml.parser.v2.XMLElement)getVariableData("declaratieBase64Binary ")).getFirstChild().getNodeValue();
String decodedData = oracle.soa.common.util.Base64Decoder.decode(base64);
Old 10g:
<bpelx:exec name="Java_EncodeStringtoBase64" language="java" version="1.5">
<![CDATA[
String input = (String)getVariableData("resultString");    
String encoded;
try    
{   
  addAuditTrailEntry("BPEL Inline JAVA/INPUT: \n" + input);
  com.collaxa.common.util.Base64Encoder Encoder = new  com.collaxa.common.util.Base64Encoder();
  encoded = Encoder.encode(input);
  addAuditTrailEntry("BPEL Inline JAVA/INPUT: \n" + encoded);
  setVariableData("resultString64", encoded);    
}    
catch(Exception e)   
{   
e.printStackTrace();    
}]]>
</bpelx:exec>
In this example two BPEL variables are used.
  • resultString - type string, contains the input string
  • resultString64 - type string, contains the encode Base64 string

Friday, May 01, 2009

BPEL Cloning

Sometime you want to have copy of your BPEL production environment to reproduce issues or test cases. Cloning an Oracle Application Server environment is not so complicated. The whole cloning procedure is described in the Oracle Manuals.

To clone the BPEL environment follow the instructions described in the manual “Oracle® Application Server Administrator's Guide 10g Release 3”, chapter 9. There are a few flavors of this document:
Make a note that the cloning approach is based on the Oracle Application Server. The whole cloning approach should work, but...

Read the document carefully, not everything is cloned. You should do some post cloning steps:
  • Check the data-sources.xml file for each OC4J container.
  • Check the oc4j-ra.xml files for each adapter to are using.
  • Check the BPEL domain and system configuration files.
After these steps you should be able to start your cloned BPEL environment, but...

When you run a BPEL process that has partner links to other BPEL processes or third-party web services, these partner links are still pointing to your 'orginal' environment. The end points of thepartner links of your BPEL process are not changed after the cloning.

There are a few solutions and work arraounds to tackle this.

You could design your BPEL process to use a UDDI to lookup the end point dynamicly. You could use the approach in Oracle AIA Foundation to use dynamic partner links. But is is not use full if you did not implment this on advance.

You could 'fake' the endpoints by setting your 'hosts' file by adding entries of the hostnames of your partnerlink servers and point them to another IP adress, this could work only if portnumbers are the same.

Another approach is to use the BPEL Java API to query the BPEL processes and change all the end points of the partner links. With this approach you get a full cloned environment, with BPEL process defintions that point to your environment.

The code of the program is here:

package osbsutils.bpel;

/**
* The OSBS tool for bpel function
*
* This Java package is able to get and set endpoints of a BPEL process
* for any or all partnerlinks within that process.
*
* @notes
*
* To change endpoints of BPEL processes is only possible if
* the process state of that BPEL process is set to 'off'. Otherwise
* it could screw up your process definition
*
* If the BPEL process is using partnerlinks, but the wsdLocation is not
* an URL (http://host:port/...) then the replacement of the endpoint
* is not working
*
* @usage See end of this file
*
* @author Marc Kelderman
* @date 28 april 2009
* @version 1.0
*
*/

import com.collaxa.cube.rm.suitcase.PartnerLinkBindingDescriptor;
import com.collaxa.cube.rm.suitcase.PartnerLinkBindingsDescriptor;
import com.collaxa.cube.rm.suitcase.ProcessDescriptor;

import com.oracle.bpel.client.IBPELProcessHandle;
import com.oracle.bpel.client.Locator;
import com.oracle.bpel.client.delivery.IDeliveryService;

import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Properties;

public class endpoint
{
// The property that describes the endpoint in the bpel.xml file
private static String WSDLLOCATION = "wsdlLocation";

// Some pointers to the BPEL process manager
Locator locator;
IDeliveryService deliveryService;
IBPELProcessHandle processHandle;
ProcessDescriptor processDescriptor;

// A list of process handlers
IBPELProcessHandle[] listOfProcessHandles;

// Parnterlink bindings and a single binding
PartnerLinkBindingsDescriptor partnerLinksBindings;
PartnerLinkBindingDescriptor partnerLinkDesc;

// Public constrcutor
public endpoint()
{
}

public String getListOfEndpoints()
{
return "";
}

/**
* This method returns the wsdlocation of a particular proces
*
* @param pDomain - The BPEL domain
* @param pName - The name of the process
* @param pRev - The revision number
* @param pParterLinkName - the name of the partner link
* @return The 'wsdlLocation' property, as defined in bpel.xml
* @throws Exception
*/
public String getEndpoint
(
String pDomain
, String pName
, String pRev
, String pParterLinkName
)
throws Exception
{
if (locator == null) connectBPELPM(pDomain);

String domain = null;
String id = null;
String rev = null;
String wsdlloc = "";

Map<String,String> m = null;

// Get a list of BPEL processes definitions
listOfProcessHandles = locator.listProcesses();
int i = listOfProcessHandles.length;

// Loop through list list
while ((--i) >= 0)
{
// Get a sinlg handler to a proceess
processHandle = listOfProcessHandles[i];
processDescriptor = processHandle.getDescriptor();

// Get generic process info to determine if w got the right one
domain = processDescriptor.getDomainId();
id = processDescriptor.getId();
rev = processDescriptor.getRevisionTag();

if (id.equals(pName) && domain.equals(pDomain) && rev.equals(pRev))
{
partnerLinksBindings = processDescriptor.getPartnerLinkBindings();
partnerLinkDesc = partnerLinksBindings.getPartnerLinkBinding(pParterLinkName);

// a hash map to a list of partnerlink properties
m = partnerLinkDesc.getProperties();

// Get the result, even this propery does not exists
wsdlloc = m.get(WSDLLOCATION);
break;
}
}
return wsdlloc;
}

/**
* This method set the wsdlLocation of a BPEL process. It will
* Search through all the partnerlinks of that process and find the
* string 'oldUrl' and replace it with 'newUrl'
*
* @param pDomain - The BPEL domain
* @param pName - The name of the process
* @param pRev - The revision number
* @param oldUrl - the string to search for
* @param newUrl - The new string that will be used
*
* @return true when change has made, false if not
*
* @throws Exception
*/
public boolean setEndpoint
(
String pDomain
, String pName
, String pRev
, String oldUrl
, String newUrl
)
throws Exception
{
return(setEndpoint(pDomain, pName, pRev, null, oldUrl, newUrl));
}

/**
* This method set the wsdlLocation of a BPEL process. It will
* search of a particular partnerlink of that process and find the
* string 'oldUrl' and replace it with 'newUrl'
*
* @param pDomain - The BPEL domain
* @param pName - The name of the process
* @param pRev - The revision number
* @param pPartnerLinkName - the name of the partner link
* @param oldUrl - the string to search for
* @param newUrl - The new string that will be used
*
* @return true when change has made, false if not
*
* @throws Exception
*/
public boolean setEndpoint
(
String pDomain
, String pName
, String pRev
, String pPartnerLinkName
, String oldUrl
, String newUrl
)
throws Exception
{
if (locator == null) connectBPELPM(pDomain);

String domain = null;
String id = null;
String rev = null;
String wsdlloc = "";

// set the default return value
boolean result = false;
Map<String,String> m = null;

// Get the list of all processes
listOfProcessHandles = locator.listProcesses();
int i = listOfProcessHandles.length;

while ((--i) >= 0)
{
// Get a single process handler
processHandle = listOfProcessHandles[i];
processDescriptor = processHandle.getDescriptor();

// get some generic process values
domain = processDescriptor.getDomainId();
id = processDescriptor.getId();
rev = processDescriptor.getRevisionTag();

if (id.equals(pName) && domain.equals(pDomain) && rev.equals(pRev))
{
// We have the correct process and revision in the domain
// Get a list of partner links bindings
partnerLinksBindings = processDescriptor.getPartnerLinkBindings();
List l = partnerLinksBindings.getPartnerLinkBindings();
Iterator ite = l.iterator();
while(ite.hasNext())
{
// loop through all the partnerlink bindings
partnerLinkDesc = (PartnerLinkBindingDescriptor)ite.next();

// Do we have the correct partnerlink or can we ignore the partnerlink
if ((pPartnerLinkName == null) || (partnerLinkDesc.getName()).equals(pPartnerLinkName))
{
m = partnerLinkDesc.getProperties();
wsdlloc = m.get(WSDLLOCATION);

// Does the oldUrl string exists?
if (wsdlloc.indexOf(oldUrl) >= 0)
{
// Replace it
wsdlloc = wsdlloc.replaceFirst(oldUrl, newUrl);
// Set the new value
partnerLinkDesc.setPropertyValue(WSDLLOCATION, newUrl);
// Commit to BPEL PM
processHandle.updateDescriptor(processDescriptor);
result = true;
}
}
}
}
}
return result;
}

/**
* Connect to the BPEL process manager via the context properties
*/
private void connectBPELPM(String pDomain)
throws Exception
{
// properties in the classpath
Properties props = new java.util.Properties();
java.net.URL url = ClassLoader.getSystemResource("context.properties");
props.load(url.openStream());
locator = new Locator(pDomain, props);
}

public static void main(String[] args)
{
try
{
endpoint ep = new endpoint();

// if no arguments are give, call the examples
if (args.length > 0)
{
/*
* This example can be used command line:
*
* java <classpath> osbsutils.bpel.endpoint get domain bpel-process revision partnerlink-name
* java <classpath> osbsutils.bpel.endpoint set domain bpel-process revision [partnerlink-name] oldURL newURL
*
* Example:
* java <classpath> osbsutils.bpel.endpoint get default OSBSEndpointDemo 1.0 HelloWorld
* java <classpath> osbsutils.bpel.endpoint set default OSBSEndpointDemo 1.0 HelloWorld http://127.0.0.1:7777 http://linux:7777
*
*/

if (args[0].equals("get"))
{
if (args.length == 5)
{
System.out.println(ep.getEndpoint(args[1], args[2], args[3], args[4]));
}
}
if (args[0].equals("set"))
{
if (args.length == 6)
{
System.out.println(ep.setEndpoint(args[1], args[2], args[3], args[4], args[5]));
}
if (args.length == 7)
{
System.out.println(ep.setEndpoint(args[1], args[2], args[3], args[4], args[5], args[6]));
}
}
}

// if no arguments are give, call the examples
if (args.length == 0)
{
// Print the endpoint
// Search in the domain'default' for BPEL process OSBSEndpointDemo with revision 1.0
// The name of the partner link must be 'HelloWorld'
System.out.println(ep.getEndpoint("default", "OSBSEndpointDemo", "1.0", "HelloWorld"));

// Set a part of the endpoint to 'http://127.0.0.1:7777', when it contains 'http://linux:7777'
// Search in the domain'default' for BPEL process OSBSEndpointDemo with revision 1.0
// The name of the partner link must be 'WorldHello'
// Should return 'false'
System.out.println(ep.setEndpoint("default", "OSBSEndpointDemo", "1.0", "WorldHello", "http://linux:7777", "http://127.0.0.1:7777"));

// Set a part of the endpoint to 'http://127.0.0.1:7777', when it contains 'http://linux:7777'
// Search in the domain'default' for BPEL process OSBSEndpointDemo with revision 1.0
// The name of the partner link must be 'HelloWorld'
// Should return 'true'
System.out.println(ep.setEndpoint("default", "OSBSEndpointDemo", "1.0", "HelloWorld", "http://127.0.0.1:7777", "http://linux:7777"));

// Set a part of the endpoint to 'http://127.0.0.1:7777', when it contains 'http://linux:7777'
// Search in the domain'default' for BPEL process OSBSEndpointDemo with revision 1.0
// Any partner link in the BPEL process will be checked
// Should return 'true'
System.out.println(ep.setEndpoint("default", "OSBSEndpointDemo", "1.0", "http://linux:7777", "http://127.0.0.1:7777"));

System.out.println(ep.getEndpoint("default", "OSBSEndpointDemo", "1.0", "HelloWorld"));
}
}
catch (Exception e)
{
e.printStackTrace();
}
}
}



The Java program is using the following runtime libraries. These libraries should be set in your classpath.

bpel jars:
  • orabpel.jar
  • oracle_http_client.jar
  • orabpel-common.jar
  • orabpel-exts.jar
  • orabpel-thirdparty.jar
  • orabpel-ant.jar
  • connector15.jar
j2ee jars:
  • ejb.jar
The Java program is also using a configuration file to connect to the BPEL server.

context.properties
orabpel.platform=ias_10g
java.naming.factory.initial=com.evermind.server.rmi.RMIInitialContextFactory
java.naming.provider.url=opmn:ormi://host-name:opmn-request-port:oc4j_soa/orabpel
java.naming.security.principal=oc4jadmin
java.naming.security.credentials=your-password


Take care of the following Metalink notes
744590.1 SOA Configuration Files Are Not Updated With New SID/Database Information After Clone Process.
760913.1 "DB Vendor Has Not Been Specified" Error While Cloning Application Server 10.1.3

Tuesday, April 14, 2009

New Oracle SOA Build Server (OSBS)

An updated version of the Oracle SOA Build server has been released. Based on comments from the field I have made the following changes:
  • Upgraded to Oracle SOA Suite 10.1.3.4
  • Upgraded to OracleAIA 2.3
  • Added Download particular build nr, instead of only 'Latest' or a tag.
  • Added deployXSD task
  • Restructured properties directory
  • Loading Domain Value Maps (DVM)
  • Added a demo application (HelloWorldPIP)
  • Removed unneeded files
  • Demo application
  • AIA HelloWorld PIP
  • BPEL / ESB HelloWorld samples
The documentation can be found here.

Other features of the tool:
  • Compile BPEL processes
  • Deploy BPEL processes
  • Deploy AIA BPEL processes
  • Deploy ESB Services
  • Deploy ESB Services
  • Undeployment BPEL processes
  • Undeployment ESB services
  • Compile Java projects
  • Deploy Java projects
  • Download code from source control
  • Promote objects to different environments
  • Ignore 'local' ant scripts of ESB and BPEL processes.

The complete download can be found here (130MB).

Wednesday, April 01, 2009

SOA Cluster Installation

Update:

  1. Instead of using multicasting for BPEL Jgroups; use TCP, see my article.
  2. Follow Metalinke note 414427.1; add the java option "-Djava.net.preferIPv4Stack=true" in all start/stop option in opmn.xml.
  3. Set -XX:AppendRatio=3 in the Java startup parameters

This article is a summary of the document you can download that describs in detail how to install and configure an Oracle SOA Suite installation in a clustered environment.

The cluster installation is based on the following components.
  • Load balancer
  • Server node #1
  • Server node #2
  • Database
I assume that the database is high available, using Oracle RAC for example. This is shown in the next diagram.


The goal is to install the Oracle SOA Suite software in a cluster on a such way that it is easy to configure, maintain and efficient in usage. We will install the following components based on release 10.1.3.4 with the latest patch set:
  • Oracle Application Server
  • Oracle BPEL Process Manager
  • Oracle Enterprise Service Bus
  • Oracle Web Services Manager
If you read the documents on installing SOA Suite in a cluster, it could lead you into many Oracle Home installations, many oc4j instances. This is valid, but not always usable.

We will install this software into 2 OC4J containers; oc4j_soa and oc4j_esbdt. This install in line with the stand-alone / non clustered environment. The main difference is the fact that we need an additional oc4j, the ESB Design time instance. While in a non-clustered environment, all components are put into one oc4j instance (oc4j_soa). The reason for this difference is the Oracle ESB implementation for a cluster.

The cluster installation will create the following components on each node.
  • One Oracle Home with the complete software tree.
  • Oracle BPEL 10.1.3.x
  • Oracle ESB 10.1.3.x
  • Oracle Services Manager 10.1.3.x
  • Oracle SOA Suite Patch 10.1.3.4 (MLR#5)
  • One J2EE container for Oracle ESB design time
  • One J2EE container for Oracle ESB runtime, BPEL, Web Services Manager
  • One Apache http webserver.
The approach of the installation is as follows.
  1. Install Oracle Application Server, Node #1
  2. Install Oracle Application Server, Node #2
  3. Cluster Applicative Server
  4. Installation Oracle BPEL, # node 1
  5. Installation Oracle BPEL, # node 2
  6. Cluster BPEL Server
  7. Installation Oracle ESB, # node 1
  8. Installation Oracle ESB, # node 2
  9. Cluster ESB
  10. Install Oracle Web Services Manager
  11. Cluster Web Services Manager
  12. Apply SOA Patches 10.1.3.4

This article and the document could not be created without the following documents.
  • Metalink Note: 470267.1: How To Verify ESB Cluster Configuration
  • Metalink Note: 455714.1: Recommendations for ESB 10.1.3 Cluster Configuration
  • Metalink Note: 728144.1 Installing AIA for Communications on a SOA Cluster
The document can be download here.

Have fun.

Marc

File renaming SOA & OSB projects

This article is a bit off-topic. But very usefull in SOA and OSB projects. Sometimes you make a typo mistake in your SOA project. In that case you do a rename of file, but what if you find this typo after you completed your service or BPEL process. Then it is an intensive task to change all the filenames and the content of the files. JDeveloper has some refactoring, Eclipse is a bit better into that.

The following script (Linux bash) does a find and replace on a multiple files including the content of those files. Here is the script.

#!/bin/sh

if [ $# -lt 2 ] ; then
echo -e "Wrong number of parameters"
echo -e "Usage:"
echo -e " $0 findstring replacestring filepattern\n."
exit 1
fi

fstring="$1"
rstring="$2"

if [ "$3" = "" ]
then
somefiles="*"
else
somefiles="$3"
fi

echo "find: |${fstring}|"
echo "replace: |${rstring}|"
find . -depth -name "${somefiles}" \! -name ".svn*" -type f -exec sed -i "s/${fstring}/${rstring}/g" {} \;

for FILE in `find . -depth -name "${somefiles}" \! -name ".svn*"`
do
NEW=`echo ${FILE} | sed -e "s/${fstring}/${rstring}/"`
if [ "${NEW}" = "${FILE}" ]
then
:
else
echo $0: mv ${FILE} ${NEW}
mv ${FILE} ${NEW}
fi
done

Monday, March 09, 2009

SOA Readiness Assement

Are you ready for SOA? Is your organisation prepared to embrace SOA? How are your customers looking to SOA technology? Will SOA reduce my costs?

Many questions I get on Oracle SOA projects. It depends on the level in the organization; the boardroom; operations; but the questions are in general the same. Is the organisation ready to use Service Oriented Architecture.

Oracle have created a test to find out how SOA fits in the current organisatition. Here is the link to do your test:


The test is based on questions you have to answer in the following categories:
  • Business & Strategy
  • Architecture
  • Infrastructure
  • Information
  • Projects, Portfolios & Services
  • Operations, Administration & Management
  • Organization
  • Governance
The result will show a report, including a spider diagram, based on the categories. It describes how far your organisation is ready to use SOA. It means that on some categories you can use it without having much impact, while on other categories you have to do some more work.

The result is send via email, containing a PDF with the results.

The spier diagram of the SOA assesment.

Note that this test will give different results when you do this test with operations department only or with financial department. If you want to execute this for the whole organization; get all the stakeholders together and answer the questions together.

As result of this test, you are able to find quick-win projects, that can be implemented into a SOA architecture. You will know on which categories you have to spend more time to put them at a higher SOA level.

Execute this test periodically to find out if there are any improvements.

There is also a Oracle Business Process Managment Life cycle assement.

The diagram of a BPM assesment.

Monday, March 02, 2009

Oracle ESB Cluster deployment

When you have configured Oracle ESB cluster and want to deploy, you could end in deployment issues. While in JDeveloper you have developed your ESB service, it deploys successfully. But when you want to access it, via the browser or via BPEL lookup, you get and error.

XML Parsing Error: no element found
Location: http://host:7777/esb/wsil/MySystem/1_0/HelloESBService?wsdl
Line Number 1, Column 1:

In the log file of the Oracle ESBDT engine (oc4j_ebdt), you see more detailed log.

9/03/02 11:08:22 oracle.tip.esb.console.exception.ConsoleException: An unhandled exception has been thrown in the ESB system.
The exception reported is: "WSDL Parsing Failed: org.apache.slide.structure.ObjectNotFoundException: No object found at /files/ESB_Projects/MySystem/HelloESBService.wsdl: java.lang.RuntimeException: org.apache.slide.structure.ObjectNotFoundException: No object found at

at oracle.tip.esb.server.bootstrap.protocol.esb.ESBURLConnection.connect(Unknown Source)
at oracle.tip.esb.server.bootstrap.protocol


This is is not related to the configuraion of the Oracle ESB server. I assume that this is correctly configured, this also applies for a cluster environment. The error is due to the fact the ESB server expects the services from the database, while the deployed services is pointing to a file based repository.

Normally the ESB server is using a file based repository, in this case the ESB server is configured to use a database repoistory. This is often used in cluster environments.

The solution is to change your ESB service. This means open all your *.esbsvc files and look for XML element

<wsdlURL>file.extension</wsdlURL>

Make sure you replace it with

<wsdlURL>esb:///file.extension</wsdlURL>

Check all the 'esbsvc' files if they are using the correct url and not pointing to ESB_projects.

Tuesday, February 17, 2009

Cleanup AIA Cross Reference Table

Due to various reasons, the cross referenece could be filled with data that you do not expect. For example, you have duplicate values in your table.

In the very very first release of AIA, the cress-ref table did not have a unique/primary key. This could lead to duplicate records.

The following SQL script shows how to remove duplicate values from this table, it will save the 'double' records into a seperate table.

SET define OFF
SET echo OFF
SET termout ON

COLUMN XREF_TABLE_NAME FORMAT A20;
COLUMN XREF_COLUMN_NAME FORMAT A20;
COLUMN ROW_NUMBER FORMAT A20;
COLUMN VALUE FORMAT A30;
COLUMN IS_DELETED FORMAT A2;
COLUMN LAST_MODIFIED FORMAT A16;
COLUMN LAST_ACCESSED FORMAT A16;
COLUMN XREF_DATA_ROWID FORMAT A32;

PROMPT DROP OLD TABLE XREF_DATA_CLEANUP

DROP TABLE xref_data_cleanup;

PROMPT CREATE XREF_DATA_CLEANUP TABLE WITH DOUBLE VALUES;

CREATE TABLE XREF_DATA_CLEANUP AS
SELECT
XREF_TABLE_NAME
, XREF_COLUMN_NAME
, ROW_NUMBER
, VALUE
, IS_DELETED
, LAST_MODIFIED
, LAST_ACCESSED
, ROWID XREF_DATA_ROWID
FROM XREF_DATA
WHERE EXISTS
(
SELECT ''
FROM XREF_DATA X
WHERE X.VALUE = XREF_DATA.VALUE
AND X.XREF_TABLE_NAME = XREF_DATA.XREF_TABLE_NAME
HAVING COUNT(*) > 1
GROUP BY X.VALUE
);

PROMPT COUNT DOUBLE VALUES RECORDS

SELECT
XREF_TABLE_NAME
, XREF_COLUMN_NAME
, VALUE
, IS_DELETED
, COUNT(1)
FROM XREF_DATA
HAVING COUNT(1) > 1
GROUP BY
XREF_TABLE_NAME
, XREF_COLUMN_NAME
, VALUE
, IS_DELETED;

PROMPT LIST DOUBLE VALUE RECORDS

SELECT
XREF_TABLE_NAME
, XREF_COLUMN_NAME
, ROW_NUMBER
, VALUE
, IS_DELETED
, TO_CHAR((TO_DATE('01/01/1970','mm/dd/yyyy')
+ LAST_MODIFIED/86400000), 'dd-mm-yyyy hh24:mi:ss')
LAST_MODIFIED
, TO_CHAR((TO_DATE'01/01/1970','mm/dd/yyyy')
+ LAST_ACCESSED/86400000), 'dd-mm-yyyy hh24:mi:ss')
LAST_ACCESSED
, XREF_DATA_ROWID
FROM XREF_DATA_CLEANUP
ORDER BY
ROW_NUMBER
, XREF_TABLE_NAME
, XREF_COLUMN_NAME;

PROMPT LIST UNDOUBLED VALUE RECORDS

SELECT
XREF_TABLE_NAME
, XREF_COLUMN_NAME
, ROW_NUMBER
, VALUE
, IS_DELETED
, TO_CHAR((TO_DATE('01/01/1970','mm/dd/yyyy')
+ LAST_MODIFIED/86400000), 'dd-mm-yyyy hh24:mi:ss')
LAST_MODIFIED
, TO_CHAR((TO_DATE('01/01/1970','mm/dd/yyyy')
+ LAST_ACCESSED/86400000), 'dd-mm-yyyy hh24:mi:ss')
LAST_ACCESSED
FROM XREF_DATA X
WHERE X.ROWID > ANY
(
SELECT XX.ROWID
FROM XREF_DATA XX
WHERE XX.VALUE = X.VALUE
AND XX.XREF_TABLE_NAME = X.XREF_TABLE_NAME
)
ORDER BY
ROW_NUMBER
, XREF_TABLE_NAME
, XREF_COLUMN_NAME;

PROMPT DELETE DOUBLE RECORDS IN ORGINALE XREF-DATA TABLE.

DELETE
FROM xref_data x
WHERE X.ROWID > ANY
(
SELECT XX.ROWID
FROM XREF_DATA XX
WHERE XX.VALUE = X.VALUE
AND XX.XREF_TABLE_NAME = X.XREF_TABLE_NAME
);

PROMPT CHECK IF DUPLICATED VALUES ARE CORRECT DELETED.
PROMPT THE OUTCOME SHOULD BE 0 ROWS SELECTED.

SELECT XREF_TABLE_NAME
, XREF_COLUMN_NAME
, VALUE
, IS_DELETED
, COUNT(1)
FROM AIA.XREF_DATA
HAVING COUNT(1) > 1
GROUP BY
XREF_TABLE_NAME
, XREF_COLUMN_NAME
VALUE
IS_DELETED;

PROMPT CHECK THAT NO RECORDS ARE LOSSED.
PROMPT CHECK THAT THE AMOUNT OF ROWS ARE EQUAL
PROMPT AS THE RESULTS OF PROMTS COUNT DOUBLE VALUES RECORDS.

SELECT XRF.*
FROM XREF_DATA XRF
, (
SELECT
XREF_TABLE_NAME
, XREF_COLUMN_NAME
, VALUE
, IS_DELETED
, COUNT(1)
FROM XREF_DATA_CLEANUP
HAVING COUNT(1) > 1
GROUP BY XREF_TABLE_NAME
, XREF_COLUMN_NAME
,VALUE
IS_DELETED
) DUB
WHERE XRF.XREF_TABLE_NAME = DUB.XREF_TABLE_NAME
AND XRF.XREF_COLUMN_NAME = DUB.XREF_COLUMN_NAME
AND XRF.VALUE = DUB.VALUE;

Monday, February 16, 2009

Oracle Cross Reference Table

In Oracle ESB the crosse reference table was introduced to create domain value maps.

Within Oracle AIA this mechnism is one of the technical foundation on which AIA runs.

The documentaion was limited on this functionality. Some core functions used in stylesheets were explained. Popular cross-reference functions are:
  • xref:populateXRefRow() - Insert a record in the XRef table
  • xref:markForDelete() - Delete a record from the XRef table
Note: The xref:markForDelete() will update the delete-column in the XRef-table. In future releases, this function could change that it will physicly delete the table instead of update.

Since Oracle SOA Suite 10.1.3.4, the documentati
on has improved dramaticly. Detailes description and examples are now documented. It can be found here:

http://download.oracle.com/docs/cd/E12524_01/doc.1013/e12638/esb_xref.htm

From conceptualpoint of view and almost technical it can be used a reference documentation in olde versions 10.1.3.3 and AIA 2.0.x.

Note that there are some challenges when you use the cross-reference table.

Check that the table has is optimzed for perfomance. That is has to correct indexes and contraints. The latest patches of the Oracle SOA Suite, applies these indexes and contraints.

One question on this cross-reference table is the date format. The table contains two columns that specifies the date since 1 january 1970. You can obtain the correct format as follows:


select
xref_table_name
, xref_column_name
, row_number
, value
, is_deleted
, to_char((to_date('01/01/1970','mm/dd/yyyy')
+ last_modified/86400000), 'dd-mm-yyyy hh24:mi:ss')

, to_char((to_date('01/01/1970','mm/dd/yyyy')
+ last_accessed/86400000), 'dd-mm-yyyy hh24:mi:ss')

from xref_data;