Featured Posts

fusion11g

Oracle SOA Suite 11g, Setting and Getting Preferences

In Oracle Bpel 10g we had the functionality to add preferences to your bpel process.
By adding the next xml to the bpel.xml file we could get the value as variable into our process and change the value from the console.
[sourcecode language=”xml”] MyCurrentValue [/sourcecode]

In the new Oracle SOA 11g things changed a little but. Like Marc already described in his blog we now need to add the preferences to the composite.xml of our Composite Application.

Add the next xml to the composite.xml :
[sourcecode language=”xml”]

MyCurrentValue

[/sourcecode]
Now we can use the function ora:getPreference(myPref) in our bpel process to retrieve the value of the preference.
Watch the naming convention. It expects it to start with “bpel.preference”.

Create the composite application and deploy it.
We only added an assign to the flow which will get assign the value of the preference to the outputVariable.
Run the bpel and check if the value of ‘MyCurrentValue’ is in the outputVariable.
current_value

In Oracle SOA Suite 10g we could change the value of the preferences from the bpel console.
In Oracle SOA Suite 11g things changed a but, we got a new fancy console to manage all the components.
To change to values from the prefences go to the ‘Enterprise Manager’ (http://localhost:7001/em).

On the left go to :
Farm_soa_domain > Weblogic Domain > soa_domain > right mouseclick and select ‘System MBean Browser’.
mbean
Navigate to Application Defined MBeans > oracle.soa.config > Server : soa_server1 > SCAComposite > your_project > SCAComposite.SCAComponent > your bpel_process.
Select the Attribute ‘Properties’.
properties
Change the value of our preference and click apply.
preference

* Addition
There were some questions on how to persist the new value of the preference after server restart

After clicking ‘Apply’ click ‘Return’.
Go to the ‘Operations’ tab and click on the ‘save’ operation. Click ‘Invoke’ and ‘Return’

If you now restart the service the changed value of your preference with still be there.

Run the bpel again to see if the new value got used in the process.
new_value

Original blog

oracle, osb

Oracle Service Bus, JMS Request/Response pattern

Inspired by the article of Edwin about JMS Request Reply Interaction Pattern in Soa Suite 11g, i will show a little example of what functionality Oracle Service Bus supplies to implement the jms request/response (reply) pattern.
The solution is quiet simple.

Create the wls resources

  • Create JMS Server, MyJMSServer
  • Create JMS Modules, MyJMSResources
  • Create a Connection Factory, MyConnectionFactory
  • Create 2 queues, MyQueueIn (request message), MyQueueOut (response message)

wls_resources

Create the osb resource

  • Create a new proxy service, JMSRequestResponsePS
  • ps_1
    ps_2
    For the Endpoint URi, insert the url to In-queue
    ps_3
    Check the ‘Is Response Required’ option.
    We will use JMSCorrelationID for the Response Correlation Pattern.
    For the Response URI, insert the url to the Out-queue
    ps_4

Testing
Now test the flow by insert a little xml message in the MyQueueIn queue, wait a few seconds and check the MyQueueOut queue.
Only thing what’s left is to fill in the message flow of the proxy service and add some logica.

Original blog

osb

Oracle Service Bus, transporting large files fails

Error
[sourcecode language=”xml”]
weblogic.socket.MaxMessageSizeExceededException: Incoming message of size: ‘20000160’ bytes exceeds the configured maximum of: ‘20000000’ bytes for protocol: ‘t3’.
weblogic.socket.MaxMessageSizeExceededException: Incoming message of size: ‘20000160’ bytes exceeds the configured maximum of: ‘20000000’ bytes for protocol: ‘t3’
at weblogic.socket.AbstractMuxableSocket.incrementBufferOffset(AbstractMuxableSocket.java:262)
at weblogic.rjvm.t3.MuxableSocketT3.incrementBufferOffset(MuxableSocketT3.java:343)
at weblogic.socket.SocketMuxer.readReadySocketOnce(SocketMuxer.java:910)
at weblogic.socket.SocketMuxer.readReadySocket(SocketMuxer.java:859)
at weblogic.socket.EPollSocketMuxer.dataReceived(EPollSocketMuxer.java:215)
at weblogic.socket.EPollSocketMuxer.processSockets(EPollSocketMuxer.java:177)
at weblogic.socket.SocketReaderRequest.run(SocketReaderRequest.java:29)
at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:42)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:145)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:11
[/sourcecode]

Solution
Goto the Weblogic Console > Servers > AdminServer (or Managed Servers) > Protocols
Change the value of ‘Maximum Message Size’ to something which will succeed in your case.

Original blog

osb

Evaluating xpath expressions

This week we were messing around with a routing problem in one of the Oracle Service Bus projects.
We had an if-then-else construction which selects on the payload to see what transformation is needed and which business service it needs to call.

