Thursday, 28 February 2013

Step by Step Installation Guide for SOA 11g

Download all the software to get started.

  1. Oracle Database OracleXEUniv.exe
  2. WebLogic Server  wls1035_oepe111172_win32.exe
  3. Repository Creation Utility
  4. SOA Suite,
  5. OSB

Oracle Database Setup

This is the first step towards Installation of SOA Suite.

For this you need to have anyone of following versions but I will be using Oracle XE Universal database version as it is already installed on my machine  
                   i. Oracle XE Universal database version
                  ii. Oracle 10g database version
                 iii. Oracle 11g database version  

Note: You can not use any other database version in 11gR1 (certification of additional database is on the road map). Specifically, you cannot use XE Standard, It must be Universal.  

Note: When you are using XE, you will see a warning when you install the database schema that this database version is too old. You can safely Ignore this warning as it applies only to production environments.

Once you are done with Installation of Oracle XE, you must update database parameters.
Set the processes parameter to >=500 using the following instructions.
Login to sqlplus with sysdba and run following commands
sqlplus connect sys as sysdba
SQL> show parameter session
SQL> show parameter processes
SQL> alter system reset sessions scope=spfile sid='*';
SQL> alter system set processes=500 scope=spfile;
SQL> shutdown immediate
SQL> startup
SQL> show parameter session

SQL> show parameter processes

Schema Configuration 

Note: If you want to use Oracle XE as your database, you need to set the RCU_JDBC_TRIM_BLOCKS environment variable to TRUE *prior* to running RCU

1. To create the new schema, unzip navigate to rcuHome\bin and open a command window and run rcu.bat
2. The bat command returns to the prompt immediately and, after a few seconds, the Repository Creation Utility opens (if you just ran the utility to drop the schema, it opens the second time much more quickly).

3. On the Welcome screen, click on Next..
4. Select Create and click on Next.
5. Enter the database information.
6. Click on Next.
7. If you are using XE, you will see a warning at this point that this version is too old. You can safely ignore this warning as it applies only to production environments.

8. The pre-requisites are reviewed. When complete, click on OK. The utility moves to the next page ---with a slight delay, just wait for it.
9. On the Select Components screen, enter DEV in the field for creating a new prefix.
10. Select the component SOA Infrastructure. Dependent schemas are selected automatically.
11. If you choose to select other components, these install instructions may not match your install experience. Also, you may have to increase processes in XE (you will get a message telling you what is required).

12. Click on Next.
13. The pre-requisites for this step are checked. When completed, click on OK.
14. Select the radio button to Use the same password for all schemas. Enter a schema password. The password welcome1 is assumed in this document but you should choose your own secure password or a different one for each schema and be sure to record your passwords as you will need them later.
15. Click on Next.
16. Review the tablespaces and schema owners for the components.
17. Accepting the defaults, click on Next, and then click on OK to create the tablespaces.
18. When the pre-requisites for this step are completed, click on OK.

19. Click on Create to create the tablespaces. This takes about two minutes.
20. When completed, click on Close.

WebLogic Installation

First, you install Oracle WebLogic Server.
1.    To install WebLogic Server run wls1035_oepe111172_win32.exe
2.    When the Welcome screen for the install wizard comes up, click on Next.
3.    Select Create a new Middleware Home and enter: C:\Oracle\Middleware\home_11gR1.

4.    Click on Next.
5.    Enter email address to register for security alerts or deselect the checkbox and decline—whichever you prefer—and click on Next.
6.    Select Typical, and click on Next.
7.    Review installation directories.

8.    Click on Next.
9.    Select "All Users" Start Menu folder and click on Next.
10.    Review Summary.

11.    Click on Next to start the installation process. Installation takes about three minutes.
When the installation is complete, deselect the Run Quickstart checkbox and click on Done.

Installing SOA

