Posts tagged osb

Review of Oracle Service Bus 11g Development Cookbook (Packt Publishing) by Edwin Biemond, Guido Schmutz, Eric Elzinga et. al.

Recently I gained access to an electronic copy of the just released Oracle Service Bus 11g Development Cookbook, written by five authors – all experts on OSB and three personal acquaintances of mine. I was very interested in learning about the final result after hearing many intermediate comments during the writing process as well as reading the occasional remark on Twitter. Knowing Guido, Eric and Edwin and assuming the same expert level for the other two authors, I anticipated a very interesting read.

Image

Below I will share my impressions from browsing through this solid 500+ page volume. Note: the homepage for the book can be found here: http://www.packtpub.com/oracle-service-bus-11g-development-cookbook/book .

Read the rest of this entry »

Implementing Web Services backed by a Database PL/SQL API using the Oracle Service Bus

This article accompanies an article on the Architecture section of Oracle Technology Network (OTN): Implementing the Enterprise Service Bus Pattern to Expose Database Backed Services. It provides a detailed description of the implementation of the ESB architecture design pattern – the same that is introduced in the article on OTN – using Oracle Service Bus. This OSB based implementation is in terms of structure, architecture design and functionality the replica of the pure Java based implementation described in the OTN-article. OSB adds productivity, agility and many run time administrative benefits over the pure Java solution.

The challenge

The challenge the organization – let us call them Stuff Inc. – is facing is simple and common: external parties have requested access to information through Web Services. This information is held in the enterprise (Oracle) database at Stuff Inc.

Image

The architecture team decides that the implementation of the service should be done according to the ESB architecture pattern.

Image

Their initial implementation is based on custom Java Classes, XSLT stylesheets and JDBC calls.

After some time having worked with this initial set up, they decide to introduce the Oracle Service Bus to replace much of their generic classes and ESB plumbing. This article tells the story of how the OSB is used to implement a simple Web Service based on a PL/SQL API in an Oracle Database, using two transformations and a JCA Database Adapter service. It demonstrates the essential steps in implementing any OSB service.

Read the rest of this entry »

Choosing the best way for SOA Suite and Oracle Service Bus to interact with the Oracle Database

In the past few weeks, I have encountered a similar discussion in various organisations. Each organisation uses either SOA Suite (11g) or Oracle Service Bus (11g) at the core of their SOA infrastructure – either for integration purposes, for workflow and process orchestration or for both. In each organisation, the role of one or more databases is crucial and interaction between the SOA environment and the database is one of the most common and therefore important functions in their enterprise IT environment.

Given the importance, it is only logical that the way(s) chosen for linking the SOA component to the database is carefully selected – and evaluated every now and again. Technology may have progressed, experience may have taught us a lesson or two, the knowledge and skills may have evolved.

Interestingly enough, the number of ways for SOA Suite and OSB to communicate with the database is quite high. This article includes an illustration that shows over 20 different interaction channels that we can choose from with a fairly wild variation of attributes, required skills, productivity and performance characteristics.

Among the choices we face is the question of the communication protocol to use for accessing the database. Roughly speaking, we can go through JDBC (via a JDBC Data Source on the WebLogic Server), via HTTP or using ‘another’ channel such as File System, FTP, Email, XMPP (Chat) etc. The communication protocol may in part determine another choice that awaits us: what will be the format and nature of the messages that we exchange: text based (XML, JSON, CSV) or strongly (Oracle-ly) typed. We know that on the one hand we have the world of XML in the SOA middleware components, and on the other side the relation world of the Oracle database – at least relational and strongly typed at the core.

Image

So when choosing the method for having the SOA components interact with the database, we have to decide on the communication protocol and we have to determine where in the route from table to SOA component (and vv.) the conversion from Relation to XML or from XML to Relational will take place.

Considerations when making that decision include the question who has to do the work of making the XML <=> Relational conversion at design time and at run time – what is the productivity of an approach and what the performance impact. Other considerations include robustness and agility or ability to maintain and evolve the implementation. Of course the required skills factor into this decision as well as the complexity of the architecture, the design, development, test and deployment process and the nature of the interaction: read only, data manipulation, small or large documents, synchronous or asynchronous (or even fire and forget) etc.

