RSS

Category Archives: Oracle

Using Upstart to automatically start Weblogic on Linux

upstart80

Recent releases of Ubuntu & RedHat both support Upstart which is a new way to automatically turn programs into daemons so you are able execute them on system start-up. I tried to make my Weblogic domain start automatically on a development Ubuntu server and this is the result.

It only required me to create a few configuration files.

Ubuntu:

For Ubuntu 14.04 the following config files should be placed:

/etc/init/ofmw_admin.conf

start on runlevel [2345]
exec start-stop-daemon --start -u ubuntu -c ubuntu:ubuntu --exec /opt/oracle/config/domains/rbx_dev/bin/startWebLogic.sh

/etc/init/ofmw_nodemgr.conf

start on runlevel [2345]
exec start-stop-daemon --start -u ubuntu -c ubuntu:ubuntu --exec /opt/oracle/config/domains/rbx_dev/nodemanager/startNodeManager.sh

And for each 1-n managed server: /etc/init/ofmw_<managedserver>.conf

start on runlevel [2345]
exec start-stop-daemon --start -u ubuntu -c ubuntu:ubuntu --exec /opt/oracle/config/domains/rbx_dev/bin/startManagedWebLogic.sh soa_server1

RedHat:

RedHat works a little bit different. I couldn’t test it, but it is explained here by Fusion Security:

/etc/init/ofmw_admin.conf

start on runlevel [345]
exec /bin/su - oracle -- /opt/oracle/config/domains/rbx_dev/bin/startWebLogic.sh

/etc/init/ofmw_nodemgr.conf

start on runlevel [345]
exec /bin/su - oracle --/opt/oracle/config/domains/rbx_dev/nodemanager/startNodeManager.sh

 

And for each 1-n managed server: /etc/init/ofmw_<managedserver>.conf

start on runlevel [345]
exec /bin/su - oracle -- /opt/oracle/config/domains/rbx_dev/bin/startManagedWebLogic.sh soa_server1

Commands

With the following commands I’m now able to start, stop and get the status of my daemon:

[ubuntu@rbxdev]# start ofmw_bamserver1
ofmw_bamserver1 start/running, process 9464

[ubuntu@rbxdev]# status ofmw_bamserver1
ofmw_bamserver1 start/running, process 9464

[ubuntu@rbxdev]# stop ofmw_bamserver1
ofmw_bamserver1 stop/waiting

references:

Updates:

  • 2015-12-08: Added nodemanager configuration
 
2 Comments

Posted by on 18-09-2015 in Oracle

 

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 withdraw tasks and handle them in Oracle BPM

If you want to withdraw a Human Task in Oracle BPM there are multiple options. This blog post will first show 3 options and then explain how to model your Oracle BPM process to anticipate on the result of a withdrawn task.

1. The BPM Workspace

Using the default Oracle BPM WorkSpace to withdraw a task:

withdraw5

2. Using the TaskService

If you use a custom front-end (instead of the default Oracle BPM Workspace) you can use the Oracle SOA Suite TaskQueryService & TaskService to handle your tasks. In the TaskService there are operations named withdraw and withdrawTasks to either withdraw 1 or multiple tasks. The example below shows a withdrawTask operation request message.


<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
 xmlns:tas="http://xmlns.oracle.com/bpel/workflow/taskService"
 xmlns:task="http://xmlns.oracle.com/bpel/workflow/task"
 xmlns:com="http://xmlns.oracle.com/bpel/workflow/common">
 <soapenv:Header/>
 <soapenv:Body>
 <tas:withdrawTask>
 <com:workflowContext>
 <com:credential>
 <com:login>weblogic</com:login>
 <com:password>welcome1</com:password>
 <com:onBehalfOfUser>weblogic</com:onBehalfOfUser>
 </com:credential>
 </com:workflowContext>
 <tas:taskId>a71a4c2b-b121-4cde-91af-79872dbda522</tas:taskId>
 </tas:withdrawTask>
 </soapenv:Body>
</soapenv:Envelope>

This solution is implemented in our Adaptive Case Management project in the case a specific (power)user is logged in and wants to withdraw the current task (and activity) where he/she is working on.

3. Using events/signal

When you want to withdraw a task without actually opening a task (or having access to it’s taskId) you can use a signal subprocess to receive an event.

withdraw4

The event can trigger an Update Task action which calls the withdraw operation from within the BPM process.

withdraw3

The Oracle BPM Process modeling

When using the withdrawTask the task state is set to “WITHDRAWN” when the task is closed. So make sure to use the data association on the output tab of the task to store the state in a process data object.

withdraw1

In the BPM process flow we can use an exclusive gateway to model the logic by checking the value of the taskState process data object.

withdraw2

Often we use gateways in Oracle BPM processes to check the outcome of a human task and model the outcome to different process flows. However keep in mind that the state can also inform about e.g. EXPIRED, ERROR or WITHDRAWN tasks.

withdraw7

References

 
2 Comments

Posted by on 18-06-2015 in BPM, Oracle

 

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: ,