Once the database is configured, and WebLogic is installed now you can install the SOA server into the Oracle Home on the WebLogic server.
Extract, at C:\SOA (this can be any path where you want to extract these zip files)

1.    In a command window, enter:
C:\SOA\Disk1\Setup –jreLoc C:\Oracle\Middleware\home_11gR1\jdk160_11
2.    When the install wizard Welcome screen comes up, click on Next.
3.    Wait for the pre-requisite check to complete (it's quick!).

4.    Click on Next.
5.    On the Specify Installation Location screen, select the middleware home:
6.    Enter Oracle home: Oracle_SOA1. If you use a different Oracle home, then adjust accordingly when Oracle_SOA1 is referenced throughout this document.

7. Click on Next.
8. Review Summary.

9.  Click on Install.
10.Wait for the installation to complete—it takes a few minutes. Click on Finish.

Oracle Service Bus (OSB) Installation

Once SOA is installed into Oracle Home we are ready to Install OSB on that.
Extract at C:\OSB (this can be any path where you want to extract these zip files)

1.    In a command window, enter:
C:\OSB\Disk1\Setup –jreLoc C:\Oracle\Middleware\home_11gR1\jdk160_11
2.    When the install wizard Welcome screen comes up, click on Next.
3.    Select “Skip Software Updates” and click “Next”
4.    Leave default values for location:

5.    Select “Typical” Installation and click Next:

6.    Pre-requisites will be checked  - click Next once done:

7.    Accept default locations and click Next:

8.    Review the summary and click Install
9.    When it reaches to 100% - click Next and Finish

Domain Creation

This step describes detail for configuring the WebLogic server domain for the SOA server.
1.    In a command window, enter:
    C: /Oracle/Middleware/home_11gR1/Oracle_SOA1/common/bin
2.    When the configuration wizard's Welcome screen comes up, select Create a new WebLogic domain, and then click on Next.
3.    Select Generate a domain and select SOA Suite, Enterprise Manager, and Business Activity Monitoring. Dependent products are selected automatically.

4.    Click on Next.
5.    Enter the domain name: domain1. or any other desired domain name

6.    Click on Next.
7.    Enter the user name as weblogic and a password. The password welcome1 is assumed in this document but you should choose your own secure password and remember it for later in the document when the password is referenced.

8.    Click on Next.
9.    Select the Sun SDK 1.6_11 and leave Development Mode checked.

10.    Click on Next.
11.    On the Configure JDBC Component Schema screen, you select the components that you want to change, and then enter the property value for those components. First, select all of the components and enter welcome1 for the password in the Schema Password field.
12.    With all of the checkboxes selected, enter the Service, Host, and Port values.

13.  Now, look at the table. Review the Schema Owner column and confirm that the values are the same as what you configured in the Configure Schema section when you ran the RCU. Go back and review the screenshots in that section of this document for the schema owners if you do not remember them.
14. Complete the following if the schema owners need to be updated:
        a. Deselect all the component checkboxes.
        b. Select BAM Schema only.
        c. Enter the Schema Owner for BAM.
        d. Next, deselect BAM Schema and select the next one.
        e. Enter the schema owners one-by-one.
        f.  Continue until all schema owners are entered.
15. Click on Next.
16. The data source connections are all tested.

17.  If all are successful, click on Next, otherwise click on Previous and correct any errors.
18.  You will now see options for optional configurations. Select Administration Server, Managed Servers Cluster and Machines and Deployments and Services.

19. Next screen is for configuring managed servers. Select bam_server1 and click Delete, select soa_server1 and click Delete. Then Click Next.

And then again Next.
20. On the Configure Machine screen Click next.

21. On the next screen Move AdminServer to the right and click Next.

22. For Target Services to Cluster or Servers,If not already done, select AdminServer on the left and click Select All on the right. Click Next.

23. You reach the Configuration Summary screen.
 Click on Create.

24. Wait for the creation to finish it takes few minutes. Click on Done.
This ends the process of Oracle Fussion Middleware (SOA 11g) installation.

Now you can access Oracle Enterprise Manager on http://<YourHost>:7001/em
Weblogic Server Console on http://<YourHost>:7001/console

Thursday, 21 February 2013

If soa_server fails in 11g SOA

If soa_server fails in 11g SOA


When starting managed server for soa_server, the following error is shown in the console.

Enter username to boot WebLogic server:admin
<Jul 21, 2009 6:34:46 PM EDT> <Error> <Security> <BEA-090783> <Server is Running in Development Mode and Native Library(terminalio) to read the password securely from commandline is not found.> 
<Jul 21, 2009 6:34:46 PM EDT> <Notice> <WebLogicServer> <BEA-000388> <JVM called WLS shutdown hook. The server will force shutdown now> 
<Jul 21, 2009 6:34:46 PM EDT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to FORCE_SHUTTING_DOWN> 


Set environment variable as below.

set it in


Wednesday, 20 February 2013

Local and Global Transaction. And example with Oracle BPEL Application.

JTA Transactions - Local and Global Transaction. And example with Oracle BPEL Application.

This Blog is about understanding the basics of transaction in J2EE level and how this can be translated to Oracle, BPEL conceptually. This does not limit the interpolation of this concept in simple Java projects as well.

Now lets dig in...


J2EE supports two kinds of transactions:
  • Local Transactions - A local transaction is internal to a single resource.
  • Global Transactions - A global transaction is created by an external transaction manager (JTA) and is used to scope work on multiple resources.

Local Transactions

When a managed data source is configured for local transactions it returns connections that can participate in local transactions but cannot participate in global transactions. This means that the connections will not be enlisted in global transactions. The data source will set the auto commit to true for retrieved connections. However, it is up to the client to determine how the connections will be used in local transactions. That is, the client can change the auto-commit mode by using setAutoCommit() on a connection.

Local transactions are transactions associated with a particalar data source (means they are resource-specific). the most common example would be a transaction associated with a JDBC connection.

Global Transactions (XA)

When a managed data source is configured for global transactions, it returns connections that can participate in global transactions. A global transaction (also called a distributed transaction) enlists more than one resource in the transaction.

Global Transactions provide the ability to work with multiple transactional resources (typically relational databases and message queues).

Oracle® Containers for J2EE Services Guide 10g (
Question: Difference between local and global transaction ? - AllInterview

Now putting this in SOA, Concept for better understanding:

Diag Source: Oracle® Containers for J2EE Services Guide 10g ( Number B28958-01

So with the above image, lets make some assumptions,

hint: BPEL needs a JDBC connection for its dehydration purpose.

The client Tx is the main BPEL process and the new Tx is probably the adapter / another BPEL process invocation process with in the main BPEL process.

In a local transaction setup, client Tx will be a separate transaction and new Tx will be on its own.
In a global transaction setup, new Tx will be a part of or will participate with client Tx.

In another scenario, we can have one client Tx as local and two new Tx as XA. In this scenario the BPEL process will be on tis own and the two new  Tx will be part of one global Tx.

for example this case will apply where you have one BPEL process and you have two or more DB adapters in the BPEL process. Which means, all the DB adapter Tx will roll back if any one of the DB adapters fail with an error.

Additional Info:

Source: Local and global transaction considerations - IBM docs

Local and global transaction considerations

Applications use resources, such as Java Database Connectivity (JDBC) data sources or connection factories, that are configured through the Resources view of the administrative console. How these resources participate in a global transaction depends on the underlying transaction support of the resource provider.

For example, most JDBC providers can provide either XA or non-XA versions of a data source. A non-XA data source can support only resource manager local transactions (RMLT), but an XA data source can support two-phase commit coordination, as well as local transactions.

If an application uses two or more resource providers that support only RMLTs, atomicity cannot be assured because of the one-phase nature of these resources. To ensure atomic behavior, the application should use resources that support XA coordination and should access them within a global transaction.
If an application uses only one RMLT, atomic behavior can be guaranteed by the resource manager, which can be accessed in a local transaction containment (LTC) context.

An application can also access a single resource manager in a global transaction context, even if that resource manager does not support the XA coordination. An application can do this because the application server performs an "only resource optimization" and interacts with the resource manager in a RMLT. In a global transaction context, any attempt to use more than one resource provider that supports only RMLTs causes the global transaction to be rolled back.

At any moment, an instance of an enterprise bean can have work outstanding in either a global transaction context or an LTC context, but not both. An instance of an enterprise bean can change from running in one type of context to the other (in either direction), if all outstanding work in the original context is complete. Any violation of this principle causes an exception to be thrown when the enterprise bean tries to start the new context.

Difference between XADatasource and Non-XADatasource

 Difference between XADatasource and Non-XADatasource

An XA transaction, in the most general terms, is a “global transaction” that may span multiple resources. A non-XA transaction always involves just one resource.
An XA transaction involves a coordinating transaction manager, with one or more databases (or other resources, like JMS) all involved in a single global transaction. Non-XA transactions have no transaction coordinator, and a single resource is doing all its transaction work itself (this is sometimes called local transactions).
XA transactions come from the X/Open group specification on distributed, global transactions. JTA includes the X/Open XA spec, in modified form.
Most stuff in the world is non-XA – a Servlet or EJB or plain old JDBC in a Java application talking to a single database. XA gets involved when you want to work with multiple resources – 2 or more databases, a database and a JMS connection, all of those plus maybe a JCA resource – all in a single transaction. In this scenario, you’ll have an app server like Websphere or Weblogic or JBoss acting as the Transaction Manager, and your various resources (Oracle, Sybase, IBM MQ JMS, SAP, whatever) acting as transaction resources. Your code can then update/delete/publish/whatever across the many resources. When you say “commit”, the results are commited across all of the resources. When you say “rollback”, _everything_ is rolled back across all resources.
The Transaction Manager coordinates all of this through a protocol called Two Phase Commit (2PC). This protocol also has to be supported by the individual resources.
In terms of datasources, an XA datasource is a data source that can participate in an XA global transaction. A non-XA datasource generally can’t participate in a global transaction (sort of – some people implement what’s called a “last participant” optimization that can let you do this for exactly one non-XA item).
For more details – see the JTA pages on Look at the XAResource and Xid interfaces in JTA. See the X/Open XA Distributed Transaction specification. Do a google source on “Java JTA XA transaction”.

Don't Use Oracle's Driver (Thin XA) to Define WebLogic Data Source for ADF Applications

In recent days/weeks I'm getting multiple requests with questions of following type: I have a problem with the rollback, I'm working with weblogic 10.3.6. In my application back when I do a rollback, but at the launch of the back gives me this error - java.sql.SQLException: Statement cancelled, probably by transaction timing out and similar. People are facing this issue when they move application to production or test server, on development environment embedded WebLogic everything works fine.

But really this is not an issue at all. What happens is - WebLogic administrators define wrong data source (XA data source). Error is not reproduced on embedded WebLogic, because data source is created automatically for you in development environment. XA data source should be never user with ADF/Fusion applications because it closes all cursors upon commit. Read more here from ADF developer guide - 41.3.7 What You May Need to Know About JDBC Data Source for Oracle WebLogic Server.

Make sure to select proper driver for Instance Connections:

Wednesday, 13 February 2013

Exporting the SOA MDS

A cool feature from SOA 11g Enterprise Manager is manageing the MDS. You can export and import the MDS to the file system.

SOA-Infra -> Administration -> MDS Configuration

Select Export and point to a directory, on the server, in which EM is able to write.

After you press OK, it will take a while, depending on the size of your MDS, when it is finished/
When you have export the data into a location on the server you can view it off course. It will contain the shared objects of the SOA 11g; Fault Policies, XML Schemas etc. But it also contains the complete SOA 11g configuration of all the settings; 
  • Composite properties
  • BPEL  properties
  • Mediator properties
  • Workflow  properties
  • Rule  properties
This is a nice to have when you want to discover your environment settings quickly.

$ tree -d -L 2
|-- apps
|   `-- faultPolicies
|-- deployed-composites
|   `-- default
`-- soa
    |-- b2b
    |-- configuration
    `-- shared

It also contains all the composites with their artifacts; WSDL, BPEL, XSL, XLST, etc. You are able to view whate the result is from your deployment. How are the files manipulated from the SAR file to MDS.

Friday, 8 February 2013

BPEL Deployment Descriptor Config Properties

This document lists the config properties of some sections of the deployment descriptor. For each configuration property parameter, a description is given, as well as the expected behavior of the engine when it's changed.
current state

Set portion of the instance information that you want to save after the instance is completed. Possible values:
  • "all" (default): meaning the instance is saved in both cube_instance and cube_scope tables.
  • "instanceHeader", meaning Only the meta data of the instances are saved in cube_instance table.
    Note: this property can only be set if the "inMemoryOptimization" property is set to true.
since 10.1.2

This property configures how the instance data is saved. Possible values:
  • "on" (default): the completed instance will be saved normally.
  • "deferred": the completed instance will be saved, but with a different thread and in another transaction.
  • "faulted": only the faulted instances will be saved.
  • "off": no instances of this process will be saved.
since 10.1.2
the xml document that you want to use as input to test the process from the BPEL console
since 10.0.0

Whether engine sets default value to variables. This eliminates the need for user to assign values to variables before doing XPath manipulation. Possible values:
"true" (default): bpel engine will set default value to variable based on to-spec queries.
"false": bpelc won't initialze the variables based on to-spec queries
since 10.0.0
Default value is false. This property can only be set to true if it does not have dehydration points. Activities like wait, receive, onMessage and onAlarm will create dehydration points in the process. If this property is set to true, engine will try to do inMemory optimization on the instances of this process. on to-spec queries
since 10.1.2
Default value is true, if set to false, we won't load any xml schemas basically the bpel will become type-less
since 10.0.1
Default value is false, if set to true, the compiler will not try to modify the process WSDL to add binding and service information.
since 10.0.2 (It's used to be at the process level)
Default value is true. If set to false, the engine don't enable our copy-on-write feature for assign copy
since 10.0.1
Default value is false. If set to true, compiler won't check type compatibility with assign activity.
since 10.0.1
Default value is false. If set to true, compiler won't complain about unqualified steps in query. Example: where the correct form should be query="/ns1:payload/ns1:name", the following form will pass compilation if this flag is turned on: query="/payload/name".
since 10.0.1
the location of the sensor action xml file that is used by ProcessConnect. Sensor action xml file configures the action rule for the events.
since 10.0.0
the location of the sensor xml file. Sensor xml file defines the list of seonsors that BPEL engine will log events into.
since 10.0.0
introduction text that will show up in the test console
since 10.0.0
when set to be "participate", the process will bubble up fault that is not handled by faultHandlers, which will calls the transaction to be rolled back.
since 10.0.0
Service Level Agreement Completion Time - Threshold for a commitment that a process would be completed within a specified time period. Value is a XML duration.
since 10.0.0
Default value is true. If set to false, compiler will not validate the xpath queries.
since 10.0.1
Security - the username a calling user must provide (given domain level security is on)
Security - the password a calling user must provide (given domain level security is on)
Security - the role a calling user must belong to in the Identity Management (given domain level security is on)

The setting of persist policy of this process in the delivery layer. This setting override the same value in domain.xml. The possible values are:* "on": message into the system will be saved in delivery store before being picked up by the engine* "off": message into the system will be saved in memory before being picked up by the engine
  • "off.immediate": the instance-initiating message won't be temporarily saved in delivery layer. Engine will use the save thread to initiate

When the instance is completed. Will engine keep the global variable values in the instance store. Possible values:* "false" (default): global variable values will be deleted when the instance completes
  • "true": globale variables values will be kept in instance store

Security - creates HTTP-BASIC-AUTHENTICATION (values are propagate/ credentials)
propagate: If the process has been invoked securely - these credentials are used for outbound too
credentials: Pass credentials from descriptor
Security - the username - passed to basic authentication
Security - the credential - passed to basic authentication
this is a list of bindings that the compiler will generate for the callback portType. The default value is "soap". You can set multiple bindings like "jms, soap". The first item will be used as the prefered binding when calling back.
since 10.0.1
If this is set to "correlationSet", this partnerLink is using bpel correlationSet. Default value is "wsAddressing".
since 10.0.0
User can use this to set special http contentType. Ex: text/xml
since 10.0.0
deprecated sinse 10.1.3
overwrite the http 'accept' header that engine sends to the remote SOAP service
since 10.1.2
Axis only
overwrite the http 'content-type' header that engine sends to the remote SOAP service
since 10.1.2
Axis only
If the server allows keepAlive connection, this boolean peroperty can be turned on to take advantage of it. Thus connections to the same server are shared between invocations.
This attribute used to be named 'keepAlive'
since 10.1.2
Axis only
This is used for WSIF HTTP provider username/password authentication
since 10.0.0
This is used for WSIF HTTP provider username/password authentication
since 10.0.0
This is the URL that overrides the location defined in WSDL. In the case of SOAP over HTTP binding, this value overrides the SOAPAddress
since 10.0.0
When this is set to be true, engine will spawn a separate thread to do the invocation so that the will not block the instance. The default value is false.
since 10.0.0
This is the number of seconds the engine wait between retries.
since 10.0.0
deprecated by Fault policy in
This is the number of retries the engine will attemp if an invoke failes because of network problems.
since 10.0.0
deprecated by Fault policy in
Some old RPC style web services require the xsi:type to be set with every elements in the input message. If this value is set to be true, BPEL engine will populate the xsi:type of all the elements.
since 10.0.0
XML element that will be passed to wsif provider
since 10.0.0
Some old RPC style web services require the xsi:type to be set with every elements in the input message. If this value is set to be true, BPEL engine will populate the xsi:type of all the elements.
since 10.0.0
The number of seconds an soap call will timeout. A RemoteFault will be thrown if this happens.
since 10.0.0
Axis only
Enables message boundary validation. When set to "true" the engine validates the xml message against the xml schema during and for this partnerLink. If the xml message is invalid then bpelx:invalidVariables runtime BPEL Fault is thrown. This overrides the domain level validateXML property. For example enable validation for only StarLoanService partner:

since 10.0.0
url of the WSDL file that defines this partnerLink. This property must be present. The BPEL compiler needs this to validate the BEPL source. This can be an abstract WSDL in the sense that only the portTypes and their dependencies need to be defined in the WSDL
since 10.0.0
This is also a URL to the partnerLink WSDL. But it is used on the BPEL server, which means the concrete WSDL with all the service, port and binding definitions is needed. This property is optional, it defaults to the wsdlLocation property. This property also allows multiple URLs separated by blanks (space, new line and tabs). Thus the engine will try sequentially if any of them are not available.
since 10.0.0
Security - create a WS-Security UsernameToken (values are propagate/ credentials)
propagate: If the process has been invoked securely - these credentials are used for outbound too
credentials: Pass credentials from descriptor
Security - the username for the token (required)
Security - the password for the token (optional)
the preferred port to use in case there are multiple WSDL ports availabel. The value is the NCName of the WSDL port.
Default value is "false", when it's set to "true". WSDL will be generated to include full WSA headers in binding: "From", "Action", "To", "FaultTo"