Read the rest of this entry »

Getting started with … your career (in Dutch)

Als bezoeker van deze blog ben je bezig met het maken van mooie oplossingen en nieuwe uitdagingen op technisch gebied. AMIS nodigt je uit om ons team te komen versterken. AMIS wil je op het gebied van Oracle en Java uitdagen de volgende stap in je carrière nemen.

AMIS merkt al enige maanden dat de markt voor Oracle en Java opdrachten aan het aantrekken is en maakt dat concreet met het uitvoeren van innovatieve opdrachten.

Om je een beeld te geven van het werk bij AMIS volgt hieronder een lijst met de trajecten waar we de afgelopen maanden aan gewerkt hebben.

  • OSB / SOA Suite implementatie bij een grote informatieverwerkende organisatie.
  • Realisatie in ADF 11g van een backend applicatie voor een internetwinkel.
  • Realisatie van een SAAS oplossing op basis van Hibernate, Seam en RichFaces.
  • Realisatie van een medisch registratiesysteem in ADF.
  • Advies op het gebied van het gebruik van ADF 11g in combinatie met JHeadstart voor een energiebedrijf.
  • Realisatie van een SOA / BPEL implementatie voor een pensioenfonds.
  • Realisatie van een administratiesysteem voor een verzekeraar buiten Nederland (EU) in ADF 11g en JHeadstart.
  • Oracle XML DB implementatie voor een grote bank.
  • Realisatie van een SOA Suite / BPEL oplossing voor een grote logistieke leverancier.
  • Proof of concept ADF 11g bij een groot adviesbureau.
  • Oracle APEX / GIS implementatie bij een groot adviesbureau.
  • SOA / BPEL traject bij een grote gemeente.
  • Oracle WebCenter, ADF 11g, SOA Suite 11g en OSB traject bij een grote wereldwijde dienstverlener.
  • Webservice koppeling met ADF en JAX WS voor een grote gemeente.
  • Advies en implementatie van een professionele ontwikkelstraat bij een IT-bedrijf
  • …..meer
Kom werken bij AMIS, kijk http://www.amis.nl/vacatures

Eva van der Kleij. Neem contact met me op via info@amis.nl of bel 030-6016000

We zoeken Oracle, SOA, Java developers die als medewerker van AMIS de vervolgopdrachten gaan uitvoeren. En denk niet direct dat je hiervoor te weinig kennis of ervaring hebt: jouw toekomstige ervaren collega’s doen niets liever dan jou verder helpen. Ons trainingsprogramma voorziet in een grote diversiteit aan opleidingen en tijdens onze interne kennissessies kun je op veel terreinen iets van je collega’s opsteken.

Kom ons eens van wat dichterbij bekijken en maak een afspraak voor een kennismakingsgesprek via Eva van der Kleij op info@amis.nl of bel naar op 030-6016000.  Bel ons ook als je meer wilt weten over werken bij AMIS of een van de onderstaande functies. Concreet hebben we de volgende vacatures:

Wellicht sta jij volgende maand met een artikel op deze blog, schrijvend over de nieuwe dingen die je hebt geleerd of toegepast.

Tot ziens bij AMIS!

Ways to instantiate a variable in Oracle Service Bus based on a static XML document

Today we had an interesting exploration into the many ways available in the Oracle Service Bus to load a piece of XML into a variable in a message flow – to use as the source for populating part of a to-be-forwarded request message to the business service or for enriching the response message. Even such a seemingly straightforward task turned out to have a number of ways to approach, each with their own merits and complexities.

