Featured Posts

soa, soasuite

Altova XMLSpy, testing custom functions in xsl transformations

In our middleware solutions (Oracle SOA Suite) we use a lot of xsl transformations.
Part of these transformations use database backend systems to do lookups for transforming internal values to external values (which can then be communicated to the customers).

In the Oracle SOA Suite you can create custom xsl function and store the jar in the domain/lib folder and then you will be able to use it in the xsl transformations.

We use Altova XMLSpy a lot for creating all these xsl transformations. To be able to test these custom functions in the xsl transformations you use the next in the xsl files to be able to execute the custom functions from within XMLSpy.

Simple example of how to call a java method to uppercase a string.

package nl.xenta.xsl;

public class Helper {
    public Helper() {
    }
    
    public static String formatName(String input) {
        return input.toUpperCase();
    }
}

And the xsl transformation calling the formatName method

<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xenta="java:nl.xenta.xsl.Helper?path=jar:file:///c:/xsl_functions.jar!/">
	<xsl:template match="/">
		<root>
			<emp>
				<xsl:value-of select="xenta:formatName('testing')"/>
			</emp>
		</root>
	</xsl:template>
</xsl:stylesheet>

Use “java:” to add the jar file to the xsl.

Now we can test the xsl transformation without deploying the bpel with the transformation first and test it on runtime.

Uncategorized

Oracle BPEL, retrieving the validate activity fault message

The ‘Validate’ activity in Oracle BPEL gives us the functionality to validate variables again schema definitions.
When using it in your bpel process you will get a nice informative message in the ‘Flow trace’.

validate1

When you’re using some generic error hospital functionality you also want this message to be available in there.
First try would be, add a Scope around the activity and catch the ‘invalidVariables’ System Fault.

When using a getFaultString on the fault variable or after assigning it to your own fault variable you will see the fault stack will be empty
validate2

	<myRuntimeFault>
		<part name="summary">
			<summary xsi:type="def:string"/>
		</part>
		<part name="detail">
			<detail xsi:type="def:string"/>
		</part>
		<part name="code">
			<code xsi:type="def:string"/>
		</part>
	</myRuntimeFault>

Because of some bug in the engine you won’t be able to get a handle to the fault message.

To be able to retrieve the fault message do the next.
Create a mediator in the composite based on a wsdl/operation which you ‘represent’ the element you’re trying to validate.

If you have a variable in your process like this :
variable name=”myEmployee” messageType=”emp:myEmployeeMessage”
or
variable name=”myEmployee” element=”emp:myEmployeeRef”

Then also create/use a wsdl which exposes an operation with the same messagetype/element in it.

In certain situations you will be validating an element which isn’t available directly in some operation in some wsdl (for example when you validate against an element which is only defined in a canonical xsd definition).
In that case just create a dummy wsdl/operation and use the element-definition in there, make sure you use the same namespace-structure.

Create the mediator based on this wsdl.
validate4

In the mediator enable the validateSchema option (true)

	<Mediator name="validateInput" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" wsdlTargetNamespace="http://xmlns.oracle.com/ValidateService/ValidateProject/ValidateProcess" xmlns="http://xmlns.oracle.com/sca/1.0/mediator">
	   <operation name="process" deliveryPolicy="AllOrNothing" priority="4" validateSchema="true"/>
	</Mediator>

We won’t be defining any routing rules, we just need the operation to validate the input and that’s it.
When the input isn’t validate it will trigger a remote fault which we will catch in our bpel process.

Instead of using the validate-activity, create an invoke to the mediator partnerlink.

validate3

As you can see, we now receive a fault stack back which includes our validation message.

The bpel will looking something like this :
validate5

The remote fault will be thrown by the mediator, in the second scope we now catch the remote fault instead of the invalid variables fault, and this fault variable does contain the information we need.

download : ValidateProject.zip

Uncategorized

Oracle JCA Database adapter and performance win on big clobs

