Saturday, December 31, 2011

HOW TO MOVE,COPY AND DELETE A FILE BY USING FILE ADAPTER


Oracle Application Server 10g Release 10.1.3.4  onwards and 11G includes the following new features for the File and FTP adapters.

To MOVE, COPY , RENAME and DELETE  a file using File/FTP Adapter follow below steps

1. Create File/FTP adapter.

2. Select the Operation Type as "Write" and Override the default operation Say "RenameFileService".

3. Select the directory and file name for the incoming files.

4. Select the message Schema as "Native".

5. Click on Finish.

6. Create an Invoke activity in your BPEL for the Adapter you have created.

7. Open the Adapter WSDL and modify the JCA Operation as below

<jca:operation InteractionSpec="oracle.tip.adapter.file.outbound.FileIoInteractionSpec"

SourcePhysicalDirectory="<
Source Directory Path>"

SourceFileName="<Source File Name>"

TargetPhysicalDirectory="<
Target Directory Path>"

TargetFileName="<Target File Name>"

Type="MOVE">

</jca:operation>

Note: For renaming a file keep the source and target as same directories.

On invoking the above adapter the file name will be renamed from <Source File Name> to <Target File Name>

Note:The above interaction Spec is not supported in JDeveloper 10.1.3.3 and 10.1.3.4 but supported at runtime.

Thursday, October 13, 2011

ResourceDisabledException

Uncomment the following line in setDomainEnv.sh (for Linux) or

setDomainEnv.bat (for Windows) for JAVA_OPTIONS, and restart the server.


-Dweblogic.resourcepool.max_test_wait_secs=30



This file is located at %MW_HOME%/userprojects/domains/%domain name%/bin/

 If this line does not exist, add it. Without this setting, large payload scenarios fail

with ResourceDisabledException for the dehydration data source

Thursday, September 15, 2011

Dehydration Properties in SOA 11G

Below properties if we add in composite.xml then instances will be dehydrated

By setting these properties we can achieve lot of performance

...
<component name="myBPELServiceComponent">
....
<property name="bpel.config.inMemoryOptimization">true</property>
<property name="bpel.config.completionPersistPolicy">faulted</property>
</component>

bpel.config.inMemoryOptimization

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 create
dehydration points in the process

bpel.config.completionPersistPolicy

This property configures how the instance data is saved. It can only be set at the
BPEL service component level. The following values are available:

■ on (default): The completed instance is saved normally.
■ deferred: The completed instance is saved, but with a different thread and
in another transaction.
■ faulted: Only the faulted instances are saved.
■ off: No instances of this process are saved.

Tuesday, September 13, 2011

OutOfMemoryError in SOA

If OutOfMemoryError occurs frequently, then there should be need to increase java

Heap Size memory.

To increase Heap size memory do the following steps