The various approaches we uncovered in a space of ten minutes or so:

  • use a static expression in an Assign action, simply copying the XML content into the variable
  • use the function fn:doc that can load XML from a local file and assign the XML to a variable that way
  • introduce the file adapter to load the XML file from the local file system and assign it to a variable; this would also support non-XML formats – like comma separated values – that can be converted to XML
  • use the database adapter (or the fn-bea:execute-sql) to retrieve the XML content from a relational database
  • store the XML content in an XQuery transformation
  • do any of the above and wrap it inside a Proxy Service that can be invoked from from other services, potentially governed by the service result cache

Considerations for choosing an approach definitely include the reusability (we do not want to define the same XML document in more than one location) and overhead (especially for parsing the XML). Solutions that cache the XML rather than load it every time a service instances has a need for it are definitely preferred.

It turns out that due to the stateless nature of the OSB the first four methods are not attractive in our situation – where we have very few changes in these static (!) XML documents and many instances of the services. The fifth approach, using the XQuery resource, is easily reusable across projects and services and has as an important bonus the fact the XQuery transformation templates are cached by the OSB, across the stateless instances of OSB Services.

Read the rest of this entry »

Installing OEL R5U5, Oracle 11gR2, OSB 11gR1 SP2 and SOA Suite 11gR1 SP2 on virtualbox 4.0

Some time ago I decided to take a look at virtualbox. After using some downloadable appliances I decided to install one for myself from scratch to have it configured just the way I want. This blog describes what I did to achieve this. I am still quit pleased with virtualbox. Somebody pointed out to me that the CPU Utilization is quit high though. Some browsing on the internet and looking in the manual gave me the solution. I will talk about this later.

Installing virtualbox is very simple. Just download the installer and run it. Follow the wizard and do a  next/next/finish installation. If you have a dual core PC or laptop (who hasn’t nowadays) please have a look at the end of this blog…. You might have to do some additional settings.

Installing Oracle Enterprise Linux is also very simple. First I created an empty virtual machine with a single disk of at least 15 Gb. I selected two processors and switched on all virtualization acceleration as my hardware supports that. I both tried the PIIX3 and ICH9 chipset. I could install OEL with both only with PIIX3 OEL actually booted. In total these settings resulted in a 10-20% CPU utilization when my guest is idle. Not great but acceptable. (I started with >50% with only one CPU)

Before you can install OEL you have to mounted the OEL R5U5 DVD iso as a DVD drive and start the virtual machine.

I run my virtual disks from an external eSATA disk so that’s why the DVD drive is created under the SATA Controller.  First I mounted the OEL DVD iso as an IDE drive. Although the installation program initially ran it somewhere lost it and did not want to continue anymore asking me to insert the OEL installation DVD over and over again. So I created a new DVD drive under the SATA Controller and then it worked. The OEL installation program found the disk, formatted it and installed OEL on it. Again a next/next/finish installation. There is a very nice article on the installation process if you follow this link. I suggest you enter the hostname manually otherwise one is picked for you.  After the installation this can be changed by changing the HOSTNAME property in the /etc/sysconfig/network file.

After accepting the terms the OEL desktop opened asking for my credentials. The first thing you have to do is add a linux kernel parameter. You need to do this to descrease the CPU usage of the virtualbox process in Windows. Open the file /boot/grub/grub.conf file. Look for the kernel line, it will look like:

kernel /vmlinuz-2.6.18-194.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet

add “divider=10″ to this line:

kernel /vmlinuz-2.6.18-194.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet divider=10

I assigned only one core (CPU) to my virtual machine. In windows task manager you can force the use of one CPU by setting the affinity to one CPU. Below here you can see the CPU Utilization before and after. Before the utilization when the guest is idle is between 10 – 50% (1 complete core). Afterwards the utilization is about 5-10%.

CPU Utilization with default settings (Orange line is virtualbox process in windows)

CPU utilization after optimization (Orange line is virtualbox process in windows)

You can also add the nmi_watchdog parameter to switch watchdog off. Otherwise you get a warning during startup. Although this is nothing serious it looks better when this warning is gone.

The second thing I did was installing the virtualbox extensions mounted under /media. Unfortunatelly the error “unable to find the sources of your current Linux kernel. ” was raised.

