Wednesday, 20 November 2013

Ease up your SoaSuite deployment using global Tokens in composites

Yesterday a project-colleague pointed me to a cool new feature in SOASuite Patch set 6 (11.1.1.7).
Everyone who has done deployments of SOASuite throughout different stages within a Dev., Test, Acc. & Prod. lifecycle knows the throubles that end-pointreferences causes. One improvement in SOASuite 11g was the introduction of configuration plans. However those are not only environment specific, but also composite related. So for every composite you need one for every stage in the lifecycle.
In my release/deployment framework I solved this to have just a default generated configuration plan per composite, with development values. That one I 'subversioned' along with the composite.
Then in the (ant based) release proces I adapted the configuration plan for each composite, replacing each server reference with an ant-property. Then during the deploy I have conf plan copied to one that is specific for the target environment, replacing the properties based on a environment properties file.
Now in Patch Set 6, Oracle took that a level further. Now you can place those properties yourself in the composite on the references. There you replace the specific endpoints with those properties. In the EnterpriseManager you can bulk import the property values for the specific development-cycle stage using a "mdm-url-resolver.xml" xml file. But you can also enter or edit specific values one by one in the Enterprise Manager. For Ant users, the tokens have the same markup as Ant-properties.
This removes the need of configuration plans. Also it might be easier to clone for example a production environment to do for example a deployment test of  a new release.
Read all about it in the Oracle® Fusion Middleware Administrator's Guide for Oracle SOA Suite and Oracle Business Process Management Suite.

BTW.: this feature is mentioned to me by Tony van Esch, who wrote a little more elaborate blog on this himself.

Friday, 8 November 2013

Integrate BI-Publisher with OEM12c

Regularly I create VM's for courses as a 'Virtual Course Environment'. Earlier I did an install of Oracle Enterprise Manager 12c. But now there was a request for an integrated BI Publisher install.

Having an OEM12c install, the integration with BI Publisher with OEM12c is pretty straightforward. The install guide for this integration can be found here. This guide is part of the OEM12c 12.1.0.1 version, and for that version Oracle Business Intelligence Enterprise Edition 11g version 11.1.1.5. is required.