Example payload
[sourcecode language=”xml”]


VALUE1
1
VALUE2
10


[/sourcecode]

test1 : /EDI/CONF_UNB/SYNTAX_ID
result : node SYNTAX_ID with value ‘VALUE1’

test2 : count(/EDI/CONF_UNB/SYNTAX_ID) = 1
result : xs:boolean = true

test3 : /EDI/CONF_UNB/SYNTAX_ID = ‘VALUE1’
result : xs:boolean = true

test4 : count(/EDI/CONF_UNB/SYNTAX_ID = ‘VALUE1’)
result : xs:integer = 1
This is the approach we used, but looking at the result of test5, you will see it will always evaluate to true or 1 in this case.

test5 : count(/EDI/CONF_UNB/SYNTAX_ID = ‘VALUE2’)
result : xs:integer = 1

test6 : count(/EDI/CONF_UNB/SYNTAX_ID[text() = ‘VALUE2’])
result : xs:integer = 0

test7 : count(/EDI/CONF_UNB/SYNTAX_ID[text() = ‘VALUE1’])
result : xs:integer = 1

So for evaluation the xpath expression without being it embedded in an xquery function you can just select the node and compair it with a textvalue (/EDI/CONF_UNB/SYNTAX_ID = ‘VALUE1’).
When you want to compair the xpath expression with a textvalue from within a call to a xquery function you need to select the text-value of the node to which you compair (count(/EDI/CONF_UNB/SYNTAX_ID[text() = ‘VALUE2’])).

Routing works again!
Original blog

books, soa

Book review : Oracle SOA Suite Developer's Guide

Oracle SOA Suite Developer’s Guide

Finally i had some spare time to read this nice book!
It’s real bookshelf filler with 621 pages.

The book already got released before fusion 11g went live, but it was still nice to get some more information about the ‘old’ soa-suite stack.
Over at IT-eye we did quiet some soa implementations with the Oracle stack, so i already had good background on the information discussed in the book.
What i particularly was interested in was the best practices of others on the different components of the soa suite. When we start a project at IT-eye we have a default set of best practices and ways to go on how to implement certain functionality.
Matt Wright and Antony Reynolds gave a good overview of how to use the different components and what Oracles/their best use was for them.

Oracle also provides the Oracle SOA Suite Developer’s Guide as free guide on this internet, but this book discusses a lot of extra/advanced topics on the soa suite.
So i would recommend to read both to learn more and more about all the ins and outs of the soa suite. Since it delivers a lot of components in the stack, these 2 will give you a lot of good information.

Let’s go on with the book.

The book starts with a few topics with some basic information about the soa suite, the standards/frameworks which are used.
After that the components of the stack are getting discussed, writing your first bpel, implementing human workflow, adding bussines rules and building bam dashboards.

For starters the way to go. Get your hands dirty and just try to develop everything which is discussed in the book.
The authors explain it all real well, so it’s good step by step manual to get a feeling with all what the soa suite provides us.

Besides the real technical topics it gives some good information about the design concepts to implement (service enable existing systems, how too loosely couple services, design service contracts, good explanation about xsd schemas/wsdl and how to construct them).

To bring all of these topics in practise they added a use case called oBay. This one will be used in the whole book to implement all the functionality of the stack.
From developing the basics, adding rules, secure service invocations till testing and deployment, all will be reviewed.

And i was very pleased to see they even added the ‘new’ Oracle Service Bus (OSB) as subject of discussion to the book. They didn’t just added a topic for it, but after discussing every component in the soa suite stack, they added some extra information on how to implement this in the Oracle Service Bus. Sort of one on one compair to see what functionality is available in the new bus, good one!

Conclusion

I would really recommend this book to anyone who’s starting or already busy with the Oracle SOA Suite. The book discusses the 10g soa suite stack, but part of the components will be available as is, in the new fusion 11g stack. For example the implementation of Oracle Webservice Manager will be different.
Although there is a lot of information to read, it’s still all that well written it won’t take ages to finish it. The authors explain all very well by using good screengrabs and examples, so what i would recommend is to start up the soa suite, and get the hands on experience pon the topics the authors try to inform you about.

Book details

Contens