This meant some source packages were missing. Browsing the internet I found out these were:

  1. gcc
  2. kernel-devel-2.6.18-194.el5
  3. kernel-xen-devel-2.6.18-194.el5

When I tried to retrieve and install them using yum nothing happened. Oracle does not allow you to do this when you haven’t registered your installation and have no maintenance contract with them.

On the internet I read about the existence of a public OEL repository you can use. Here is what I did:

  1. Retrieve the yum configuration file
    # cd /etc/yum.repos.d
    # wget http://public-yum.oracle.com/public-yum-el5.repo
  2. Enable the appropriate repository by editing the yum configuration file
    a.  Open the yum configuration file in a text editor
    b.  Locate the section el5_u5_base
    c.  Change enabled=0 to enabled=1

Now when I used yum to install the earlier mentioned packages it all worked:

To be sure I set the KERN_DIR system variable to /usr/src/kernels/2.6.18-194.el5-i686 and when I run the virtualbox extensions again it all works. The first part of my installation is finished.

I am using NAT with port forwarding to connect to services running on my guest system. This is the default network setting for virtualbox. All services on my guest system will be accessible on my windows 7 host through localhost. The IP address assigned to my guest system is always 10.0.2.15.  Although assigned by DHCP it will always assign this address.

To the /etc/hosts file I have added the following entry:
10.0.2.15   new-host-2.domain.local new-host-2
You could also use a Bridged network. There are some disadvantages when using bridged. You always need a network connection and you will run into trouble when you switch networks as your guest system will be assigned a different ip address. Some applications (like oracle DB) do not startup anymore. Or when you are running licensed software this sometimes checks the ip address you used when you installed the software and will not work anymore when the ip is different.

Installing oracle

First I created a separate file system for oracle mounted as /opt/oracle so all my oracle software is seperate  from my root system. I combined information from two articles: the first on adding an additional disk on virtualbox. The first article missed some vital information on creating partitions. This is supplemented by the second article. In short I did the following:

  1. run fdisk:
    # fdisk /dev/sdb   (With # fdisk –l you can check the name of your newly created device, in my case this was /dev/sdb)
  2. create a new partition:
    Enter n in the list to select new partition,next select  primary, 1 (partition number)  and leave the rest default (enter)
  3. save partition table:
    Enter w in the list/menu.
  4. format  new disk:
    # mkfs -t ext3 /dev/sdb1     (1 for the partition number)
  5. create /opt/oracle directory
  6. update etc/fstab with:
    /dev/sdb1               /opt/oracle                   ext3    defaults        0 0
  7. Mount the disk by calling: mount /opt/oracle   (or reboot)
  8. Check if the new disk is there: # df –T
    Your output should look like:
[root@new-host-3 apps]# df –T
Filesystem    Type   1K-blocks      Used  Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
              ext3     11109328   2226776   8309112  22% /
/dev/sda1     ext3       101086     12055     83812  13% /boot
tmpfs         tmpfs     1037732         0   1037732   0% /dev/shm
SharedFolders vboxsf  124930044  40895064  84034980  33% /SharedFolders
/dev/sdb1     ext3     30961664    176200  29212704   1% /opt/oracle

For the installation of oracle 11gr2 itself I used the oratoolkit. This really works like a charm, installing oracle becomes like a walk in the park. I just followed the installation script as described on the site.

You must first disable secure linux by editing the /etc/selinux/config file, making sure the SELINUX flag is set as follows:

SELINUX=disabled

If you do not do this  you might get an error later on during creation of the database:


After you have installed oratoolkit a user oracle (group oinstall) has been created. What I did was change the ownership of /opt/oracle to this user. Then I continued the process.

When you are at the stage of actually creating the database you have to alter the sbSetup-dev.cfg file and change the following parameters.

