RSS

Category Archives: OSB

Oracle Service Bus

Oracle Service Bus 11g – Another session operation is in progress. Please retry later.

Since our Bamboo pipeline uses the same account for deployments we sometimes get this error “Another session operation is in progress. Please retry later.” during deployment.
So 1st of all, don’t use the same user (like weblogic) to deploy when your with a lot of developers / build pipelines / etc.
Time for us to use multiple users for each agent (or think of something else really smart), but in the meanwhile we sometimes have to discard the changes from an open session.

sbconsole -> View all Sessions -> Select session -> Discard all changes

2

1

However sometimes the sbconsole does not allow this action and we need to restart the Admin + Managed server.
Usually this fixes the issue, however this time it didn’t.

Luckily for us the great Pierluigi has a blog which tells us to clear the OSB domain session folder, so:

  • shutdown the Admin + Managed servers
  • clear all the SessionXXX folders in the ${DOMAIN_HOME}/osb/config/sessions
  • start the environment

The content of

[oracle@server sessions]$ ls -l
drwxr—–. 5 oracle oinstall 4096 Jan 13 13:22 SessionScript1452682586592
drwxr—–. 5 oracle oinstall 4096 Jan 13 13:22 SessionScript1452687725653
[oracle@server sessions]$ rm * -rf

References

 
Leave a comment

Posted by on 13-01-2016 in OSB

 

Tags: , ,

How to use dynamic validate in Oracle Service Bus 12c

One of the new features introduced in Oracle Service Bus 12c is the ability for dynamic validation. A feature which can be used to validate a message against a WSDL or XSD schema file which is both explained here by Oracle. The example on the Oracle website shows this XML code to validate against a XSD:

<validate xmlns="http://www.bea.com/wli/sb/context">
<schema>default/MySchema</schema>
<schemaElement>
<localname>MyElementType</localname>
</schemaElement>
</validate>

However I tried “playing” with the new feature but couldn’t get it to work. The error I got was:

<soap:Fault>
<soap:Code>
<soap:Value>soap:Receiver</soap:Value>
</soap:Code>
<soap:Reason>
<soap:Text xml:lang="nl">OSB-382524: Failed to perform validation</soap:Text>
</soap:Reason>
<soap:Detail>
<con:fault xmlns:con="http://www.bea.com/wli/sb/context">
<con:errorCode>OSB-382524</con:errorCode>
<con:reason>Failed to perform validation</con:reason>
<con:location>
..
</con:location>
</con:fault>
</soap:Detail>
</soap:Fault>

After contacting Oracle Support I received the following info:

  • BUG 20367846: Internal Documentation  – Validate action to dynamically select a schema – documentation is not clear
  • BUG 20380158: Validate action – Dynamic validation throws NPE

A patch for BUG 20380158 was then released for Oracle Service Bus 12.1.3, which then could be downloaded from Oracle Support:

ppatch

I downloaded patch 20380158 and used opatch to install it on my DEV environment.


..\p20380158_121300_Generic\20380158&amp;gt;opatch apply
Oracle Interim Patch Installer version 13.2.0.0.0
Copyright (c) 2014, Oracle Corporation.  All rights reserved.

Oracle Home       : C:\ORACLE\middleware_12.1.3
Central Inventory : C:\Program Files\Oracle\Inventory
from           : n/a
OPatch version    : 13.2.0.0.0
OUI version       : 13.2.0.0.0

OPatch detects the Middleware Home as &quot;C:\ORACLE\middleware_12.1.3&quot;

jul 09, 2015 12:48:49 PM oracle.sysman.oii.oiii.OiiiInstallAreaControl initAreaControl
INFO: Install area Control created with access level  0
Applying interim patch '20380158' to OH 'C:\ORACLE\middleware_12.1.3'
Verifying environment and performing prerequisite checks...
All checks passed.

Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = 'C:\ORACLE\middleware_12.1.3')

Is the local system ready for patching? [y|n] y
User Responded with: Y
Backing up files...

Patching component oracle.osb.server, 12.1.3.0.0...
Patching component oracle.osb.server, 12.1.3.0.0...

Verifying the update...
Patch 20380158 successfully applied
OPatch succeeded.

