Friday 17 November 2017

OSB 12c FileAdapter : Physical/Logical Output Directory has invalid value BINDING.JCA-11043

Once trying to deploy a OSB FileAdapter service and activating the changes I received the below Error:

Error(s) found in module 'FileAdapterService'.
Invalid JCA transport endpoint configuration, exception: BINDING.JCA-11043
Invalid Interaction parameter.
Invalid Interaction parameter.
Interaction parameter Physical/Logical Output Directory has invalid value {/placeholder}.
Please correct the value of the interaction parameter and redeploy the process.
 at FileAdapter.biz

Cause -
The issue is typically caused by a invalid directory definition in the business service.
Means, the file path that you have defined in the adapter is invalid.

Solution -
Correct the file path definition, check if the path is valid and has the right permissions.


Helpful? Please Comment.

Happy Learning!!

SOA 12c BPEL : Invoke Partner Service using SOAP Header

If you have to invoke a partner service which requires username and password to be populated in the SOAP Header custom elements you can follow the below steps as I did.

Before we come to the BPEL part, validate the custom elements that should be part of the schema definition and WSDL binding:

1. Your target service schema will have a header element like below:

<schema elementFormDefault="qualified" attributeFormDefault="unqualified" targetNamespace="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2001/XMLSchema">
<element name="Header">
     <complexType>
        <sequence>
            <element name="username" type="string"/>
            <element
name="password" type="string"/>
         </sequence>
     </complexType>
</element>
</schema>


2. In the target service WSDL below declaration should be made

a. Message: (check your namespace and edit accordingly below)

<message name="InputHeaderMessage">
    <part
name="header" element="tns:header"/>
</message>


b. Binding:

<binding name="HeaderTest" type="tns:HeaderTest">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<operation
name="process">
<soap:operation style=document soapAction="http://xmlns.oracle.com/HeaderTestApp/HeaderTestBPEL"/>

  <input>
    <soap:header message="tns:InputHeaderMessage" part="header" use="literal"/>
    <soap:body parts="payload" use="literal"/>
  </input>
</operation>
</binding>


3. Create 2 preference variables in composite.xml

    <property name="bpel.preference.username">test</property>
    <property
name="bpel.preference.password">test1</property>

4. Now coming to BPEL, we will first create a variable varHeader of type Element and select the header element from the schema.

5. Add Assign activity in BPEL and assign the preference value to the variables username and password.

    ora:getPreference("username") - $varHeader.username
    ora:getPreference("password") - $varHeader.password

6. Add Invoke activity below, connect to the target partnerLink.
7. Open the invoke activity, click on Header tab and select the variable varHeader

          

8. Save, Deploy and Test.


Helpful? Please Comment.

Happy Learning!!

Monday 13 November 2017

SOA 12c DBAdapter : JCA Binding execute of Reference operation 'insert' failed Caused by java.sql.SQLException: Attempt to set connection harvestable to false but the connection is already closed.

Recently when trying to test a DBAdapter service I came across this issue. You can follow the same steps as I did to resolve the problem.