DB_NAME old dev
new orcl
ORACLE_HOME old $ORACLE_BASE/sesrv/11.1.0/db1
new $ORACLE_BASE/sesrv/11.2.0/db1
DATA01 old /data01/rdbms/${DB_NAME}
new /opt/oracle/sesrv/11.2.0/oradata/${DB_NAME}
DATA02 old /data01/rdbms/${DB_NAME}
new /opt/oracle/sesrv/11.2.0/oradata/${DB_NAME}
UTL old /data01/utl/$DB_NAME
new /opt/oracle/sesrv/11.2.0/oradata/utl/$DB_NAME
NCHARACTER_SET old UTF8
new AL32UTF8
LISTENER_PORT old 1531
new 1521

Make sure you at least select the correct national character set! For OSB and SOA Suite this needs to be AL32UTF8. A second remark concerns the location of the Oracle data files. If you leave the data01/02 and the UTL directory to its defaults your database will not be created on the new file system but on the root.

Installing Oracle Service Bus 11gR2

Installing OSB is pretty straight forward.  I just followed the instructions from the oracle documentation starting here.

On thing I encountered was the following. In the manual you can read the following:

After installing the Oracle 11g database, you must complete the following steps:

  1. Log in to the database as the sys (default) user.
  2. Run the following scripts:
    alter system set session_cached_cursors=100 scope=spfile;
    alter system set processes=500 scope=spfile;
  3. Bounce the database and continue with the installation of Repository Creation Utility (RCU) and loading of schemas.

When you do this you might get the error there is no spfile. You can create one  in sqplus:
SQL> CREATE SPFILE FROM PFILE;

In short I did the following:

  1. Created a new linux user/group:  soa/soa   (I always use oracle as password)
    Created /opt/oracle/middleware directory owned by soa
  2. Do a chmod 777 -fR on the /opt/oracle/oraInventory directory. It is a little radical but you need write permissions on this folder otherwise you cannot do the next installment.
  3. Downloaded, unpacked and installed weblogic server 10.3.3.
  4. Unpacked the Repository Creation Utility (RCU) and created tablespaces/Schemas
    Metadata Services: DEV_MDS/oracle  (oracle=password)
    SOA Infrastructure: DEV_SOAINFRA/oracle
    User Messaging Service: DEV_ORASDPM/oracle
    Business Act. Monitoring: DEV_ORABAM/oracle

    You can get the error when you try to startup ./rcu : xlib connection to 0.0 refused by server. See here on how to solve this.

  5. I did some pre-installation tasks:
    1. Installed a missing linux package: yum install compat-db –y
    2. Added number of open files by editing /etc/security/limits.conf:
    soa soft nofile 4096
    soa hard nofile 4096
  6. Unpacked and installed the OSB software:
    ./runInstaller -jreLoc /opt/oracle/middleware/jdk160_18/jre

Now we continue with the configuration part of the installation:

  1. Use config.sh to generate a domain with (at least) the following selected extensions:
    1. Oracle Enterprise Manager
    2. OSB Extension: All domains Topologies
    I selected the all domain topologies as I want my osb to run on a (non-clustered) seperate managed server. I named my domain: soa_domain and the machine soa_machine. I entered the hostname as the ListenAddress for my servers. Later on this hostname will be mapped in windows to localhost/127.0.0.1 so when you click on the administration console link in oracle enterprise manager you will be directed correctly.
  2. Run nodemanager for first time to generate nodemanager.properties.
    Make sure you do this as user soa. You can find the startup scripts at: /opt/oracle/middleware//wlserver_10.3/server/bin/startNodeManager.sh
  3. Change /opt/oracle/middleware/wlserver_10.3/common/nodemanager/nodemanager.properties file:
    SecureListener=false
    StartScriptEnabled=true

    I switched off the secure communication between the adminserver and the nodemanager. There is no need for that. When you start the adminserver please do not forget to also change the default communication in the console from SSL to plain.
  4. Copy the nodemanager script below into the /etc/rc.d/init.d directory. Make it executable (without the extension .sh!). Now you can create the startup en kill scripts by using:     chkconfig --add nodemanager (All done as root)
