BLOGS HOME PRODUCTS & SERVICES INDUSTRIES SUPPORT PARTNERS COMMUNITIES ABOUT Sign In
About
Configuring XA For AQ JMS Adapter With Oracle RAC
By Pete Wang on July 4, 2010 11:18 PM
This note describes the best practice of configurating XA for AQ JMS Adapter on SOA 10.1.3.4 with Oracle RAC
Database that hosts AQ based JMS topics or queues, For more details about Oracle SOA XA and RAC Database
Configuration, please refer to the Oracle White Paper - Oracle SOA Suite 10g XA and RAC Database Configuration
Guide, which is available on http://www.oracle.com/technology/tech/soa/ha/index.html.
http://blogs.oracle.com/soa_how_to/ 9/21/2010
Oracle SOA Best Practice And Troubleshooting Page 2 of 14
{ JNDI name of the Data source that is used to connect to database hosting AQ queues or topics. Archives
url="jdbc:oracle:thin:@(DESCRIPTION=
(ADDRESS_LIST=(LOAD_BALANCE=on)
(ADDRESS=(PROTOCOL=tcp)(HOST=host1-vip)(PORT=1521))
(ADDRESS=(PROTOCOL=tcp)(HOST=host2-vip)(PORT=1521)))
(CONNECT_DATA=(SERVICE_NAME=ORCLSVC)))
{ Configure XA recovery required by OC4j Transaction Manager to conduct recovery process for
database resources. Add the following after connection factory setting.
<xa-recovery-config>
<password-credential>
<username>xauser</username>
<password>welcome1</password>
</password-credential>
</xa-recovery-config>
{ Config connection pool properties. The following properties are recommended.
http://blogs.oracle.com/soa_how_to/ 9/21/2010
Oracle SOA Best Practice And Troubleshooting Page 3 of 14
jndi-name="jdbc/aqjmsRACDS" name="aqjmsRACDS"
manage-local-transactions="false"/>
6. Configuring JMS Adapter
To configure JMS Adapter, Open $ORACLE_HOME/j2ee/OC4J_SOA/application-
deployments/default/JmsAdapter/oc4j-ra.xml in a text editor, then specify
1. Always check the wsdl file generated by JMS Adapter Wizard. Verify if location value for jca:address element
matches the JNDI name specified in JMS Adapter Connection Factory in oc4j-ra.xml
2. UseMessageListener attribure for jca:operation element in the wsdl file must be set to false. JMS Adapter
only supports polling approach for inbound operations on SOA 10.1.3.4 or above version.
3. Just a clarification that cacheConnections property is set to true by default for JMS Adapter partnerlink in
BPEL, You don't need to change this to false.
Tags: SOA XA
Comments (5)
For SOA Domain 1 , set the following properties in the weblogic server startup argument.
-Dtangosol.coherence.wka1=apphost1vhn1 -Dtangosol.coherence.wka1.port=<port1>
-Dtangosol.coherence.wka2=apphost2vhn1 -Dtangosol.coherence.wka2.port=<port1>
-Dtangosol.coherence.localhost=apphost1vhn1 -Dtangosol.coherence.localport=<port1>
For SOA Domain 2 , set the following properties in the weblogic server startup argument.
-Dtangosol.coherence.wka1=apphost1vhn1 -Dtangosol.coherence.wka1.port=<port2>
http://blogs.oracle.com/soa_how_to/ 9/21/2010
Oracle SOA Best Practice And Troubleshooting Page 4 of 14
-Dtangosol.coherence.wka2=apphost2vhn1 -Dtangosol.coherence.wka2.port=<port2>
-Dtangosol.coherence.localhost=apphost1vhn1 -Dtangosol.coherence.localport=<port2>
Tags: SOA HA
Comments (0)
In SOA 11g, you can create a XSLT mapper that uses multiple sources as the input. To implement a multi-source
mapper, just follow the instructions below,
6. Click OK, the xls file will be opened in the graphical mode. You can map the sources to the target as usual.
7. Open the mapper source code, you will notice the variable representing the additional source payload, is
defined as the input parameter in the map source spec and body
<mapSources>
<source type="XSD">
<schema location="../xsd/po.xsd"/>
<rootElement name="PurchaseOrder" namespace="http://www.oracle.com/pcbpel/po"/>
</source>
<source type="XSD">
<schema location="../xsd/customer.xsd"/>
<rootElement name="Customer" namespace="http://www.oracle.com/pcbpel/Customer"/>
<param name="v_customer" />
</source>
</mapSources>
http://blogs.oracle.com/soa_how_to/ 9/21/2010
Oracle SOA Best Practice And Troubleshooting Page 5 of 14
</mapSources>
...
<xsl:param name="v_customer"/>
8. Let's take a look at the BPEL source code used to execute xslt mapper.
<assign name="Transform_1">
<bpelx:annotation>
<bpelx:pattern>transformation</bpelx:pattern>
</bpelx:annotation>
<copy>
<from expression="ora:doXSLTransformForDoc('xsl/Transformation_1.xsl',bpws:getVariableData
('v_po'),'v_customer',bpws:getVariableData('v_customer'))"/>
<to variable="v_invoice"/>
</copy>
</assign>
9. You will see BPEL uses ora:doXSLTransformForDoc XPath function to execute the XSLT mapper.
This function returns the result of XSLT transformation when the xslt template matching the document. The
signature of this function is ora:doXSLTransformForDoc(template,input, [paramQName, paramValue]*).
Where
template is the XSLT mapper name
input is the string representation of xml input,
paramQName is the parameter defined in the xslt mapper as the additional source
parameterValue is the additional source payload.
10. You can add more sources to the mapper at the later stage, but you have to modify the
ora:doXSLTransformForDoc in the BPEL source code and make sure it passes correct parameter and its
value pair that reflects the changes in the XSLT mapper.
z create the variables before creating the mapping file, therefore you can add multiple sources when you define
the transformation in the first place, which is more straightforward than adding them later on.
z Review ora:doXSLTransformForDoc code in the BPEL source and make sure it passes the correct
parameters to the mapper.
Tags: XSLT
Comments (4)
SOA 11g supports the restricted assignment feature. To do it, you need some
customizaton for your worklist application. Below are the steps that show you how to
achieve this.
http://blogs.oracle.com/soa_how_to/ 9/21/2010
Oracle SOA Best Practice And Troubleshooting Page 6 of 14
Note: You can create such java class inside of your BPEL/Worklist project in
JDeveloper, you need to add BPM Workflow java library to compile the class
package sample;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import oracle.bpel.services.workflow.task.IRestrictedAssignmentCallback;
import oracle.bpel.services.workflow.task.IRestrictedAssignees;
import oracle.bpel.services.workflow.task.ITaskAssignee;
import oracle.bpel.services.workflow.task.impl.TaskAssignee;
import oracle.bpel.services.workflow.task.impl.RestrictedAssignees;
import oracle.bpel.services.workflow.task.model.Task;
import oracle.bpel.services.workflow.IWorkflowConstants;
Map propertyMap,
String currentUser,
String identityContext,
String operation) {
if(operation.equals(
IRestrictedAssignmentCallback.OperationType.REASSIGN.toString())) {
return new RestrictedAssignees(createReassignTaskAssigneeList(),
true);
} else if(operation.equals(
IRestrictedAssignmentCallback.OperationType.ROUTE.toString())) { z
http://blogs.oracle.com/soa_how_to/ 9/21/2010
Oracle SOA Best Practice And Troubleshooting Page 7 of 14
} z
Comments (4)
To configure BAM 11g to use LDAP server as the identity store, you need to perform the following steps.
The following document describes how to add an Authentication Provider in WebLogic Server.
There are two important things I would like to point out here,
1. It is recommended to choose SUFFICIENT from the Control Flag drop-down list when configuring your own
Authentication Provider.
This specifies that if a user is authenticated successfully using this authenticator, WebLogic should accept the
authentication and not continue to invoke any additional authenticators. If the authentication fails, Oracle WebLogic
Server attempts to authenticate the user using the next authenticator in the list.
If you set the Control Flag to SUFFICIENT, ensure that all subsequent authenticators also have the Control Flag set
to SUFFICIENT. Likewise, ensure that the Control Flag of the default authenticator is set to SUFFICIENT as well.
2. SOA 11g R1 does not support multiple authentication providers, even you can specify them in WebLogic Server
Level. The reason behind this is that Java Portlet Specification (JPS) , the shared security framework used by SOA,
does not support multiple authentication providers, more specifically, it only provides authorization against the first
http://blogs.oracle.com/soa_how_to/ 9/21/2010
Oracle SOA Best Practice And Troubleshooting Page 8 of 14
entry in the list of providers. (see Oracle Documentation Bug 8241202). Therefore, if you would like to login as the
user from the default authentication provider, such as "weblogic", you have to add the user to the provider you would
like to use and reorder the authentication provider to the the top of the list.
The above step should work fine if you only use SOA Worklist Application. Below are the extra steps that are specific
to BAM.
OracleSystemUser is an internal user used by BAM Server to perform user synchronization operations. Create this
user in the base DN that you specified in STEP 1.
STEP 3
Run the following SQL statement to initialize BAM users synchronization table in the Oracle BAM schema:
After users successfully login to BAM, they will be registered in the "SysIterUser" table, and set the "INACTIVE" field
to 0, which indicates it is an active user. A BAM server thread is scheduled to run every 5 minutes by default to
synchronize the users between BAM and Authentication Provider. If users can not be identified in the first
authentication provider, the synchronization process will fail and consequently mark the user inactive.
If it happens, you need to run the above scripts to reset the login table.
Comments (2)
Jdeveloper can be used to deploy SOA composites, but using ant is getting more popular as it
brings us more flexibility, functionality, and productivity in the following scenarios,
zDeploy a SOA application that includes mutiple composites having dependencies.
z Use deployment plan to deploy soa composites into different environments.
The purpose of this article is to explains how to create ant files to deploy SOA composite
projects on 11g
<!--[if !supportEmptyParas]--> <!--[endif]-->
Step 1 - Create build.properties file
The first step is to create a bin directory under your project fold, then create a build.properties
file under bin folder. The properties required are described in Table -Build Properties as follows,
Table - Build Properties
Property Name Description
composite.name The composite name specified in the composite.xml of
the project
composite.revision The revision of the composite
oracle.home The oracle home where ant scripts, soa mobules and
libs are located. If Jdevelper 11g is installed,
then Set this property to <JDEV_HOME>/jdeveloper,
where <JDEV_HOME> is JDEV installation directory. If
SOA suite 11g is also installed on the same machine,
this propety can also be set to the SOA Server Home,
which is the same as the soa.server.oracle.home.
When specifying directory path on windows, either
"/" or "\\" can be used. While on Unix or Linux, "/"
is the one to use. For example, on windows, the
oracle.home can be set as,
oracle.home=C:/oracle/JDEVHome/jdeveloper or
oracle.home=C:\\oracle\\JDEVHome\\jdeveloper
l h Th SOA id l h di t d d f
http://blogs.oracle.com/soa_how_to/ 9/21/2010
Oracle SOA Best Practice And Troubleshooting Page 9 of 14
soa.server.oracle.home The SOA server side oracle home directory needed for
http://blogs.oracle.com/soa_how_to/ 9/21/2010
Oracle SOA Best Practice And Troubleshooting Page 10 of 14
http://blogs.oracle.com/soa_how_to/ 9/21/2010
Oracle SOA Best Practice And Troubleshooting Page 11 of 14
applications.
<!--[endif]-->
A deploy target sample
<target name="deploy">
<condition property="deploymentplan.name" value="null">
<not>
<isset property="${deploymentplan.name}"/>
</not>
</condition>
<echo>Deploying to http://
${managed.server.host}:${managed.server.port}/soa-infra/deployer</echo>
<ant antfile="${oracle.home}/bin/ant-sca-deploy.xml" target="deploy"
inheritall="false">
<!-- reformat of prop names -->
<property name="user" value="${server.user}"/>
<property name="password" value="${server.password}"/>
<!-- create the url for deployment -->
<property name="serverURL" value="http://
${managed.server.host}:${managed.server.port}/soa-infra/deployer"/>
<!-- location of the sar -->
<property name="sarLocation"
value="${deploy.dir}/sca_${composite.name}_rev${composite.revision}.jar"/>
<!-- force overwrite if already there -->
<property name="overwrite" value="true"/>
<!-- configplan-->
<property name="configplan" value="${deploymentplan.name}"/>
</ant>
</target>
<!--[if !supportEmptyParas]--> <!--[endif]-->
Once the build.xml and build.properties are in places, you are ready to go for the deployment.
Tags: SOA
Comments (4)
In many cases, customers would like to use custom SQL instead of Toplink generated SQL to poll database tables
using DB Adapter Logical Delete Polling Strategy, for example, they want to add some DB Hints in the SQL query to
improve performance.
To make the sample work, here are some tips that you may need to know.
http://blogs.oracle.com/soa_how_to/ 9/21/2010
Oracle SOA Best Practice And Troubleshooting Page 12 of 14
1. Pure SQL will not be executed by Toplink if you choose the second option (Logical
Delete) as the After Read Strategy in Adapter Configuration Wizard. In this case,
PollingStrategyName is set to LogicalDeletePollingStrategy in the DB Adapter wsdl file.
2. To make Pure SQL work with Logical Detele Strategy, you must choose the first
option (Delete the rows) as the After Read Strategy in Adapter Configuration Wizard, then
edit the toplink project directly by adding two custom SQLs, one for polling, the other for
after reading operations. In this case, the after reading SQL must be defined in Custom
SQL - Delete Tab.
The corresponding configuration in _toplink_mapping.xml file looks like,
For Pollling,
<opm:querying xsi:type="toplink:query-policy">
<opm:queries>
<opm:query name="Poll" xsi:type="toplink:read-all-query">
<toplink:timeout>0</toplink:timeout>
<toplink:call xsi:type="toplink:sql-call">
<toplink:sql>SELECT TITLE, '1' DIRECTOR, STARRING, SYNOPSIS, GENRE,
RUN_TIME, RELEASE_DATE, RATED, RATING, VIEWER_RATING, STATUS, TOTAL_GROSS, DELETED, SEQ
</toplink:call>
<toplink:reference-class>Poll.Movies</toplink:reference-class>
<toplink:cache-usage>primary-key</toplink:cache-usage>
<toplink:lock-mode>none</toplink:lock-mode>
<toplink:container xsi:type="toplink:list-container-policy">
<toplink:collection-type>java.util.Vector</toplink:collection-type>
</toplink:container>
</opm:query>
</opm:queries>
Comments (2)
It is a two step asynchronous processing when BPEL engine handles Email Notification Activity.
z Notification Creation and Persistence - BPEL Process Manager will first create a notification object including a
unique NotificationID, other notification properties and message payload, and insert the notification details
into BPEL dehydration store, then it will send an empty JMS message with the notification ID property to an
internal queue to notify that the message is ready for delivery.
z Notification Delivery - When the JMS message arrives in the queue, a MDB thread will be allocated and
consumes the message. In the onMessage() method of the MDB, it will attempt to query the dehydration store
given the notification ID, then send the notification details through the pre-configured email channel. Please
note that message delivery happens in a separate thread than the BPEL execution thread.
Thus, there are two different threads that handle notification persistence and email delivery respectively. BPEL engine
must figure out the way to coordinate the threads execution, otherwise the race condition might occur. For example,
when the system message arrives earlier than the transaction commit for notification insertion in the database, MDB
http://blogs.oracle.com/soa_how_to/ 9/21/2010
Oracle SOA Best Practice And Troubleshooting Page 13 of 14
thread will be kicked off first, as the data were not committed yet, the notification id can not be retrieved while
searching the Notification tables by the MDB thread. In this case, the email notification will fail.
The above scenario can work very well in normal situation, but if there is any notification failure due to email server
down, or network problems, etc. what BPEL can do about it?
A Quartz scheduler is used in BPEL 10.1.3.3 to handle this scenario. A quartz scheduler will start a thread that will
run every 15 minutes by default to send a batch of empty JMS messages with unique IDs to the JMS queue. But this
time, there is no message persistence, instead, the notification IDs are fetched by querying the dehydration store
given the state is either RETRY or SEND. In other words, if there are any records in the database where the state is
RETRY or SEND, these records will become deliverable candidates. MDB thread will then fetch messages details
from dehydration store and deliver them through emails. At the delivery stage, it will verify how many times the server
has attempted to deliver the message, the maximal attempt is 3 by default. If all these retries fail, it will update the
state of this notification in the dehydration store to ERROR
If the notification is in "ERROR" status, the only way to retry the message delivery
is to run the following script to update the BPELNotification table status to
RETRY. For example:
UPDATE BPELNotification
SET status = 'RETRY',
ATTEMPTEDNUMBER = 0
WHERE ID = <notification id>
But if the property is set too small, for example, 1 (minute), then there is a possibility that you will get duplicate
messages sent to the email server. Here is a scenario that might happen in the real world.
When BPEL PM processes the Notification Activity, it dehydrates the Notification details and that notification
becomes a candidate for MDB to deliver. Suppose delivery has not finished processing, thus the notification
record still resides in the dehydration store with status "SEND". If the Quartz scheduler job is executed at the
same time, it will also pick up the same notification as a deliverable candidate, thus causing the duplicate
messages being sent by MDB
Hopefully this article can help you understand how Notification service works in BPEL. If you have any questions,
please post here, I will try my best to answer. If you encounter any problems with Email Notification, errors, it is
highly recommended to go to the BPEL console and set collaxa.cube.services logger to DEBUG, then check the
ORACLE_HOME/opmn/logs/<opmn log file for soa container> for more information.
Tags: BPEL
Comments (8)
To debug BAM 11g Security issues, such as user authentication or authorization, it is recommended to set
oracle.bam.adc.security and oracle.bam.common.security loggers to FINEST, then check the
ORACLE_HOME/user_projects/domains/<SOA DOMAIN>/servers/bam_server1/logs/bam_server1-diagnostic.log for
more information.
For more details on how to enable these BAM loggers, please refer to technical note in My Oracle Support. (Doc ID
966483.1).
http://blogs.oracle.com/soa_how_to/ 9/21/2010
Oracle SOA Best Practice And Troubleshooting Page 14 of 14
Comments (0)
You may have seen some errors like ClassNotFound, MethodNotFound or NullPointerException after you apply a
patch which contains the bug fix for Oracle Application Server technology adapters, such as DB Adapter, AQ Adapter,
etc. This article explains why such error occurs and What solution could be used to resolve this problem..
First of all, Let's look at the adapters installation directory and its structures on Oracle SOA Suite 10.1.3.x .
When the adapters are first deployed to the application server, adapter rar files will be copied into different Adapter
Home which is $ORACLE_HOME/j2ee/<soa container>/connectors/<Adapter Name> , where <soa container> is the
SOA container name, and <Adapter Name> is the directory created for each adapters to store binaries and
deployment descriptors. Then the application server will extract these rar files into a sub directory which contains a jar
file with all the compiled java classes, and a META_INF folder where the deployment descriptors, like ra.xml, oc4j-
ra.xml or weblogic-ra.xml are stored. All these files will be maintained by the application server which knows when to
reload the new vesion of these files by comparing the timestamps.
When attempting to apply a patch for these adapters. Opatch will only update the RAR file with the patched jar file,
but not the jar file in the adapter sub directory under Adapter Home. In normal situation, the jar file should be
synchronized with the one in rar file, But in some cases, especially when the timestamps information for the rar and
jar files got corrupted, application server will not be able to identify the changes made in the rar file, and it will cause
inconsistency between the rar and jar file.
How to resolve this problem? to ensure the jar file always got updated correctly after a new patch is applied, as a best
practice, you should manually remove the Adapter folder and force the jar file generated by application server.
Another best practice is that you should alway have a backup of the deployment descriptor files before applying the
patch containing fixes for adapters. It is because the old files will be overwritten by the default one, and your previous
configuration will be lost.
Comments (0)
Archives
The views expressed on this blog are my own and do not necessarily reflect the views of Oracle. Terms of Use | Your Privacy Rights
http://blogs.oracle.com/soa_how_to/ 9/21/2010