Section 1 Getting Started

  • Chapter 1: Introduction to Oracle SOA Suite: An initial introduction to the Oracle SOA Suite and its various components.
  • Chapter 2: Writing your first service: A hands-on introduction to the core components of the Oracle SOA Suite, namely the Oracle BPEL Process Manager and the Oracle Service Bus.
  • Chapter 3: Service-enabling existing systems: Looks at a number of key technology adapters and how we can use them to service-enable existing systems.
  • Chapter 4: Loosely coupling services: Describes how we can use the Oracle Service Bus to build services that are implementation-agnostic.
  • Chapter 5: Building composite services and business processes: Covers how to use BPEL to assemble services to build composite services and long-running business process.
  • Chapter 6: Adding in human workflow: This chapter looks at how human tasks can be managed through workflow activities embedded within a BPEL process.
  • Chapter 7: Using business rules to define decision points: This chapter introduces business rules and how we can use them to externalize “decision points” in a BPEL process.
  • Chapter 8: Building real-time dashboards: This chapter looks at how Business Activity Monitoring (BAM) can be used to give business users a real-time view into how business processes are performing.

Section 2 Putting it all together

  • Chapter 9: oBay introduction: Provides a blueprint for our SOA architecture, highlighting some of the key design considerations and describing how they fit our architecture for oBay.
  • Chapter 10: Designing the service contract: Gives guidance on how to design XML schemas and service contracts for improved agility, reuse, and interoperability.
  • Chapter 11: Building business services: Examines different approaches for building new business services either from scratch or by re-using existing logic.
  • Chapter 12: Building validation into services: Examines how we can implement validation within a service using XSD validation, Schematron, and Business Rules.
  • Chapter 13: Error handling: This chapter examines strategies for handling system and business errors, with detailed coverage of the BPEL Fault Management Framework.
  • Chapter 14: Message interaction patterns: Covers complex messaging interactions, including multiple requests and responses, timeouts, and message correlation (both system and business).
  • Chapter 15: Workflow patterns: Looks at how to implement workflows involving complex chains of approval and how to use the Workflow Service API.
  • Chapter 16: Using business rules to implement services: Here we look at the Rules engine’s inferencing capabilities, and how we can use them to implement types of business services.
  • Chapter 17: The importance of bindings: Looks at the protocols available in addition to SOAP over HTTP for invoking web services and the advantages they provide.

Section 3 Other considerations

  • Chapter 18: Packaging and deployment: Examines how to package up a SOA application for deployment into environments such as test and production.
  • Chapter 19: Testing composite applications: Looks at how to create, deploy, and run test cases that automate the testing of composite applications.
  • Chapter 20: Defining security and management policies: Details how to use Web Service Manager to secure and administer SOA applications.

You can order the book at Packt
Original blog

oracle aq, osb

Oracle Service Bus, publish small/big messages to Oracle AQ endpoint

The weird thing was for certain responses i couldn’t find the payload back when i queried the aq table in the database.
[sourcecode language=’sql’]
select qt.user_data.text_vc
, qt.user_data.text_lob
from my_aq_table qt
[/sourcecode]
The process just completed succesfull in osb, but the payload wasn’t there (well it looked like it wasn’t there).

queue_table_select

When publishing big payloads to an Oracle AQ endpoint, Oracle (db) will decide weither the payload will get stored either as text-value or clob-value.
Messages smaller then 4k will get inserted as text, messages bigger then 4k will get inserted as clob.

When you’ve stored a object type in the user_data column you can cast it with something like
[sourcecode language=’sql’]
select treat(qt.user_data as ).
from my_aq_table qt
[/sourcecode]

osb

Oracle Service Bus, jms request/response, response doesn't arrive

This week i was trying to make my proxyservice working in osb which was based on a jms transport, nothing fancy.
Just a normal request/response messageflow and the response needed to be published on a different queue.proxyservice

After testing the flow from the console all worked fine, request pipeline completed, response pipeline completed, but no messages in the response queue.
Looking at the definition of the proxyservice, we will notice the correlation pattern will make use of the JMSCorrelationID.
Since i use the easy way of testing (and this proved this isn’t the best way) by using the testconsole of the proxyservice, the jms properties will never be set.
To check this look in the invocation trace for ‘receiving request > $inbound’. In here we should see the values. Since they won’t be set the osb can’t correlate the response back and so the response will never be published to the queue.

From now on we will add a ‘publish’ folder to every osb project to fill our resources in a ‘real scenario’ way. It’s folder for all the testing resources.
In my case i just needed a simple business service with jms transport which would add a test-message on ‘queue_to_listen_on’.
Like this i can just trigger the process in the way it should happen, and others can re-use the testingtools.

Lets test with the businessservice, send a message to the queue. In the proxyservice i will log the inbound to see if the jms properties are set.

[sourcecode language=’xml’]
< [Pipeline_Request, Pipeline_Request_request, stage1, REQUEST] !!! debug, logging inbound variable !!!:


jms://queue_to_listen_on
request-response
best-effort

2
0
ID:707430ACF0811C4CE044000000000000
4
false
1249544242855
1
mdsplus
[/sourcecode]

Now we see the jms properties are set.