#!/bin/bash
#
# nodemgr Oracle Weblogic NodeManager service
#
# chkconfig:   345 85 15
# description: Oracle Weblogic NodeManager service
#
### BEGIN INIT INFO
# Provides: nodemgr
# Required-Start: $network $local_fs
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6
# Short-Description: Oracle Weblogic NodeManager service.
# Description: Starts and stops Oracle Weblogic NodeManager.
### END INIT INFO

# Source function library.
. /etc/rc.d/init.d/functions

# set Weblogic environment defining CLASSPATH and LD_LIBRARY_PATH
# to start/stop various components.
export MW_HOME=/opt/oracle/middleware
#
# Note:
# The setWLSEnv.sh not only does a good job of setting the environment,
# but also advertises the fact explicitly in the console! Silence it.
#
source $MW_HOME/wlserver_10.3/server/bin/setWLSEnv.sh > /dev/null

# set NodeManager environment
export NodeManagerHome=$WL_HOME/common/nodemanager
NodeManagerLockFile=$NodeManagerHome/nodemanager.log.lck

# check JAVA_HOME
if [ -z ${JAVA_HOME:-} ]; then
   export JAVA_HOME=/opt/oracle/middleware/jrockit_160_17_R28.0.0-679
fi

exec=$MW_HOME/wlserver_10.3/server/bin/startNodeManager.sh
prog='nodemanager'
user='soa'

function is_nodemgr_running() {
  local nodemgr_cnt=`ps -elF        | \
  grep -i 'java'                  | \
  grep -i 'weblogic.NodeManager'  | \
  grep -v grep                  | \
  wc -l`
  echo $nodemgr_cnt
}

function get_nodemgr_pid() {
  nodemgr_pid=0
  if [ `is_nodemgr_running` -eq 1 ]; then
     nodemgr_pid=`ps -elF             | \
     grep -i 'java'                 | \
     grep -i 'weblogic.NodeManager' | \
     grep -v grep                 | \
     tr -s ' '                    | \
     cut -d' ' -f4`
  fi
  echo $nodemgr_pid
}

function check_nodemgr_status () {
  local retval=0
  local nodemgr_cnt=`is_nodemgr_running`
  if [ $nodemgr_cnt -eq 0 ]; then
    if [ -f $NodeManagerLockFile ]; then
      retval=2
    else
      retval=3
    fi
  elif [ $nodemgr_cnt -gt 1 ]; then
    retval=4
  else
    retval=0
  fi
  echo $retval
}

start() {
  [ -x $exec ] || exit 5
  echo -n $"Starting $prog: "
  su $user -c "$exec &"
  retval=$?
  echo
  return $retval
}

stop() {
  echo -n $"Stopping $prog: "
  kill -s 9 `get_nodemgr_pid` &> /dev/null
  retval=$?
  echo [ $retval -eq 0 ] && rm -f $NodeManagerLockFile
  return $retval
}

restart() {
  stop
  start
}

reload() {
  restart
}

force_reload() {
  restart
}

rh_status() {
  local retval=`check_nodemgr_status`
  if [ $retval -eq 0 ]; then
    echo "$prog (pid:`get_nodemgr_pid`) is running..."
  elif [ $retval -eq 4 ]; then
    echo "Multiple instances of $prog are running..."
  else
    echo "$prog is stopped"
  fi
  return $retval
}

rh_status_q() {
  rh_status >/dev/null  2>&1
}

case "$1" in
start)
  rh_status_q && exit 0
  $1
  ;;
stop)
  rh_status_q || exit 0
  $1
  ;;
restart)
  $1
  ;;
reload)
  rh_status_q || exit 7
  $1
  ;;
force-reload)
  force_reload
  ;;
status)
  rh_status
  ;;
condrestart|try-restart)
  rh_status_q || exit 0
  restart
  ;;
*)
  echo -n "Usage: $0 {"
  echo -n "start|"
  echo -n "stop|"
  echo -n "status|"
  echo -n "restart|"
  echo -n "condrestart|"
  echo -n "try-restart|"
  echo -n "reload|"
  echo -n "force-reload"
  echo "}"
  exit 2