After the patch the error was still their but I received a more detailed error message in my logging:

<soap:Fault>
<soap:Code>
<soap:Value>soap:Receiver</soap:Value>
</soap:Code>
<soap:Reason>
<soap:Text xml:lang="en">OSB-382571: Schema element: GetCaseRequestMessage not found</soap:Text>
</soap:Reason>
<soap:Detail>
<con:fault xmlns:con="http://www.bea.com/wli/sb/context">
<con:errorCode>OSB-382571</con:errorCode>
<con:reason>Schema element: GetCaseRequestMessage not found </con:reason>
....
</con:fault>
</soap:Detail>
</soap:Fault>

After more contact with Oracle Support it indeed appeared that the Oracle documentation was not correct (as mentioned earlier with their reference to BUG 20367846). The XML structure example shown by Oracle also requires an nameSpaceURI element.  Which means the correct XML input for dyanamic validation for an XSD is:

<validate xmlns="http://www.bea.com/wli/sb/context">
<schema>mySBproject/schema/myXsdSchemaFile</schema>
<schemaElement>
<namespaceURI>nl.rubix.messages/caseservice/1.0</namespaceURI>
<localname>getCaseRequestMessage</localname>
</schemaElement>
</validate>

Example Oracle Service Bus Project with Dynamic Validation

Here is an example of my SB project:

pipeline

I first use an Assign action in my pipeline to create the $dynValidate variable with XQuery which holds the XML structure for the validation. (You could also use the xquery directly on the validate action).

assign_xquery

Here is an example XQuery to generate the required Dynamic Validate XML structure:


xquery version "1.0" encoding "utf-8";
(:: OracleAnnotationVersion "1.0" ::)
(:: pragma parameter=”$i_operation” type=”xs:string” ::)

declare function local:dynValidate($i_operation as xs:string) as element()
{
<validate xmlns="http://www.bea.com/wli/sb/context">
<schema>mySBproject/schema/myXsdSchemaFile</schema>
<schemaElement>
<namespaceURI>nl.rubix.messages/caseservice/1.0</namespaceURI>
{
if ($i_operation = "getCase")
then <localname>getCaseRequestMessage</localname>
else if ($i_operation = "insertCase")
then <localname>insertCaseRequestMessage</localname>
else ()
}
</schemaElement>
</validate>
};

declare variable $i_operation as xs:string external;
local:dynValidate($i_operation)