Step1: Make a backup for setSOADomainEnv.sh (/user_projects/domain/<soa_domain_name>/bin/setSOADomainEnv.sh

Step2. In the file called setSOADomainEnv.sh

- replace

DEFAULT_MEM_ARGS="-Xms512m -Xmx1024m"
PORT_MEM_ARGS="-Xms768m -Xmx1536m"

- with

if [ "${SERVER_NAME}" = "SERVERNAME" ]; then
DEFAULT_MEM_ARGS="-Xms2048m -Xmx2048m"
PORT_MEM_ARGS="-Xms2048m -Xmx2048m"
else
DEFAULT_MEM_ARGS="-Xms512m -Xmx1024m"
PORT_MEM_ARGS="-Xms768m -Xmx1536m"
fi

Step3. restart the servers

Thursday, August 11, 2011

How to Rename composite in SOA 11g

Follow these steps for renaming SOA Composite.

Step 1:  select any SOA project and click on File menu and  select rename

Enter the new name










Step 2
: Next change the old name in composite .xml



Step 3:
Right click on project and select project properties

            Then go to Deployment




Step 4:
Delete the existing SOA-SAR file and create new SOA-SAR file and click ok.

Now you will get deployment jar file with new name.













Friday, August 5, 2011

How to work on Fault Policies in SOA 11g

Place all *.xsd files in XSD directory and place all  *.xml files in project directory at composite.xml level
and deploy the service

then if any service is unavailable then we can do fault recoveries and re-triggering of webservices in em console

=========================================================================
fault-policies.xsd
========================================================================
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://schemas.oracle.com/bpel/faultpolicy"
xmlns:tns="http://schemas.oracle.com/bpel/faultpolicy"
xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
 <!-- Conditions contain a list of fault names -->
    <xs:element name="Conditions">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="faultName" type="tns:faultNameType"
 maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <!-- action Ref must exist in the same file -->
    <xs:complexType name="actionRefType">
        <xs:attribute name="ref" type="xs:string" use="required"/>
    </xs:complexType>
    <!-- one condition has a test and action, if test is missing, this is the
 catch all condition -->
    <xs:complexType name="conditionType">
        <xs:all>
            <xs:element name="test" type="tns:idType" minOccurs="0"/>
            <xs:element name="action" type="tns:actionRefType"/>
        </xs:all>
    </xs:complexType>
    <!-- One fault name match contains several conditions -->
    <xs:complexType name="faultNameType">
        <xs:sequence>
            <xs:element name="condition" type="tns:conditionType"
 maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attribute name="name" type="xs:QName"/>
    </xs:complexType>
    <xs:complexType name="ActionType">
        <xs:choice>
            <xs:element name="retry" type="tns:RetryType"/>
            <xs:element ref="tns:rethrowFault"/>
            <xs:element ref="tns:humanIntervention"/>
            <xs:element ref="tns:abort"/>
            <xs:element ref="tns:replayScope"/>
            <xs:element name="javaAction" type="tns:JavaActionType">
                <xs:key name="UniqueReturnValue">
                    <xs:selector xpath="tns:returnValue"/>
                    <xs:field xpath="@value"/>
                </xs:key>
            </xs:element>
        </xs:choice>
        <xs:attribute name="id" type="tns:idType" use="required"/>
    </xs:complexType>
    <xs:element name="Actions">
        <xs:annotation>
            <xs:documentation>Fault Recovery Actions</xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element name="Action" type="tns:ActionType"
 maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:complexType name="JavaActionType">
        <xs:annotation>
            <xs:documentation>This action invokes java code
 provided</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="returnValue" type="tns:ReturnValueType"
 minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attribute name="className" type="tns:idType" use="required"/>
        <xs:attribute name="defaultAction" type="tns:idType" use="required"/>
        <xs:attribute name="propertySet" type="tns:idType"/>
    </xs:complexType>
    <xs:complexType name="RetryType">
        <xs:annotation>
            <xs:documentation>This action attempts retry of activity
 execution</xs:documentation>
        </xs:annotation>
        <xs:all>
            <xs:element ref="tns:retryCount"/>
            <xs:element ref="tns:retryInterval"/>
            <xs:element ref="tns:exponentialBackoff" minOccurs="0"/>
            <xs:element name="retryFailureAction"
 type="tns:retryFailureActionType" minOccurs="0"/>
            <xs:element name="retrySuccessAction"
 type="tns:retrySuccessActionType" minOccurs="0"/>
        </xs:all>
    </xs:complexType>
    <xs:simpleType name="idType">
        <xs:restriction base="xs:string">
            <xs:minLength value="1"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:complexType name="ReturnValueType">
        <xs:annotation>
            <xs:documentation>Return value from java code can chain another action
 using
                     return values</xs:documentation>
        </xs:annotation>
        <xs:attribute name="value" type="tns:idType" use="required"/>
        <xs:attribute name="ref" type="xs:string" use="required"/>
    </xs:complexType>
    <xs:element name="exponentialBackoff">
        <xs:annotation>
            <xs:documentation>Setting this will cause retry attempts to use
                     exponentialBackoff algorithm</xs:documentation>
        </xs:annotation>
        <xs:complexType/>
    </xs:element>
    <xs:element name="humanIntervention">
        <xs:annotation>
            <xs:documentation>This action causes the activity to
 freeze</xs:documentation>
        </xs:annotation>
        <xs:complexType/>
    </xs:element>
    <xs:element name="replayScope">
        <xs:annotation>
            <xs:documentation>This action replays the immediate enclosing
 scope</xs:documentation>
        </xs:annotation>
        <xs:complexType/>
    </xs:element>
    <xs:element name="rethrowFault">
        <xs:annotation>
            <xs:documentation>This action will rethrow the
 fault</xs:documentation>
        </xs:annotation>
        <xs:complexType/>
    </xs:element>
    <xs:element name="retryCount" type="xs:positiveInteger">
        <xs:annotation>
            <xs:documentation>This value is used to identify number of
 retries</xs:documentation>
        </xs:annotation>
    </xs:element>
    <xs:complexType name="retryFailureActionType">
        <xs:annotation>
            <xs:documentation>This is the action to be chained if retry attempts
 fail</xs:documentation>
        </xs:annotation>
        <xs:attribute name="ref" type="xs:string" use="required"/>
    </xs:complexType>
    <xs:complexType name="retrySuccessActionType">
        <xs:annotation>
            <xs:documentation>This is the action to be chained if retry attempts
 is successful</xs:documentation>
        </xs:annotation>
        <xs:attribute name="ref" type="xs:string" use="required"/>
    </xs:complexType>
    <xs:element name="retryInterval" type="xs:unsignedLong">
        <xs:annotation>
            <xs:documentation>This is the delay in milliseconds of retry
 attempts</xs:documentation>
        </xs:annotation>
    </xs:element>
    <xs:element name="abort">
        <xs:annotation>
            <xs:documentation>This action terminates the
 process</xs:documentation>
        </xs:annotation>
        <xs:complexType/>
    </xs:element>
    <xs:element name="Properties">
        <xs:annotation>
            <xs:documentation>Properties that can be passes to a custom java
 class</xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element name="propertySet" type="tns:PropertySetType"
 maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:complexType name="PropertySetType">
        <xs:sequence>
            <xs:element name="property" type="tns:PropertyValueType"
 maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attribute name="name" type="tns:idType" use="required"/>
    </xs:complexType>
    <xs:complexType name="PropertyValueType">
        <xs:simpleContent>
            <xs:extension base="tns:idType">
                <xs:attribute name="name" type="tns:idType" use="required"/>
            </xs:extension>
        </xs:simpleContent>
    </xs:complexType>
    <xs:element name="faultPolicy">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="tns:Conditions"/>
                <xs:element ref="tns:Actions"/>
                <xs:element ref="tns:Properties" minOccurs="0"/>
                <!--Every policy has on Conditions and and one Actions, however,
 Properties is optional -->
            </xs:sequence>
            <xs:attribute name="id" type="tns:idType" use="required"/>
            <xs:attribute name="version" type="xs:string" default="2.0.1"/>
        </xs:complexType>
        <xs:key name="UniqueActionId">
            <xs:selector xpath="tns:Actions/tns:Action"/>
            <xs:field xpath="@id"/>
        </xs:key>
        <xs:key name="UniquePropertySetId">
            <xs:selector xpath="tns:Properties/tns:property_set"/>
            <xs:field xpath="@id"/>
        </xs:key>
        <xs:keyref name="RetryActionRef" refer="tns:UniqueActionId">
            <xs:selector xpath="tns:Actions/tns:Action/tns:retry/tns:retryFailureAction"/>
            <xs:field xpath="@ref"/>
        </xs:keyref>
        <xs:keyref name="RetrySuccessActionRef" refer="tns:UniqueActionId">
            <xs:selector
 xpath="tns:Actions/tns:Action/tns:retry/tns:retrySuccessAction"/>
            <xs:field xpath="@ref"/>
        </xs:keyref>
        <xs:keyref name="JavaActionRef" refer="tns:UniqueActionId">
            <xs:selector
 xpath="tns:Actions/tns:Action/tns:javaAction/tns:returnValue"/>
            <xs:field xpath="@ref"/>
        </xs:keyref>
        <xs:keyref name="ConditionActionRef" refer="tns:UniqueActionId">
            <xs:selector
 xpath="tns:Conditions/tns:faultName/tns:condition/tns:action"/>
            <xs:field xpath="@ref"/>
        </xs:keyref>
        <xs:keyref name="JavaDefaultActionRef" refer="tns:UniqueActionId">
            <xs:selector xpath="tns:Actions/tns:Action/tns:javaAction"/>
            <xs:field xpath="@defaultAction"/>
        </xs:keyref>
        <xs:keyref name="JavaPropertySetRef" refer="tns:UniquePropertySetId">
            <xs:selector xpath="tns:Actions/tns:Action/tns:javaAction"/>
            <xs:field xpath="@property_set"/>
        </xs:keyref>
    </xs:element>
    <xs:element name="faultPolicies">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="tns:faultPolicy" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>
=====================================================================================

fault-bindings.xsd
=====================================================================================
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://schemas.oracle.com/bpel/faultpolicy"
 xmlns:tns="http://schemas.oracle.com/bpel/faultpolicy"
 xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
    <xs:element name="faultPolicyBindings">
        <xs:annotation>
            <xs:documentation>Bindings to a specific fault policy
 </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element name="composite" type="tns:compositeType"
 minOccurs="0" maxOccurs="1"/>
                <xs:element name="component" type="tns:componentType"
 minOccurs="0" maxOccurs="unbounded"/>
                <xs:element name="reference" type="tns:referenceType"
 minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
            <xs:attribute name="version" type="xs:string" default="2.0.1"/>
        </xs:complexType>
        <xs:key name="UniquePartnerLinkName">
            <xs:selector xpath="tns:reference/tns:name"/>
            <xs:field xpath="."/>
        </xs:key>
        <xs:key name="UniquePortType">
            <xs:selector xpath="tns:reference/tns:portType"/>
            <xs:field xpath="."/>
        </xs:key>
        <xs:key name="UniquePolicyName">
            <xs:selector xpath="tns:reference"/>
            <xs:field xpath="@faultPolicy"/>
        </xs:key>
    </xs:element>
    <xs:simpleType name="nameType">
        <xs:restriction base="xs:string">
            <xs:minLength value="1"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:complexType name="propertyType">
        <xs:simpleContent>
            <xs:extension base="tns:nameType">
                <xs:attribute name="name" type="xs:string" use="required"
 fixed="faultPolicy"/>
            </xs:extension>
        </xs:simpleContent>
    </xs:complexType>
 
    <xs:complexType name="referenceType">
        <xs:annotation>
            <xs:documentation>Bindings for a partner link. Overrides composite
 level binding.</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:annotation>
                <xs:documentation>Specification at partner link name overrides
 specification for a port type</xs:documentation>
            </xs:annotation>
            <xs:element name="name" type="tns:nameType" minOccurs="0"
 maxOccurs="unbounded"/>
            <xs:element name="portType" type="xs:QName" minOccurs="0"
 maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attribute name="faultPolicy" type="tns:nameType" use="required"/>
    </xs:complexType>
 
    <xs:complexType name="componentType">
        <xs:annotation>
            <xs:documentation>Binding for a component </xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="name" type="tns:nameType" minOccurs="0"
 maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attribute name="faultPolicy" type="tns:nameType" use="required"/>
    </xs:complexType>
    <xs:complexType name="compositeType">
        <xs:annotation>
            <xs:documentation>Binding for the entire composite</xs:documentation>
        </xs:annotation>
        <xs:attribute name="faultPolicy" type="tns:nameType" use="required"/>
    </xs:complexType>
</xs:schema>
=========================================================================================

fault-bindings.xml

==========================================================================================
<?xml version="1.0" encoding="UTF-8"?>
<faultPolicyBindings version="2.0.1"
 xmlns="http://schemas.oracle.com/bpel/faultpolicy"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <composite faultPolicy="ConnectionFaults"/>
</faultPolicyBindings>


==========================================================================================
 fault-policies.xml

==========================================================================================
<?xml version="1.0" encoding="UTF-8"?>
<faultPolicies xmlns="http://schemas.oracle.com/bpel/faultpolicy">
  <faultPolicy version="2.0.1" id="ConnectionFaults">
    <Conditions>
      <faultName xmlns:medns="http://schemas.oracle.com/mediator/faults"
 name="medns:mediatorFault">
        <condition>
         <!--test>contains($fault.mediatorErrorCode, "03303")</test-->
          <action ref="ora-human-intervention"/>
        </condition>
      </faultName>
      <faultName xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
                 name="bpelx:remoteFault">
        <condition>
          <!--test>$fault.code="ORA"</test-->
          <action ref="ora-retry"/>
        </condition>
      </faultName>
      <faultName xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
                 name="bpelx:bindingFault">
        <condition>
          <!--test xmlns:test="http://test">$fault.code="1400"</test-->
          <action ref="ora-human-intervention"/>
        </condition>
        </faultName>
     </Conditions>
    <Actions>
        <Action id="ora-retry">
          <retry>
            <retryCount>3</retryCount>
            <retryInterval>2</retryInterval>
            <exponentialBackoff/>
            <retryFailureAction ref="ora-java"/>
            <retrySuccessAction ref="ora-terminate"/>
          </retry>
        </Action>
        <Action id="ora-rethrow-fault">
        <rethrowFault/>
      </Action>
      <Action id="ora-human-intervention">
        <humanIntervention/>
      </Action>
      <Action id="ora-terminate">
        <abort/>
      </Action>
        <!--Action id="ora-java">
          <javaAction className="com.oracle.bpel.client.config.faultpolicy.TestJavaAction"
                    defaultAction="ora-terminate"
                    propertySet="prop-for-billing">
          <returnValue value="REPLAY" ref="ora-terminate"/>
          <returnValue value="RETRHOW" ref="ora-rethrow-fault"/>
          <returnValue value="ABORT" ref="ora-terminate"/>
          <returnValue value="RETRY" ref="ora-retry"/>
          <returnValue value="MANUAL" ref="ora-human-intervention"/>
        </javaAction>
      </Action-->
      <Action id="ora-java">
        <javaAction className="mypackage.myClass" defaultAction="ora-terminate">
          <returnValue value="ABORT" ref="ora-terminate"/>
          <returnValue value="RETRY" ref="ora-retry"/>
          <returnValue value="MANUAL" ref="ora-human-intervention"/>
        </javaAction>
      </Action>
   </Actions>
  </faultPolicy>
</faultPolicies>
===========================================================================================

Monday, July 25, 2011

How to Set the Trace Level of Oracle JCA Adapters

To set the trace level by using the Fusion Middleware Control Console:


1. Navigate to http://servername:portnumber/em.

The Fusion Middleware Control Console home page is displayed.

2. Right-click soa-infra from the SOA Folder in the Navigator in the left pane.

The console displays a menu.

Select Logs, and the Log Configuration, as shown in Figure





3.Locate oracle.soa.adapter in the Logger Name list, and change the log level in the

Oracle Diagnostic Logging Level (Java Level) field. In this example, select Trace:32

(FINEST) from the list, as shown in Figure




 

You can view the logs for Oracle JCA Adapters as follows:

■ Oracle JCA Adapters and Oracle Adapter for Oracle Applications: These adapters

implement the LogManager interface of the JCA Binding Component, which

redirects log files in the Oracle Diagnostic Logging (ODL) format. For both

outbound and inbound interactions, the log files are redirected to the

soa-diagnostic.log file.The log files for the Oracle SOA Suite that is deployed to the server-soa

managed server are located in:MW_HOME/user_projects/domains/domain_

name/servers/server-soa/logs/soa-diagnostic.log


■ Packaged-application adapters: These adapters do not implement the

LogManager interface because it is not part of the J2CA 1.5 standard. Therefore,

for system components the log outputs are redirected to

ORACLE_INSTANCE\diagnostics\logs\component_type\component_

name. For outbound interactions, the logs are directed to the same location. On the

other hand, for inbound interactions, logs are redirected to

soa-diagnostic.log.