Wednesday, March 7, 2012

Oracle SOA Suite - Generic plan file to deploy the composites to different environments


Oracle SOA Suite - Generic plan file to deploy the composites to different environments:

The deployment plan file can be used to change the run time configurations like WSDL endpoint, value of the partner link properties and the host details across the environments.
The below approach will help you to have one tokenized deployment plan file (template plan file) and build.properties file for each environments. The tokens will be replaced at deployment time based on the details available in the build.properties file corresponds to the particular environment. The generated deployment file needs to be attached to the composite.

Create a template plan file with tokenized properties that needs to be replaced with the build.properties file data - EAI_cfgplan_template.xml


<?xml version="1.0" encoding="UTF-8"?>
<SOAConfigPlan xmlns:jca="http://platform.integration.oracle/blocks/adapter/fw/metadata" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:orawsp="http://schemas.oracle.com/ws/2006/01/policy" xmlns:edl="http://schemas.oracle.com/events/edl" xmlns="http://schemas.oracle.com/soa/configplan">
<composite name="Test_Invoker | Test1_invoker">
<reference name="Test">
<binding type="*">
<property name="oracle.webservices.auth.password">
<replace>@[email protected]</replace>
</property>
<property name="oracle.webservices.auth.username">
<replace>@[email protected]</replace>
</property>
</binding>
</reference>
</composite>
<wsdlAndSchema name="Test1.wsdl|Test2.wsdl ">
<searchReplace>
<search>http://testserver:8000</search>
</searchReplace>
</wsdlAndSchema>
</SOAConfigPlan>

Create build property files for each environment


dev_build.properties
server.host= server1.com
server.port=7003
server.protocol=http
server.username=testuser
server.password=password
QA_build.properties
server.host= server1.com
server.port=7003
server.protocol=http
server.username=QAuser
server.password=password


Ant script to generate the actual plan files by filling the tokens in the template plan files from the environment property file - GeneratePlanFile.xml


<?xml version="1.0" encoding="iso-8859-1"?>
<project name="GeneratePlanfile" default="generatePlanfile" basedir=".">
<target name="generatePlanfile">
<delete>
<fileset dir="${basedir}" includes="EAI_cfgplan.xml"/>
</delete>
<copy file="${basedir}/EAI_cfgplan_template.xml" tofile="EAI_cfgplan.xml">
<filterchain>
<filterreader classname="org.apache.tools.ant.filters.ReplaceTokens">
<param type="propertiesfile" value="${basedir}/${envType}_build.properties"/>
<param type="tokenchar" name="begintoken" value="@"/>
<param type="tokenchar" name="endtoken" value="@"/>
</filterreader>
</filterchain>
</copy>
</target>
</project>

Execute the ant script, this will generate the actual Plan file required as shown below


ant -DenvType=dev -f GeneratePlanFile.xml

EAI_cfgplan.xml


<?xml version="1.0" encoding="UTF-8"?>
<SOAConfigPlan xmlns:jca="http://platform.integration.oracle/blocks/adapter/fw/metadata" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:orawsp="http://schemas.oracle.com/ws/2006/01/policy" xmlns:edl="http://schemas.oracle.com/events/edl" xmlns="http://schemas.oracle.com/soa/configplan">
<composite name="Test_Invoker | Test1_invoker">
<reference name="Test">
<binding type="*">
<property name="oracle.webservices.auth.password">
<replace>password</replace>
</property>
<property name="oracle.webservices.auth.username">
<replace>testuser</replace>
</property>
</binding>
</reference>
</composite>
<wsdlAndSchema name="Test1.wsdl|Test2.wsdl ">
<searchReplace>
<search>http://testserver:8000</search>
<replace>http://server1.com/7003</replace>
</searchReplace>
</wsdlAndSchema>
</SOAConfigPlan>


Thursday, March 1, 2012

Oracle SOA Suite – Skip locking for DBAdapter connection factories in clustered environments

Oracle SOA Suite – Skip locking for DBAdapter connection factories in clustered environments:

Skip Locking is the new property introduced in Oracle SOA Suite 11g for the DBAdapter Connection factories.



“In a distributed scenario, each polling instance will try to balance the load by not greedily attempting to process all unprocessed rows by itself. What that means is that at a time, an instance will only fetch at most MaxTransactionSize rows”.
When using skip locking, if a full MaxTransactionSize rows are fetched, the next MaxTransactionSize rows can be immediately fetched continuously. This is because concurrent threads do no block each other when using skip locking. The Skip Locking offers performance benefits.
However, with skip locking disabled, all threads will try to lock the same rows, and only one will succeed. Consequently, once this thread has processed MaxTransactionSize rows, it will pause until the next polling interval, to allow other threads to also lock and process rows.
If we want to limit the number of records processed(MaxTransactionSize) in a particular polling interval then the SkipLocking should be disabled, the maximum throughput for each node with distributed polling enabled but uses SkipLocking disabled is:
NumberOfThreads x MaxTransactionSize/PollingInterval


Tuesday, February 28, 2012