My OEM12c install is of version 12.1.0.2.0, so one patch set newer. Apparently the current OEM12c release is 12.1.0.3 (as of november '13).

The 11.1.1.6 release of BI-Publisher can be downloaded here. I initially installed the current 11.1.1.7 release that I downloaded here. However, when I ran the configureBIP script, from {OEM12c Home}/oms/bin, I got the following error:
[oracle@darlin-vce-db bin]$ ./configureBIP
Error: This script requires that BI EE Version "11.1.1.6.0" be installed, but "11.1.1.7.0" has been installed
So it's important to note that OEM12c install is of version 12.1.0.2.0 expects Oracle Business Intelligence Enterprise Edition 11g version 11.1.1.6.

By the way, the BI Publisher integration guide of OEM12c release 12.1.0.2.0  is found here. And 'surprisingly' it indeed states that it expects BI-Publisher 11.1.1.6. So, I could have known...

Wednesday, 10 July 2013

Current date and time in XLST under OSB

For my current assignment I needed to build quite complex transformations in OSB. Mainly because of my experiences I choose to do that in XSLT.
Eclipse has a quite nice XQuery mapper, but it lacks an XSLT mapper.
Since JDeveloper has a nice XSL Mapper tool, I incorporated a JDeveloper project in my OEPE OSB project.

Soon I found that the xpath2.0 functions of JDeveloper/SOASuite don't work under OSB. And I could not find how to use the XQuery functions in my Xslt, that do the same.

But I found a nice trick, mainly based on this forum post and this one. I adapted those examples a little, because of the wrong date formats and to get them working in my case.

First declare the following namspaces.
   xmlns:date="http://www.oracle.com/XSL/Transform/java/java.util.Date"
   xmlns:sdf= "http://www.oracle.com/XSL/Transform/java/java.text.SimpleDateFormat"
When examining those, it appears that "http://www.oracle.com/XSL/Transform/java/" tells the xsl-processor where to find java classes. And after that the path (package + class) to the actual java class can be appended. These prefixes should not get into the resulting xml, so you can add them to the exclude list:
     exclude-result-prefixes="... date sdf">
And then you can declare the next variables for the current date and the current time:
 
  <xsl:variable name="currentDate"><xsl:value-of select="sdf:format(sdf:new(&quot;yyyy-MM-dd&quot;),date:new())"></xsl:value-of></xsl:variable>
  <xsl:variable name="currentTime"><xsl:value-of select="sdf:format(sdf:new(&quot;hh:mm:ss&quot;),date:new())"></xsl:value-of></xsl:variable>
If you know java then you can figure out how that translates to a snippet of java code. And then you should be able to work out your way back. And doing so: you can program almost anything using java in XSLT...

Wednesday, 10 April 2013

Replacing JDK of JDeveloper 11.1.1.7 on 64 bit Oracle Linux 6

As mentioned yesterday, I installed Oracle SOA/BPM Suite 11g PS6 yesterday. It was on Oracle Linux 6 Update 3 (still have to update to Update 4).

Today I installed the accompanying JDeveloper 11.1.1.7 on the same machine. Everything went fine, except that apparently the installer failed to bring up a graphical UI.

Jdeveloper can then be started with


$JDEV_HOME/jdeveloper/jdev/bin/jdev
Where in my case in installed jdeveloper in:
$JDEV_HOME=/u01/app/oracle/jdeveloper/11.1.1.7

Doing so, to my surprice, I ran into the following exception:
[oracle@darlin-vce-db bin]$ ./jdev

Oracle JDeveloper 11g Release 1 (11.1.1.7.0)
Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. 

java.lang.UnsatisfiedLinkError: /u01/app/oracle/jdeveloper/11.1.1.7/jdk160_24/jre/lib/i386/xawt/libmawt.so: libXext.so.6: cannot open shared object file: No such file or directory
 at java.lang.ClassLoader$NativeLibrary.load(Native Method)
 at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1806)
 at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1702)
 at java.lang.Runtime.load0(Runtime.java:770)
 at java.lang.System.load(System.java:1003)
 at java.lang.ClassLoader$NativeLibrary.load(Native Method)
 at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1806)
 at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1723)
 at java.lang.Runtime.loadLibrary0(Runtime.java:823)
 at java.lang.System.loadLibrary(System.java:1028)
 at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50)
 at java.security.AccessController.doPrivileged(Native Method)
 at sun.awt.NativeLibLoader.loadLibraries(NativeLibLoader.java:38)
 at sun.awt.DebugHelper.(DebugHelper.java:29)
 at java.awt.Component.(Component.java:567)
 at oracle.ide.IdeCore.startupImpl(IdeCore.java:1171)
 at oracle.ide.Ide.startup(Ide.java:710)
 at oracle.ideimpl.DefaultIdeStarter.startIde(DefaultIdeStarter.java:35)
 at oracle.ideimpl.Main.start(Main.java:184)
 at oracle.ideimpl.Main.main(Main.java:146)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at oracle.ide.boot.PCLMain.callMain(PCLMain.java:62)
 at oracle.ide.boot.PCLMain.main(PCLMain.java:54)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at oracle.classloader.util.MainClass.invoke(MainClass.java:128)
 at oracle.ide.boot.IdeLauncher.bootClassLoadersAndMain(IdeLauncher.java:189)
 at oracle.ide.boot.IdeLauncher.launchImpl(IdeLauncher.java:89)
 at oracle.ide.boot.IdeLauncher.launch(IdeLauncher.java:65)
 at oracle.ide.boot.IdeLauncher.main(IdeLauncher.java:54)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at oracle.ide.boot.Launcher.invokeMain(Launcher.java:714)
 at oracle.ide.boot.Launcher.launchImpl(Launcher.java:116)
 at oracle.ide.boot.Launcher.launch(Launcher.java:69)
 at oracle.ide.boot.Launcher.main(Launcher.java:58)
 