Lessons learned
Either put messages on the queue by use of the wls console, hermes or by using a dedicated business service. In these cases jms properties will be set and the correlation will succeed.

Original blog

weblogic

Weblogic, side-by-side deployment

Weblogic Server supports a nice feature called side-by-side deployment (or versioned deployment). This function is extremely usefull when you need to deploy a new version of an application and still keep the old one up and running. So the running instances will still use the current version and all new instances will be able to invoke the new deployed version of the application.
As soon as all the sessions who’re using the old version of the application are expired, Weblogic will recognize it and will deactivate the old version. So at this moment only the new deployed version is active and all new sessions will make us of it.

So how does this work.

You could either use wlst to deploy the application and specifiy the versionnumber on deployment as one of the parameters or you can use the manifest.mf file. We’ll be using the last one.

  1. Create a webservice project
  2. Edit to manifest file located in WebContent > META-INF and add the next on a new row : ‘WebLogic-Application-Version: v1’
    manifest
  3. Package the service and deploy it in the console

Deployment

  1. Go to the Weblogic Console > Deployments. Click ‘Lock & Edit’ and in the deployments part click Install
  2. Select the just created archive
    install-1
  3. Install this deployment as an application
  4. Optional Settings. And in here we will see the ‘Archive Version’ of our application. Change the name to ‘MyService’ and leave the rest on default value
    install-2

If you look in the list of deployments we will see our application is labeled with a version indication (v1).
deployment1
The current version is still active.

Now create a new version of the application and change the v1 in the manifest file to v2, and package it.

Update Deployment

  1. Go to the Weblogic Console > Deployments. Click ‘Lock & Edit’, select the application we want to update (MyService) and in the deployments part click Update
  2. Click Change Path of the source path and select the just created archive (v2), the application will be deployed as version v2

If we now look in the list of deployments, we will see 2 versions of our application deployed.
deployment2

Version v1 gets status ‘Retired’ and the new version v2 will get status ‘Active’.

Running instances
We have the next scenarios

  1. Version v1 is deployed. Deploy version v2. The new version v2 will get status ‘Active’ and the old version v1 will get status ‘Retired’.
    Since there aren’t any open sessions Weblogic will recognize this and changed the status of the version v1
  2. Version v1 is deployed and has open sessions. Deploy version v2. The new version v2 will get status ‘Active’ and the old version v1 will stay on status ‘Active’ untill all sessions to it will be closes. After that, Weblogic will change the status to ‘Retired’ and the only ‘Active’ version will be v2

Resources
http://edocs.bea.com/wls/docs100/deployment/redeploy.html#wp1020276
http://weblogic.sys-con.com/node/185310

Original blog

fusion11g

Oracle Fusion 11g links overview

A short overview of the resources i mostly use when developing fusion11g applications.
Since i’m always googling and googling to find the correct document, just a short list as reminder for myself.

Oracle JDeveloper 11g Tutorials
Oracle Fusion Middleware Documentation Library
Oracle Fusion Middleware Administrator’s Guide 11g Release 1 (11.1.1)
Oracle Fusion Middleware Installation Guide for Oracle SOA Suite 11g Release 1 (11.1.1)
Oracle Fusion Middleware Administrator’s Guide for Oracle SOA Suite 11g Release 1 (11.1.1)
Oracle Fusion Middleware Security Guide Release 1 (11.1.1)
Oracle Fusion Middleware Tutorial for Running and Building an Application with Oracle SOA Suite 11g Release 1 (11.1.1)
Oracle Fusion Middleware Developer’s Guide for Oracle SOA Suite 11g Release 1 (11.1.1)
Oracle Fusion Middleware Fusion Developer’s Guide for Oracle Application Development Framework 11g Release 1 (11.1.1)
Oracle Fusion Middleware 11gR1 Software Downloads
Oracle Fusion Order Demo Application
Deploying a JDeveloper SOA Application to Oracle WebLogic Server 11g

ORACLE SOA SUITE
Installation Guide
Quick Installation Guide
Upgrade Guide for Oracle SOA Suite, Oracle WebCenter, and Oracle ADF
Getting Started
Tutorial for Running and Building an Application
Developer’s Guide
Administrator’s Guide

ORACLE ADAPTERS
User’s Guide for Technology Adapters
User’s Guide for Oracle Applications

Oracle By Example (OBE)
Virtual Book : SOA Tasks
Oracle Sample Code
Check the blog of Marc for the overview of all the samplecode listed per product

FORUMS
SOA Suite
BPEL
Application Server (wls oc4j)
JDeveloper and ADF

I’ll update the list when i come by other usefull links

Original blog

osb

Oracle Service Bus, BEA-423405, java.lang.NullPointerException

When trying to browse the java libs from my osb project i get the next stacktrace in the console.

[sourcecode language=”java”]
Original blog