Applying the JRF to the weblogic cluster through WLST


Applying the JRF to the weblogic cluster through WLST

Java Required Files (JRF) consists of those components not included in the WebLogic Server installation that provide common functionality for Oracle business applications and application frameworks.

It consists of a number of independently developed libraries and applications that are deployed into a common location. The following components are considered part of Java Required Files: Oracle Application Development Framework, Oracle Fusion Middleware Audit Framework, Dynamic Monitoring Service, Fabric Common, HTTP Client, Infrastructure Security, Java Object Cache, JMX Framework, JPS, logging, MDS, OJSP.Next, Oracle Web Services, Oracle Web Services Manager, Oracle TopLink, UCP, XDK.


applyJRF


Configures a Managed Server or cluster with Java Required Files (JRF). Managed Servers that are added by product templates during the template extension process do not need to be explicitly configured with JRF using this command.

Use the applyJRF command when additional Managed Servers or clusters are added to a domain after it is initially extended with a product template.

The applyJRF command is required any time you add a Managed Server to a JRF-only domain, or if you add a Managed Server that has been configured for JRF to a domain that contains other Oracle products.


WLST Script


When we are creating the core weblogic cluster JRF is not applied by default, the below WLST script will help us to apply the JRF for the weblogic cluster.

WLST Script


applyJRFToDomain.py


The below script applies the JRF to the cluster with Cluster1 - modify cluster name based on your requirement, indivdual Managed Servers also applied the JRF

Script

https://github.com/techforum-repo/youttubedata/blob/master/scripts/wlst/applyJRFToDomain.py

ORACLE_COMMON_HOME\common\bin\wlst.cmd applyJRFToDomain.py

Now the JRF is applied to the cluster "Cluster1"


Friday, February 24, 2012

Oracle SOA Suite 11g - Error retrieving NXSD encoding exception in MQ adapter

Oracle SOA Suite 11g - Error retrieving NXSD encoding exception in MQ adapter:

The following exception has been thrown whenever a composite enqueue the message to the Queue through the MQ Adapter.
MQSeriesAdapter PropagateOrderRequest:OrderRequest [ Enqueue_ptt::Enqueue(Request) ] Error retrieving NXSD encoding...>>
<11-Jan-2012 12:58:16 o'clock GMT> <Notice> <Stdout> <BEA-000000> <<11-Jan-2012 12:58:16 o'clock GMT> <Error> <oracle.soa.adapter> <BEA-000000> <MQSeriesAdapter CCRMOM_PropagateOrderRequest:OrderRequest [ Enqueue_ptt::Enqueue(Request) ]
java.lang.NullPointerException
This is a Runtime exception, even after receiving the above exception the messages are successfully enqueued.

The Oracle SOA Suite version in which the issue has been observed is 11.1.1.5.0

Solution to suppress this exception:

               We have applied the patch 13718139 as suggested by oracle and it resolved the issue.
               Download the patch from metalink by specifying the patch number as 13718139.


Saturday, February 18, 2012

Oracle SOA Suite 11g - Callback not reaching the calling service in a Clustered environment

Oracle SOA Suite 11g - Callback not reaching the calling service in a Clustered environment:


In Oracle SOA Suite 10g, we had a scenario like shown in the below diagram.

Process A


Process A calls Process B and waits for the call back; after receiving the call back; The Process A calls again the same Process B and waits for the second call back.
This flow is working fine in 10g but after migrating to 11g the second call back is not reaching the Process A.
In the SOA log file we could able to see the below error message -
an unhandled exception has been thrown in the Collaxa Cube systemr; exception reported is: "javax.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.1.3.v20110304-r9073): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique constraint (SOA_SOAINFRA.AT_PK) violated

Error Code: 1
Call: INSERT INTO AUDIT_TRAIL (CIKEY, COUNT_ID, NUM_OF_EVENTS, BLOCK_USIZE, CI_PARTITION_DATE, BLOCK_CSIZE, BLOCK, LOG) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
bind => [851450, 5, 0, 118110, 2012-01-12 16:08:04.063, 5048, 3, [[email protected]]
Query: InsertObjectQuery([email protected])
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.flush(EntityManagerImpl.java:744)
After the detail analysis and the Oracle SR, the root cause is “Audit Trail caching issue is causing the process not to get to complete due to the exception while doing the second call back”.
Let’s say in a Cluster with four nodes Process A first created on node 1 and carried on and called first call to Process B and dehydrates. Assume that second call hit a node other than node 1, let’s say node 4. Node 4 carries on doing the work and does the second call to Process B and dehydrates. If the second call back hits Node 1, rather than getting the latest audit trail from database, it’s using the cache and trying to update the audit trial with an id which node 4 already used. That’s throwing an exception and rolling back. For that reason the call back is not getting delivered.
As a temporary solution by switching of the audit trail for Process A, it doesn’t try to insert the data into audit trail and the transaction won’t get roll back and the call has reached successfully.
As a permanent solution, Oracle has provided the patch, the same can be download from the below path.
The issue identified in the SOA Suite version – 11.1.1.5.0