Nice!
Jdeveloper comes with it's own JVM. It's installed in $JDEV/jdk160_24. And is (as guessed) the following version:
[oracle@darlin-vce-db 11.1.1.7]$ cd jdk160_24/bin/
[oracle@darlin-vce-db bin]$ ./java -version
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b50)
Java HotSpot(TM) Server VM (build 19.1-b02, mixed mode)

Apparenlty it's 32 bit. On this machine I earlier installed the 64 Oracle/Sun Hotspot JDK in
[oracle@darlin-vce-db bin]$ set |grep JAVA_HOME
JAVA_HOME=/usr/java/jdk1.6.0_43
Checking it's version will get:
[oracle@darlin-vce-db bin]$ java -version
java version "1.6.0_43"
Java(TM) SE Runtime Environment (build 1.6.0_43-b01)
Java HotSpot(TM) 64-Bit Server VM (build 20.14-b01, mixed mode)
To solve the exception above, I changed the jdev.conf in $JDEV_HOME/jdeveloper/jdev/bin to use my own 64-bit JDK.
#
# Directive SetJavaHome is not required by default, except for the base
# install, since the launcher will determine the JAVA_HOME.  On Windows
# it looks in ..\..\jdk, on UNIX it first looks in ../../jdk. If no JDK
# is found there, it looks in the PATH.
#
#SetJavaHome /u01/app/oracle/jdeveloper/11.1.1.7/jdk160_24
SetJavaHome  /usr/java/jdk1.6.0_43/
So find the SetJavaHome directive at the top and replace it with the path to your own. Apparently you should also be able to use JRockit with JDeveloper. Would be a nice try. Although I have to try if, for instance, the compiler works, but with the above change, JDeveloper started up fine.

Tuesday, 9 April 2013

Starting SOA/BPM Suite with wlst via nodemanager


Today I installed the brand new SOA and BPM Suite 11g PS6. The last few months for me were dedicated in deepdiving WebLogic to deliver a Tuning and Troubleshooting course for two customers.

Although it was not the first time to for me to install the suite, and I already have several bash-based scripts to start the server using the weblogic shell scripts, I wanted to use my conceived knowledge to create a WLST based tool to start weblogic.

To create the tutorials for the course I already created a script to create and startup a new test domain with an adminserver and a managed server. And for the course I downsized the script to be able to start the domain. So I only had to adapt the script to be able to use it to start my SOABPM Domain.

Having it started using the nodemanager and also having a seperate AdminServer enables you to use the Admin Console to restart your SOAServer. So if you have enough memory it is the way to go. If you have not  enough memory choose the development topology at creation of the SOA/BPM domain. In that case the domain is created with only an admin server that contains both the Admin Console, EM and SOA/BPM.

Now the script is as follows:
#############################################################################
# Start SOABPM Domain 
#
# @author Martien van den Akker, Darwin-IT Professionals
# @version 0.1, 2013-04-09
#
#############################################################################
print 'Set Properties';
wlHome=os.getenv("WL_HOME")
nmHome=wlHome+'/common/nodemanager';
nmHost=os.getenv("NM_HOST");
nmPort=os.getenv("NM_PORT");
nmType=os.getenv("NM_TYPE");

domainsHome='/u01/app/work/domains';
SOABPMDomainName=os.getenv("SOABPM_DOMAIN_NAME");
SOABPMDomainHome=os.getenv("SOABPM_DOMAIN_HOME");
adminServerName=os.getenv("ADMIN_SERVER_NAME");
adminServerPort=os.getenv("ADMIN_SERVER_PORT");
SOAServerName=os.getenv("SOA_SERVER_NAME");

adminUser='weblogic';
adminPwd='welcome1';