After we have the $dynValidate variable we can use it as input for the Validate action. (As mentioned, you can also directly use the Xquery here instead of an expression with the earlier generated variable.

validate

Hope it helps!

References

 
Leave a comment

Posted by on 29-07-2015 in Oracle, OSB

 

Tags: , ,

How to customize your Service Bus 12c pipeline templates

One of the new features in Service Bus 12c is the ability to use pipeline templates. Usually the Oracle Service Bus pipelines in an environment have many common steps. Think of the re-use of logging, error handling, alerts and pattern + naming convention for your stages. In practice with OSB 11g we often used a “template” or existing OSB project which we then copied and modified. With the “clone” option of 12c this task is already easier, but the use of pipeline templates is even better. Since templates and concrete pipelines (generated pipelines from a template) remain linked we can update our services easier with new insights. For example, when you want to change your default logging or fault handling behavior.

Index:

To use pipeline templates to their fullest potential we can customize them to our own needs. For this we have multiple options.

Generic configuration

The essential configuration of most actions can be left empty in the template without any problem. As soon as they are implemented in concrete pipelines the actions there will come into an ERROR state. The example below shows the Routing which is empty in the pipeline template. When developing the concrete pipelines we can then easily set the correct business service.

Empty

Many actions, like Validate, allow us to use generic configuration of the Location instead of specific elements from the service datamodel. By using generic configuration as ./*[1] we can tell the Validate action to validate the 1st element in the SOAP body. Which normally would be your getMessageRequest or getMessageResponse element. The correct element and schema  to validate against should still be selected in the concrete pipeline.

validate

Dummy values

Unlike most actions, the problem with the Replace action seems that when you leave the XSLT or XQuery of choice empty, the template will turn into an error state. To prevent this from happening I use a dummy XQuery file in my CommonObjects project and assign it from all Replace actions I use for transformation of messages..


transform

Locking actions

We can set each individual action in our template to a “locked” state. With this preventing the developer of the concrete pipeline to change certain locked logic of the service. This is quite usefull for default logging and fault handling you want to enforce in your services. Right-click on each specific action you want to lock and choose “Lock Action”. Sadly there is no graphical representation to quickly show you which actions are locked.

logging

Using template placeholders

We can use template placeholders to allow developers using the template to customize the concrete pipeline to the extend that we determine in the template. We can allow customization of unlimited stages, nodes and route, but in most cases you will probably use the most strict placeholder “Actions”. In the example below we show a stageEnrich which allows the developer to add unlimited amount of actions in this stage. Actions like Service Callouts, Transforms, Logging, etc to make sure we can extend our service. With this, creating enough flexibility for the developer to customize the logic for the concrete pipeline, without changing the default we want to enforce for logging, error handling, etc.

d01

 

Enrich

References

 
4 Comments

Posted by on 09-06-2015 in OSB

 

Tags: , ,

Patching your JDeveloper 12.1.3 with SOA/BPM Bundle Patch 12.1.3.0.2

The SOA(/BPM) Bundle Patch 12.1.3.0.2 is available for download from Oracle Support (http://support.oracle.com)
Just use the search on patch number ‘20423408’ and it will bring you the patch details page with the download (approx. 662MB).
You can deploy the patch on top of your basic 12.1.3.0.0 or the earlier released SOA Bundle Patch 12.1.3.0.1

So I patched my own JDeveloper 12.1.3 environment with the OPATCH tool.
Extract the downloaded patch, I’ll use C:\temp\p20423408_121300_Generic\20423408
This folder is called ‘patch_TOP’ in opatch terminology.

Since I use Windows as local OS you will need to First open a command prompt with Administrator rights (right-click, run as Administrator).
If we don’t use the right permissions we will get the error: Unable to lock Central Inventory. OPatch will attempt to re-lock

Naamloos

First we set our ORACLE_HOME to the Jdeveloper 12.1.3 folder:
SET ORACLE_HOME=C:\ORACLE\middleware\12.1.3
And make sure opatch is in our path:
SET PATH=%PATH%;C:\ORACLE\middleware\12.1.3\OPatch
We browse to the patch_top folder:
cd C:\temp\p20423408_121300_Generic\20423408
And run opatch:
opatch apply

/opatch apply
Oracle Interim Patch Installer version 13.2.0.0.0
Copyright (c) 2014, Oracle Corporation. All rights reserved.

Oracle Home : C:\ORACLE\middleware\12.1.3
Central Inventory : C:\Program Files (x86)\Oracle\Inventory
 from : n/a
OPatch version : 13.2.0.0.0
OUI version : 13.2.0.0.0
Log file location : C:\ORACLE\middleware\12.1.3\cfgtoollogs\opatch\20423408_May_
29_2015_14_43_43\apply2015-05-29_14-43-25PM_1.log

OPatch detects the Middleware Home as "C:\Oracle\Middleware\12.1.3"

mei 29, 2015 2:43:44 PM oracle.sysman.oii.oiii.OiiiInstallAreaControl initAreaControl
INFO: Install area Control created with access level 0
Applying interim patch '20423408' to OH 'C:\ORACLE\middleware\12.1.3'
Verifying environment and performing prerequisite checks...
Patch 20423408: Optional component(s) missing : [ oracle.integration.bpm, 12.1.3.0.0 ] , [ oracle.mft.apache, 12.1.3.0.0 ] , [ oracle.bpm.processspaces, 12.1.3.0.0 ] , [ oracle.mft, 12.1.3.0.0 ] , [oracle.soa.workflow.wc, 12.1.3.0.0 ]

Patch [ 20423408 ] conflict with patch(es) [ 19707784 ] in the Oracle Home.

To resolve patch conflicts please contact Oracle Support Services.
If you continue, patch(es) [ 19707784 ] will be rolled back and the new Patch [ 20423408 ] will be installed.

Do you want to proceed? [y|n]
User Responded with: Y

OPatch will roll back the subset patches and apply the given patch.
All checks passed.

Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = 'C:\ORACLE\middleware\12.1.3')

Is the local system ready for patching? [y|n]
User Responded with: Y

Backing up files...
Rolling back interim patch '19707784' from OH 'C:\ORACLE\middleware\12.1.3'
Patching component oracle.bpm.addon, 12.1.3.0.0...
Patching component oracle.rules, 12.1.3.0.0...
Patching component oracle.bpm.plugins, 12.1.3.0.0...
Patching component oracle.soa.mgmt, 12.1.3.0.0...
Patching component oracle.integration.bam, 12.1.3.0.0...
Patching component oracle.soa.common.adapters, 12.1.3.0.0...
Patching component oracle.soacommon.plugins, 12.1.3.0.0...
Patching component oracle.integration.soainfra, 12.1.3.0.0...
RollbackSession removing interim patch '19707784' from inventory

OPatch back to application of the patch '20423408' after auto-rollback.
Patching component oracle.rcu.soainfra, 12.1.3.0.0...
Patching component oracle.bpm.addon, 12.1.3.0.0...
Patching component oracle.rules, 12.1.3.0.0...
Patching component oracle.bpm.plugins, 12.1.3.0.0...
Patching component oracle.soa.mgmt, 12.1.3.0.0...
Patching component oracle.integration.bam, 12.1.3.0.0...
Patching component oracle.soa.common.adapters, 12.1.3.0.0...
Patching component oracle.soacommon.plugins, 12.1.3.0.0...
Patching component oracle.integration.soainfra, 12.1.3.0.0...
Verifying the update...
Patch 20423408 successfully applied
Log file location: C:\ORACLE\middleware\12.1.3\cfgtoollogs\opatch\20423408_May_29_2015_14_43_43\apply2015-05-29_14-43-25PM_1.log
OPatch succeeded.

 
8 Comments

Posted by on 09-06-2015 in Oracle, OSB, SOA Suite

 

Tags: , , , ,

How to create a Service Bus 12c pipeline template

One of the new features in Service Bus 12c is the ability to use pipeline templates. Usually the Oracle Service Bus pipelines in an environment have many common steps. Think of the re-use of logging, error handling, alerts and pattern + naming convention for your stages. In practice with OSB 11g we often used a “template” or existing OSB project which we then copied and modified. With the “clone” option of 12c this task is already easier, but the use of pipeline templates is even better. Since templates and concrete pipelines (generated pipelines from a template) remain linked we can update our services easier with new insights. For example, when you want to change your default logging or fault handling behavior.

Index:

There are multiple ways to create pipeline templates, in this blogpost we will show 2 common options.

Empty template

In this example I will use a common project in my JDeveloper SBApplication named “CommonObjects” with a folder “templates” to host my templates.
While selecting the templates folder we first select New -> Pipelin Template from the JDeveloper menu

a00

In the next wizard step we can select a name for the new template. For now we will leave the “from pipeline” option empty. For the template naming convention I have chosen to include the transport choice (in this case SOAP 1.2).

b02

b03

The result is an empty template which you can customize by adding message flow actions from the Components palette.

b04

b05

Generate template from existing pipeline

However in most environments you will likely have some existing services which contain logic that you want to re-use in the form of pipeline templates. In that case we we can repeat the step New -> Pipeline Template. However this time we select the “from pipeline” option in the wizard. In the example we will generate a pipeline template from our earlier created entity GetCaseservice. The purpose is to use the newly created the new PipelineTemplate_soap12_entity for multiple new SOAP 1.2 entity services we will generate in the near future.

c01

c02

c03

 

The result is a basic template we can re-use for our new pipelines / services.

Notes

  • You cannot create pipeline templates in the SB console, only in JDeveloper 12c. You can however see template resources in the SB console project navigator.
  • You can manually refresh your templates in JDeveloper. You will need this from time to time and for some reason these are seperated from your application artifacts regarding refresh options.

a01

 

 
3 Comments

Posted by on 09-06-2015 in Oracle, OSB

 

Tags: , ,

How to use the Domain Value Map (DVM) in Oracle Service Bus 12c

Introduction

Due to the tighter integration of Oracle Service Bus 12c in the whole Oracle SOA Suite product it’s now much easier for developers to use general SOA Suite components like the Domain Value Map (DVM).

Getting Started

First I use the OSB 12c clone project ability to copy th earlier created/blogged OSB 12c Database adapter project and create a project named GetCaseServiceDVM. In the new project we add a Domain Value Map (DVM):

01

The file name and description speak for themself. The Initial DVM Entries forces us to define the minimum amount of 2 domain names (source and target of our value) and if we want we can inmediately configure the 1st record here.

02

The result is a DVM file in our project which we can easily edit within JDeveloper 12c.
For this blogpost we will add 2 records which will allow us to translate the value “1” and “2” which we receive from the database to a basic description of that value.

03

In our XSLT transformation we can drag the DVMFunctions:lookupValue on our canvas.
(You can easily find the function using the search function in components)

04

05

Finally we can configure the DVM input fields with the 5 arguments:

  1. The relative path (including the SBProject to your DVM file without mentioning the .DVM extension)
  2. Source table
  3. mapping of the input element we want to translate
  4. Target table to retrieve that specific output value
  5. Default value, in case no match was found in the DVM

06

In the source code of the XSLT this will look like this:

<tns:Type id="{/ns0:OutputParameters/ns0:GET_CASE_BY_CASENUMBER/ns0:CASETYPE}">
<xsl:value-of select='DVMFunctions:lookupValue ("GetCaseServiceDVM/CaseType", "Type", string (/ns0:OutputParameters/ns0:GET_CASE_BY_CASENUMBER/ns0:CASETYPE ), "Description", "Unknown" )'/>
</tns:Type>

If we test the result we see that the source element with value “2” is succesfully translated to the “Claim” value.

10

 
4 Comments

Posted by on 26-02-2015 in Oracle, OSB

 

Tags: ,

Using the Database Adapter in Oracle Service Bus 12c

Introduction

Since the Oracle Service Bus is particularly good in handling high amounts of (small) requests very, very quickly it’s a perfect solution for entity/atomic services. In Oracle Fusion Middleware 11g the solution chosen to decouple a database was often using an Oracle SOA Suite 11g project with JCA and Mediator. However if you had specific requirements beyond basis mapping the Mediator component had it’s limits, and in the worst case you would need to extend the project with a BPEL process. From a developers perspective this is the “easy” solution since both the JCA component and Mediator are configured in JDeveloper 11g. And, the alternative, using JCA with OSB this would mean that you have to import the JCA configuration from JDeveloper 11g into your OEPE 11g. Which means more work. However my personal opinion is, that the SOA/Mediator choice is a “bloated” result for such a simple atomic service implementation. The OSB is much more suitable for atomic/entity services and SOA/BPEL should be used for orchestration purposes.

Lucky for us in Oracle Fusion Middleware 12c the development of simple atomic services to decouple a database in Oracle Service Bus 12c is less work due to tthe fact all features of OFMW are available to the developer in one IDE..

00

Getting Started

In this blogpost we will explain how to create an Oracle Service Bus 12c project that can act as a simple atomic service that can decouple your database.
Since a best practice is to NOT implement SQL code (INSERT, SELECT, UPDATE, etc) in your Middleware component we will use a simple PL/SQL package to communicate with the database.

First we will create a service bus project with the name getCaseService and drag the HTTP transport on the proxy service

01

02

02

03

Then drag the Database adapter on the external services and call it getCaseDB

10

11

12

13

The result will be a Oracle Service Bus project with both the newly created HTTP proxy service and the DB business service:

15_result

Then we can go and configure the pipeline. Here is a basic overview of the final result the pipeline will look like:

30_result_met_BS

In the pipleline we will need 2 transformations for the request and response pipelne. In this example we will show XSLT instead of XQuery, but both are usable. First we create an XSLT for the request  pipeline transformation:

20

21

22

23

24

Finally we will also need to make sure the project has the response XSLT we can use for the response pipeline:

25

26

27

28

After we finalized the project we can now deploy our atomic/entity service to the IntegratedWeblogicServer and test the new service

40_result

 
5 Comments

Posted by on 03-02-2015 in Oracle, OSB

 

Tags: , , ,