In a few of our services in bpel and osb we’re inserting a lot of data (big payload messages) into the database by use of the jca db adapter.
We noticed performance would drop hugely when the db adapter needed to insert big payloads (CLOBS) and when the stream of messages on these services would continue even more performance would dramastically go down on the system.

After disabling “wrap data types” on the datasource in Weblogic we had a pretty good performance win on processing big clob messages into the database.

To disable wrapping of data type objects do the next :

  • Login the Weblogic Console
  • Click yourdomain > Services > Data Sources > your_datasource > Connection Pool > Advanced > disable Wrap Data Types

See this (Oracle® Fusion Middleware Configuring and Managing JDBC Data Sources for Oracle WebLogic Server 11g Release 1 (10.3.5) > 10 Tuning Data Source Connection Pools) document for extra information of the exact benefits of enabling/disabled the option

weblogic

Server subsystem failed. Reason: java.lang.NumberFormatException: null

Our admin server of the osb development environment failed to restart because of a full disk.
After cleaning up the admin server still wouldn’t start resulting in the next stack.

<Sep 28, 2012 10:18:16 AM CEST> <Critical> <WebLogicServer> <BEA-000386> <Server subsystem failed. Reason: java.lang.NumberFormatException: null
java.lang.NumberFormatException: null
        at java.lang.Integer.parseInt(Integer.java:454)
        at java.lang.Integer.parseInt(Integer.java:527)
        at weblogic.ldap.EmbeddedLDAP.validateVDEDirectories(EmbeddedLDAP.java:1104)
        at weblogic.ldap.EmbeddedLDAP.start(EmbeddedLDAP.java:242)
        at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
        Truncated. see log file for complete stacktrace
>
<Sep 28, 2012 10:18:16 AM CEST> <Error> <WebLogicServer> <BEA-000383> <A critical service failed. The server will shut itself down>

Locate the file :

ORACLE_HOME/user_projects/domain/your_domaim_name/servers/AdminServer/data/ldap/conf/replicas.prop

.. and remove it

In our case the file got corrupted (0byte file).
Removing the file, the file will get recreated with something like the next content :

[weblogic@my_machine conf]$ cat replicas.prop
#Generated property file
#Fri Sep 28 10:27:06 CEST 2012
replica.num=1
replica.0.name=OSB-MS1
replica.0.base=dc\=OSB
replica.0.port=7003
replica.0.hostname=my_hostname
replica.0.masterurl=ldap\://my_hostname\:7001/
replica.0.masterid=AdminServer
replica.0.secure=0
replica.0.binddn=cn\=Admin
replica.0.consumerid=OSB-MS1

Uncategorized

Oracle Service Bus 11g Development Cookbook is added to the OSB OTN Learn More page

Our book “Oracle Service Bus 11g Development Cookbook” has been added by Oracle to the “Learn More About Oracle Service Bus” section on OTN.
You can find it over here together with other usefull resources.

books

OTN Article : Three Recipes for Oracle Service Bus 11g got published

“Whip up a fresh batch of service- and message-oriented solutions with these recipes from the Oracle Service Bus 11g Development Cookbook”

Today two new items related to the Oracle Service Bus 11g Development Cookbook got published

OTN Article : Three Recipes for Oracle Service Bus 11g

Podcast Show Notes: Author Interview: Oracle Service Bus 11g Cookbook

Uncategorized

Oracle Fusion Middleware Partner Community Forum Malage, the overview

On the 7th and 8th of februari i attended the Oracle Fusion Middleware Partner Community Forum in Malaga.
A 4 day during event with other Oracle colleagues from other companies and from Oracle itself.

After taking a early flight from Schiphol Amsterdam, we arrived on time in Malaga. Great weather, compared to the -12 degrees in The Netherlands.