print 'Start Nodemanager'
startNodeManager(verbose='true', NodeManagerHome=nmHome, ListenPort=nmPort, ListenAddress=nmHost);

print 'Connect to the Node Manager';
nmConnect(adminUser, adminPwd, nmHost, nmPort, SOABPMDomainName, SOABPMDomainHome, nmType);

print 'Start AdminServer';
nmStart(adminServerName);

print 'Connect to the AdminServer';
connect(adminUser, adminPwd);

print 'Start ManagedServer: '+SOAServerName;
start(SOAServerName);

If you set your wls settings as follows:
. $FMW_HOME/wlserver_10.3/server/bin/setWLSEnv.sh
export PATH=$WL_HOME/common/bin/:$WL_HOME/server/bin:$PATH

Then you can start the script as follows:
wlst.sh ./startSOABPMDomain.py

Provided that you have set your $FMW_HOME and $WL_HOME correctly (probably dependent on each other as in my case) and also the environment variables used in the script. And that you saved the script above as 'startSOABPMDomain.py'.

To provide for this and to enable the script to get the settings from the environment (and have the settings shared amongst shell and wlst scripts I have the following wls_env.sh script:
#!/bin/bash
echo Setting Weblogic Environment
export ORACLE_BASE=/u01/app/oracle
export FMW_HOME=/u01/app/oracle/Middleware/11.1.1
export DOMAINS_HOME=/u01/app/work/domains
export SOABPM_DOMAIN_NAME=SOABPMDomain
export SOABPM_DOMAIN_HOME=$DOMAINS_HOME/$SOABPM_DOMAIN_NAME
export NM_HOST=darlin-vce-db
export NM_PORT=5556
export NM_TYPE=plain
export OHS_HOME=/u01/app/work/instances/ohs1
export ADMIN_SERVER_NAME=AdminServer
export ADMIN_SERVER_PORT=7001
export SOA_SERVER_NAME=soa_server1

. $FMW_HOME/wlserver_10.3/server/bin/setWLSEnv.sh
export PATH=$WL_HOME/common/bin/:$WL_HOME/server/bin:$PATH

I prefer to get my settings from the environment. This is because I already have a bash script that sets the WLS and domain paths. This keeps things centralized. Note that I also have to set the paths to wlst.sh. If you prefer to load the properties in from a file in a more java way, then an example is found here. The stop script should look like something like:

#############################################################################
# Stop SOABPM Domain 
#
# @author Martien van den Akker, Darwin-IT Professionals
# @version 0.1, 2013-04-09
#
#############################################################################
print 'Set Properties';
wlHome=os.getenv("WL_HOME")
nmHome=wlHome+'/common/nodemanager';
nmHost=os.getenv("NM_HOST");
nmPort=os.getenv("NM_PORT");
nmType=os.getenv("NM_TYPE");

domainsHome='/u01/app/work/domains';
SOABPMDomainName=os.getenv("SOABPM_DOMAIN_NAME");
SOABPMDomainHome=os.getenv("SOABPM_DOMAIN_HOME");
adminServerName=os.getenv("ADMIN_SERVER_NAME");
adminServerPort=os.getenv("ADMIN_SERVER_PORT");
SOAServerName=os.getenv("SOA_SERVER_NAME");

adminUser='weblogic';
adminPwd='welcome1';

print 'Connect to the AdminServer';
connect(adminUser, adminPwd);

print 'Stop ManagedServer: '+SOAServerName;
shutdown(name=SOAServerName, entityType='Server', force='true');

print 'Stop AdminServer';
shutdown();

print 'Connect to the Node Manager';
nmConnect(adminUser, adminPwd, nmHost, nmPort, SOABPMDomainName, SOABPMDomainHome, nmType);

print 'Stop the NodeManager';
stopNodeManager();

A few things I encountered, that got me into writing this article are the following.

It is important that you have the listen-address of the machine, that the soa_server1 is added to, is the valid host-name of the server running your SOASuite. It cannot be 'localhost' which is defaulted by the SOA/BPM Domain configurator. The value 'localhost' simply does not work, although it is perfectly pingable. So update it according to your server (it should also point to the correct host-ip-address):


Also make sure you have Type set to 'Plain' and the property SecureListener=false in the $WL_HOME/common/nodemanager/nodemanager.properties accordingly. Here's my nodemanager.properties file as an example. The commented lines (except for the first one) denote the properties that are changed by me, the rest is default

#Fri Mar 15 14:28:18 CET 2013
DomainsFile=/u01/app/oracle/Middleware/11.1.1/wlserver_10.3/common/nodemanager/nodemanager.domains
LogLimit=0
PropertiesVersion=10.3
DomainsDirRemoteSharingEnabled=false
AuthenticationEnabled=true
NodeManagerHome=/u01/app/oracle/Middleware/11.1.1/wlserver_10.3/common/nodemanager
JavaHome=/usr/java/jdk1.6.0_43/jre
LogLevel=INFO
DomainsFileEnabled=true
StartScriptName=startWebLogic.sh
ListenAddress=darlin-vce-db
NativeVersionEnabled=true
ListenPort=5556
LogToStderr=true
#SecureListener=true
SecureListener=false
LogCount=1
DomainRegistrationEnabled=false
#StopScriptEnabled=false
StopScriptEnabled=true
QuitEnabled=true
LogAppend=true
StateCheckInterval=500
CrashRecoveryEnabled=false
#StartScriptEnabled=false
StartScriptEnabled=true
LogFile=/u01/app/oracle/Middleware/11.1.1/wlserver_10.3/common/nodemanager/nodemanager.log
LogFormatter=weblogic.nodemanager.server.LogFormatter
ListenBacklog=50


Then on the domain set the nodemanager's  username password correctly. I don't know the defaults, but they're probably not 'weblogic' and 'welcome1' as per my default values:

And then under Advanced:


Now ensure that you have enrolled your domain to the nodemanager.Check if it's listed in the $WL_HOME/common/nodemanager/nodemanager.domains file.

Some of my nodemanager-troubleshooting-knowledge is from this blog.

Hope this helps and at least save me some searching around the next time I have to setup a SOABPM-domain...

Oh, and of course you can split these files up to only start or stop the soaserver provided that the AdminServer and nodemanager are already started. And  to create separate start/stop for the BAM server, since I intentionally did not include that one in the scripts.

Monday, 1 April 2013

BPM Suite PS6 released

Just a moment ago I found out that BPM Suite PS6 is released for download: http://soacommunity.wordpress.com/2013/04/01/bpm-suite-ps6-11-1-1-7-available-for-download/

In a previous blog I also wrote about the OFMW Partner forum in Portugal, where I could play around with it.

This week and next week I have to teach a Tuning and Troubleshooting training on Weblogic 11g. But there after I certainly going to play with it. Hope to provide you some images then.

Friday, 29 March 2013

Transparent replacement of Oracle workflow in Oracle Forms Applications by SOA

Yesterday I did a presentation about a project I did last year, where we replaced Oracle Workflow in an Oracle Forms application by SOASuite.
Often Oracle Workflow standalone edition, is used closely integrated within an Oracle Forms/Reports application. This means that you'll run in several issues:

  1. How do you start the proces in SOASuite from your Forms or database triggers?
  2. How do you handle end-user interactions: create notifications/tasks to your end users?
  3. What to do with the process-block activity?
  4. What to do with the automatic activities: the custom application services you call from the workflow process?
  5. And how to transform your workflow process to BPEL?
Then there were two main issues:
  1. Reset & Restart functionality, a.k.a. Expedite in Workflow
  2. Long running database transactions
About the latter I wrote two articles how we solved that technically:
I tried to upload my presentation to SlideShare, but that did not work properly. But the pdf of the presentation can also be found on the website of the Oracle Usersgroup Holland.
For non-Dutch visitors: it's in Dutch.