esac
exit $?
  1. Remove debug=true from setDomainEnv.sh. If you do not do this the managed server will not start up as the adminserver is already using the debug port.  Remember you need to do that every time you do a domain extension as these files are overwritten again.
  2. Copy the script adminserver.sh below to $MW_HOME/user_projects/domains/osb_domain. You can also copy this script to /etc/rc.d/init.d (without .sh) and create the approriate symbolic links with: chkconfig --add adminserver. The adminserver will be started during boot.
#!/bin/bash
#
# admsvr Oracle Weblogic AdminServer service
#
# chkconfig:   345 99 01
# description: Oracle Weblogic AdminServer service
#
### BEGIN INIT INFO
# Provides: admsvr
# Required-Start: $network $local_fs
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6
# Short-Description: Oracle Weblogic AdminServer service.
# Description: Starts and stops Oracle Weblogic AdminServer.
### END INIT INFO

export DOMAIN_HOME=/opt/oracle/middleware/user_projects/domains/soa_domain

exec=${DOMAIN_HOME}/startWebLogic.sh
prog=startWeblogic
user='soa'

function is_admin_running() {
 local admin_cnt=`ps -elF        | \
 grep -i 'java'                  | \
 grep -i 'AdminServer'  | \
 grep -v grep                  | \
 wc -l`
 echo $admin_cnt
}

function get_admin_pid() {
 admin_pid=0
 if [ `is_admin_running` -eq 1 ]; then
 admin_pid=`ps -elF             | \
 grep -i 'java'                 | \
 grep -i 'AdminServer' | \
 grep -v grep                 | \
 tr -s ' '                    | \
 cut -d' ' -f4`
 fi
 echo $admin_pid
}

function check_admin_status () {
 local retval=0
 local admin_cnt=`is_admin_running`
 if [ $admin_cnt -eq 0 ]; then
 retval=1
 else
 retval=0
 fi
 echo $retval
}

start() {
 [ -x $exec ] || exit 5
 echo "nohup $exec  &gt; /dev/null 2>&1 &"
 echo -n $"Starting $prog: "
 su $user -c "nohup $exec  &gt; /dev/null 2>&1 &"
 retval=$?
 echo
 return $retval
}

stop() {
 echo -n $"Stopping $prog: "
 kill -s 9 `get_admin_pid` & > /dev/null
 retval=$?
 echo
 return $retval
}

restart() {
 stop
 start
}

reload() {
 restart
}

force_reload() {
 restart
}

rh_status() {
 local retval=`check_admin_status`
 if [ $retval -eq 0 ]; then
 echo "$prog (pid:`get_admin_pid`) is running..."
 else
 echo "$prog is stopped"
 fi
 return $retval
}

rh_status_q() {
 rh_status > /dev/null  2>&1
}

case "$1" in
 start)
 rh_status_q && exit 0
 $1
 ;;
 stop)
 rh_status_q || exit 0
 $1
 ;;
 restart)
 $1
 ;;
 reload)
 rh_status_q || exit 7
 $1
 ;;
 force-reload)
 force_reload
 ;;
 status)
 rh_status
 ;;
 condrestart|try-restart)
 rh_status_q || exit 0
 restart
 ;;
 *)
 echo -n "Usage: $0 {"
 echo -n "start|"
 echo -n "stop|"
 echo -n "status|"
 echo -n "restart|"
 echo -n "condrestart|"
 echo -n "try-restart|"
 echo -n "reload|"
 echo -n "force-reload"
 echo "}"
 exit 2
 esac
 exit $?

The OSB is installed and configured now. If you reboot the adminserver and nodemanager are automatically started. I usually start managed servers manually the first time and enter the credentials when asked for. You can start the managed server from the administation console from now on. Make sure you have set the communication to plain (Environment --> Machines --> soa_machine --> configuration --> Node Manager)

Connecting from outside

I want to access the adminserver and osb_server from my host. To do this you need to do a few things:

Opening firewall in Linux