The agenda for the 4 days
The first day started with the next list of session :

  • Keynote Oracle Middleware Sales Strategy, Opportunities and Go-to-Market
  • Keynote Oracle Fusion Middleware Strategy & Direction
  • Partner SOA & BPM & Webcenter Reference Case
  • Keynote Automatic and Dynamic Publishing using Semantics and Webcenter Content
  • WebLogic 12c & Enterprise Manager 12c & ExaLogic for Fusion Middleware
  • ADF overview and roadmap

The day ended with the so called ‘Socal Network Event’. As usual Jurgen planned a great evening again for all of us.
Starting in El Pimpi restaurant with some drinks, delicious snacks and live music!

.. and to end up in Aleas Restaurant for a great dinner. Ideal moment to find out more about the new ps5/12c features and to finally get in contact with some friends of twitter.

The second day would be the more interested day with presentation about the new upcoming releases. Ideal to get in touch with the right persons and try to find out what’s coming up for us.
The interesting ones for me :

  • WebLogic what’s new in 12c
  • SOA Suite 11g overview, latest new features and directions
  • iAs to Wls
  • WebLogic automation & first WebLogic impressions

For the overall agenda see here.

The last 2 days we could follow the next hands-on trainings :

  • ADF & WebCenter MasterClass by Red Samurai, VASS, InfoMentum and Oracle
  • WebLogic 12c: Maciej Gruszka
  • SOA: Simone Geib & James

A list of upcoming features in one of the next minor upcoming releases (no guarantees, no dates!). Besides that some notes i made myself