Error:
com.oracle.bpel.client.BPELFault: faultName:
{{http://schemas.oracle.com/bpel/extension}remoteFault} messageType:
{{http://schemas.oracle.com/bpel/extension}RuntimeFaultMessage} parts: {{ summary=Exception occurred when binding was invoked.
 Exception occurred during invocation of JCA binding: "JCA Binding execute of Reference operation 'insert' failed due to:
 DBWriteInteractionSpec Execute Failed Exception. insert failed. Descriptor name: [EmpTemp.Emp_Temp]
Caused by java.sql.SQLException: Attempt to set connection harvestable to false but the connection is already closed.

Actual Reason:
DS that you are using is stale.
Means, lately the DBMS that you are connecting to, was restarted or refreshed and WebLogic Server lost the connection to it.

Why this happened?
You have not yet configured the pool to test connections, so once the connection is dead,
WLS still knows nothing about that, and will save and serve up dead connections until the pool is rebuilt.

Do one or both of the below things:

Solution: Enable test-connection-on-reserve (so that is does not happen again).
Or
Implement Work-around: Reset the datasource from the console after the DBMS is back up.

When you reset the database connections in a JDBC data source, WebLogic Server closes and recreates all available database connections in the pool of connections in the data source.

To reset database connections in a JDBC data source:

1. Navigate to the data source that you want to reset:
2. Select the Control tab.
3. On the Control page, select the instances of the data source that you want to reset.
    Date source instances are listed by the server on which they are deployed.
4. Click the Reset button.
5. Click Yes to confirm the action.

     Results are displayed at the top of the page, and the Status of Last Action is changed to SUCCESS for each data source that you selected to reset.


Helpful? Please Comment.

Happy Learning!!


SOA 12c JDeveloper : Configure Microsoft SQL Server Driver for DBAdapter

Here is what you should do if you want to create a database connection to Microsoft SQL Server.

Firstly, obtain the library for the SQLServer JDBC driver library bundle.
You can use the below link.
http://www.microsoft.com/en-us/download/details.aspx?id=21599

Unzip the archive.
Inside you will find sqljdbc4.jar, which will be the library we will use.

1. In JDeveloper, navigate to Tools > Preferences
2. Under Preferences, left margin, expand Database
3. Select 'JDBC Driver Options'



4. Click on +
5. Below, browse the Library
6. On 'Select Library', click on New
7. Enter library name, sqljdbc4.jar [no-spaces] and click on 'Add Entry'
8. Locate the library that we downloaded and extracted; sqljdbc4.jar
9. Click on OK, again OK and come back to Preferences page
10. Enter the driver class as 'com.microsoft.sqlserver.jdbc.SQLServerDriver'
11. Click on OK.

12. Now go to Resource palette,  and create a New Database connection.
13. Select 'Connection Type' as SQLServer
14. Provide all the connection details of the SQLServer you want to connect to
15. Test your connection.
16. Click OK and you are done.

Helpful? Please Comment.

Happy Learning!!

SOA 12c : Deployment Error MDS-00039: error while attempting to parse the document .diagram.xml

If you are trying to deploy a recently changed service composite to Enterprise Manager and getting the below error:

Deploying on "/Domain/soa_domain/soa_server1" failed!
There was an error deploying the composite on soa_server1: oracle.mds.transfer.TransferException:
MDS-00001: exception in Metadata Services layer
oracle.mds.exception.MDSRuntimeException: MDS-00039: error while attempting to parse the document /deployed-composites/Test/TestBPEL_rev1.0/SCA-INF/TestBPEL.diagram.xml using SAX.
oracle.xml.parser.v2.XMLParseException; lineNumber: 1; columnNumber: 1; Start of root element expected.
MDS-00001: exception in Metadata Services layer:

Reason: The SCA-INF folder contents are stale.

Here is what you should do.

1. In JDeveloper navigate to your project, select it.
2. Under tab Build (Alt + B), select Clean project.jpr
3. Re-build your project/sar and deploy.

Helpful? Please Comment.

Happy Learning!!

SOA 12c DBAdapter : JDeveloper Error Element 'properties' used but not declared

If you are trying to open your DBAdapter configuration but getting the below error in popup:

java.util.InvalidPropertiesFormatException:
org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 12; <Line 2, Column 12>:
XML-20149: (Error) Element 'properties' used but not declared.
    at sun.util.xml.PlatformXmlPropertiesProvider.load(PlatformXmlPropertiesProvider.java:80)
    at java.util.Properties$XmlSupport.load(Properties.java:1201)

The configuration still opens if you ignore the error but properties don't load correctly.

The reason for this error is that the properties declaration is missing from the adapter-properties.xml file.

Add the below line before the properties element in your adapter-properties.xml file.

<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">

Save and retry.

Helpful? Please Comment.

Happy Learning!!

OSB 12c : Dynamic Routing to Business/Proxy Service

Dynamic routing is a kind of  Content-based Routing pattern, which is used when the BusinessService/ProxyService path is required to be de...