# iptables -I INPUT -p tcp --dport 7001 -j ACCEPT
# iptables -I INPUT -p tcp --dport 8001 -j ACCEPT
# iptables -I INPUT -p tcp --dport 8011 -j ACCEPT
# iptables -I INPUT -p tcp --dport 5556 -j ACCEPT
# iptables -I INPUT -p tcp --dport 1521 -j ACCEPT
# iptables -I INPUT -p tcp --dport 7890 –j ACCEPT
# iptables -I INPUT -p udp --dport 9888 -j ACCEPT
# service iptables save

7890 and 9888 are ports used by coherence. You need to open them otherwise you get problems starting the osb managed server. I opened 7890 just to be sure, it could be this is not necessary. Port 8001 I already added for SOA Suite (soa_server1)

Port forwarding in Virtualbox

Secondly you have to do port forwarding in virtualbox. As you can see port 22 is mapped to 2222. This is because you are not allowed to map to ports below 1024.

Setting windows hosts

Finally you have to add the following line to your windows hosts file (windows/system32/drivers/etc):
127.0.0.1 hostname
Now you can use the hostname both on your host and guest.

Installing SOA Suite 11gR2

There is a lot of documentation on installing SOA Suite 11g. I am not going to redo this work. I did not encounter any problems. During installation of the OSB all repository schemas were already created so I could skip the repository creation part. The installation of the SOA Suite contains of two parts. You first have to install the SOA Suite 11gR1 files and update these with the SOA Suite 11gR2 installation files. Make sure you do this as user soa otherwise the files have the wrong owner.

Finally I extended the domain I created for OSB with SOA Suite extension. I added the soa_server1 to the soa_machine I already created during the OSB configuration. I did not create a BAM server. So when I started the soa_server1 and opened the enterprise manager I saw a healthy green domain.

Mission accomplished!

This ends my journey. It was fun to do. Next time I think I will use the default oracle database installer instead of oratoolkit. It works fine oratoolkit but the oracle installer should be sufficient for a standard installation. I will also have a closer look at the performance of virtualbox and perhaps install everything on vm player just to see the difference.

Problems

1. Cannot run xterminal
error(s)

  1. Can't open display: xxx.xxx.xxx.xxx:0.
  2. xlib connection to 0.0 refused by server

Solution

  • Login as root
  • # xhost +
  • # su - username
  • # DISPLAY=:01
  • # export DISPLAY1
  • # run your script/start or binary that needs x1

1 You can try it without.

Hands-on: Run-time datasource selection with JCA adapters in the Oracle Service Bus 11g

The Oracle JCA database adapter enables the communication between a web service and a database object, for instance a stored procedure. With the adapter configuration wizard, part of JDeveloper 11g, meta data is generated design time and used run-time to control the behaviour of the database adapter. In this hands-on we show how to set run-time the database  by overriding the design time selected database in the Oracle Service Bus 11g.
Read the rest of this entry »

Automatic testing Oracle Service Bus using Hudson, maven and SoapUI

A lot of current projects are implementing some sort of service based architecture. Testing in this architecture becomes more complex. When implementing an OSB project with Scrum you test-automation is imperative. Scrum will require more frequent testing of your system. This is only feasible (in time and money) when you automate as much as possible.
 
Using soapUI you are able to create visually SOAP tests on your OSB implementation and running them against the defined infrastructure (develop, test, acceptance).  SoapUI enables with easy tools to implements verification and validation of the responses of your OSB implementation. When running the test you are also able to set limits in SLA response times on all the calls. This way you are able to monitor depreciation of performance in older parts of your OSB implementation when adding new services.
 
You can record and edit your SOAP test easy with the soapUI interface and edit it later. When you maven-enable your project it is quite easy running your tests when you implement the “maven-soapui-plugin” (see my other posting http://technology.amis.nl/blog/3061/automated-soap-testing-with-maven).  In the meantime version 3.0 of this plugin is released.
When implementing this with Hudson you do not have to convert the results.xml into a Surefire report. Hudson will manage this for you. Hudson will also enable you with an historical overview of all your test results.