SOA

  • Oracle Service Bus will make use of the ECID, so we will be able to trace down to OSB in the audit trial of the instances in the EM
  • Unified exception handling framework (“Error hospital”) (search/delete/recover failed instances)
  • Alerts for stuck messages (eventually these alerts will have the same destinations like the alerts from OSB), extra search options in the EM for these type of instances (stuck messages, ECID, etc)
  • Testing individuals bpel processes from the composite. Support for assertions, fast forward for wait activities
  • New transactions properties (required/requiresNew) for sync and oneway bpel processes (initiating calls). Able to set those on creation of the process instead of in the xml after creating.
  • New delivery proprties (async.persists/async.cache/sync) for async and oneway processes. (async.persist = save message in delivery store before picked up by engine, async.cache = in memory and sync = no save al all)
  • New property inspector for composite properties, instead of xml editing
  • Support for bpel 2.0 Dynamic Partnerlinks
  • Skip Condition on activities for bpel 2.0
  • Throw faults on failed assertions
  • Set timeouts on request/reply and in-only operations
  • Copy/paste functionality, for copying parts of your process in design time
  • Reduced memory footprint (let’s hope this time it will run fine on my mega dell laptop)
  • Enhanced purging strategies (
  • Out of the box integration with WebLogic Diagnostic Framework (WLDF) and Diagnostics Framework(DFW)
  • Coherence integration with DB adapter (cache usage = read/read-write)
  • Template support for composites
  • Besides XSLT also support for XQuery (like in OSB)
  • Out of the box scheduler (ESS) for scheduling webservices, adapters, ejb, plsql, etc

OSB

  • Improved RESTful webservices
  • Assign Transport Policies via OWSM
  • Apply policy to local proxies
  • Optimization importing jars containing an big amount of artificats
  • New console with OSB Designer and OSB Dashboard
  • OSB service will get same kind of composite overview in JDeveloper (Exposed services/Components/External Services)

JDeveloper

  • OSB, CEP, Composites, etc in 1 IDE
  • Better support for debug and tracing in JDEV
  • AIA support in OSB

Weblogic

  • Java EE 6 and Developer Productivity
  • Integrated Traffic Management
  • Better performance
  • Oracle Virtual Assembly Builder (OVAB) support
  • Better Maven integration
  • Latest Spring framework support
  • -Dservertype=wlx, launch instance without ejb, jms and jca containers
  • FastSwap
  • Option for storing transactions logs in de DB instead of filestore
  • Enhanced Disaster Recovery and High Availability
  • Deploy Glassfish application on Weblogic (detection of Glassfish descriptor)

Overall a great event again.
Thanks go out to Jürgen Kress and Hans Blaas for organizing it!

books, osb

Oracle Service Bus 11g Development Cookbook has been published!

Good news today from the publisher!
The book of which i’m coauthor of has been published! After months of hard work it’s finally there.

Oracle Service Bus 11g Development Cookbook : http://www.packtpub.com/oracle-service-bus-11g-development-cookbook/book

I hope you will all like it.

Thanks to the other authors (Guido, Edwin, Jan and Mischa) for all their hard work and for the great few months of working together to establish this great piece of work.
Special thanks go out to Guido for guiding the whole process of making this book. All the hours of hard work and organizing everything, i hope it was worth it!

The book

Something about the book (which i nicely copy/pasted from Guido his blog)

The book contains more than 80 practical recipes to develop service- and message-oriented solutions on the Oracle Service Bus 11g.

This cookbook is full of immediately usable recipes showing how to efficiently develop on the Oracle Service Bus. In addition to its cookbook style, which ensures the solutions are presented in a clear step-by-step manner, the explanations go into great detail, which makes it good learning material for everyone who has experience with the OSB and wants to improve. Most of the recipes are designed in such a way that each recipe is presented as a separate, standalone entity and reading of prior recipes is not required. The finished solution of each recipe is also made available electronically.

The 80+ recipes are organized into the following chapters (the digit behind the title showing the number of recipes in that chapter):

  • Creating a basic OSB service (13)
  • Working efficiently with OSB artifacts in Eclipse OEPE (7)
  • Messaging with JMS transport (9)
  • Using EJB and JEJB transport (5)
  • Using HTTP transport (5)
  • Using File and Mail transports (5)
  • Using JCA adapter to communicate to the database (6)
  • Using SOA Direct transport to communicate with SOA Suite (4)
  • Communication, Flow Control and Message Processing (10)
  • Reliable communication with OSB (5)
  • Handling Message-Level Security requirements (9)
  • Handling Transport-Level Security requirements (4)

Happy reading!

Reviews

AMIS blog : Review of Oracle Service Bus 11g Development Cookbook (Packt Publishing) by Edwin Biemond, Guido Schmutz, Eric Elzinga et. al.
SOA@Oracle SCA, BPEL, BPM & Service Bus blog

osb

Oracle Service Bus : Using custom xpath functions in xslt

One of the readers of my blog post ‘Oracle Service Bus 11g, Using Custom Xpath Functions asked we can reuse the custom xpath functions in a xsl transformation.

It’s possibel to reuse the jar and calll the custom functions from within a xsl transformation.

Starting with creating the resources needed for the custom xpath function :

  1. XML Configuration file (osb-custom.xml)
  2. Property file (optional, osb-custom.properties)
  3. Custom Function Class (jar package)

Restart the osb service so the new jar will get loaded.

- Create a new osb project
- Create a new xslt

	<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:cust="xalan://nl.xenta.osb.custom.functions.OsbUtils">
		<xsl:variable name="param1" select="string('the beginning')"/>
		<xsl:variable name="param2" select="string('the end')"/>
		<xsl:template match="/">
			<xsl:variable name="my_custom_concat" select="cust:customConcat($param1,$param2)" />
			<the_result><xsl:value-of select="$my_custom_concat"/></the_result>
		</xsl:template>
	</xsl:stylesheet>

To be able to call a custom xpath function with the Xalan engine we need to add a new namespace_prefix + definition the the xsl

xmlns:cust="xalan://tests.pipeline.CustomXQFunctions"

- Start with xalan://
- Then the java package + classname, nl.xenta.osb.custom.functions.OsbUtils
- In the select of the value-of we eventually use the namespace-prefix + java method interface to call the java method, cust:customConcat($param1,$param2)

Create a new proxy service and use the xsl in for example an assing activity.
Deploy the service and use the testconsole to test it.

soasuite

Oracle SOA Suite : import in xsl from mds location

In one of my xsl transformations i needed to import a generic xsl from the mds store.
For this i created a new jdeveloper application with a soa sar deployment descriptor and jar descriptor in it.

Contents of the jar :

	SharedMDSResources/generic.xsl

When i browse the mds repository i see the SharedMDSResources folder in the root of the tree (instead of in the apps folder).

For testing i deployed the jar manually in the EM.


In my xsl i use the next import :

  <xsl:import href="oramds:/SharedMDSResources/generic.xsl"/>

Resulting in the next stacktrace :

The following exception occurred while attempting to execute operation copy at line 389
<exception class="com.collaxa.cube.xml.xpath.XPathException">
<parsererror style="display: block; white-space: pre; border: 2px solid #c77; padding: 0 1em 0 1em; margin: 1em; background-color: #fdd; color: black">
<h3>This page contains the following errors:</h3>
<div style="font-family:monospace;font-size:12px">
error on line 7 at column 1: Extra content at the end of the document
</div>
<h3>Below is a rendering of the page up to the first error.</h3>
</parsererror>
XPath expression failed to execute.
An error occurs while processing the XPath expression; the expression is ora:doXSLTransformForDoc('xsl/format_dates.xsl', $csvXml).
The XPath expression failed to execute; the reason was: XML-22000: (Fatal Error) Error while parsing XSL file (oramds:/deployed-composites/default/mycomposite_rev1.0/xsl/my_process.xsl<Line 3, Column 46>: XML-22002: (Fatal Error) Error while processing include XSL file (oramds:/SharedMDSResources/generic.xsl).)..
Check the detailed root cause described in the exception message text and verify that the XPath query is correct.
<stack>
<f>com.collaxa.cube.xml.xpath.BPELXPathUtil.evaluate#262</f>
<f>com.collaxa.cube.engine.ext.bpel.common.BPELWMPHelper.evalFromValue#339</f>
<f>com.collaxa.cube.engine.ext.bpel.v1.wmp.BPEL1AssignWMP.__executeStatements#137</f>
<f>com.collaxa.cube.engine.ext.bpel.common.wmp.BaseBPELActivityWMP.perform#158</f>
<f>com.collaxa.cube.engine.CubeEngine._performActivity#2463</f>
<f>com.collaxa.cube.engine.CubeEngine.performActivity#2334</f>
<f>com.collaxa.cube.engine.CubeEngine.handleWorkItem#1115</f>
<f>com.collaxa.cube.engine.dispatch.message.instance.PerformMessageHandler.handleLocal#73</f>
<f>com.collaxa.cube.engine.dispatch.DispatchHelper.handleLocalMessage#220</f>
<f>com.collaxa.cube.engine.dispatch.DispatchHelper.sendMemory#328</f>
<f>com.collaxa.cube.engine.CubeEngine.endRequest#4350</f>
<f>com.collaxa.cube.engine.CubeEngine.endRequest#4281</f>
<f>com.collaxa.cube.engine.CubeEngine.createAndInvoke#679</f>
<f>com.collaxa.cube.engine.delivery.DeliveryService.handleInvoke#654</f>
<f>com.collaxa.cube.engine.ejb.impl.CubeDeliveryBean.handleInvoke#293</f>
<f>sun.reflect.GeneratedMethodAccessor944.invoke</f>
<f>...</f>
</stack>
</exception>

Problem

Since i deployed the jar manually from within the EM the SharedMDSResources folder will not be created in the apps-dir but in the root of the tree.
The oramds imports can only import from within the apps folder structure.

Solution

When manually creating the jar archive make sure the contributor has the apps-directory already in the path

Path : d:\SharedMDS\apps\SharedMDSResources\

After the import the mds repository will contain the path ‘oramds:/apps/SharedMDSResources/generic.xsl’

Or keep the jar as it was (folder/file structure = SharedMDSResources/generic.xsl) and use the scripts from for example Edwin and setup the ‘mds.reposistory’ correctly (ending with the apps-directory in it).

Page 1 of 1012345...10...Last »