Thursday, July 23, 2009

ORABPEL-10903

Problem:
ORABPEL-10903: "failed to read wsdl" when deploying BPEL process

Solution:
Check your schema file which you are using. There might be a possibility that the schema file name contains spaces. Rename the schema file(with no spaces).

Note that if you are importing that schema in your wsdl file then dont forget to change the name there too.

Redeploy the project and the error will be gone.

ORABPEL-05244

Problem:
ORABPEL-05244 error sometimes occurs in the opmn log shortly after deploying the BPEL process. Furthermore, it may cause the BPEL domain to hang.
The error looks like:
<2009-06-27 11:14:27,752> <ERROR> <default.collaxa.cube> <BaseCubeSessionBean::logError>
Error while invoking bean "process manager": Timed out waiting for process load lock.
Failed to obtain load lock for process "HelloWorld-1.0"; timed out after 120,000 seconds.

Timed out waiting for process load lock.
Failed to obtain load lock for process "HelloWorld-1.0"; timed out after 120,000 seconds.

Solution:
There is no direct solution to solve this problem.
To overcome this there are some suggestion by which you can get rid of such errors. The following suggestions are:
1) Undeploy the existing project.
2) Bounce the SOA Server.

ESB:rejectedMessageHandlers

Problem:
Files which do not adhere to input file schemas should be rejected or moved to specified folder other than archive folder in ESB.

Solution:
For this, first create an ESB project. Add a Read file Adapter to it. Now to set the rejectedMessageHandlers property, we need to open the <Read adapter name>.esbsvc file. This file should be present under ESB project folder.

Add the following code just after the closing tag of invocation i.e. </invocation> and just before the </service> tag.

<endpointProperties>
<property name="rejectedMessageHandlers" value="file://C:\SOADir\reject"/>
</endpointProperties>

Here,
C:\SOADir\reject is my directory where I want my rejected files to come.

Note: If at anytime you try to refresh anything in the project, this property gets omitted automatically. So be sure to add it again in .esbsvc file if you are refreshing anything in the project.

BPEL:rejectedMessageHandlers

Problem:
Files which do not adhere to the input file schemas should be rejected or moved to specified folder other than archive folder.

Solution:
For this we need to make an empty project which will be initiated by a file. We need to use a Read File Adapter. After the Adapter is configured and connected to a Receive activity, a bpel.xml file will be generated.
A property called ‘rejectedMessageHandlers’ is used and set in the bpel.xml file under <activationAgent> element.

Sample code for this should look like:
<activationAgents>
<activationAgent className="oracle.tip.adapter.fw.agent.jca.JCAActivationAgent" partnerLink="Read_File">
<property name="portType">Read_ptt
<property name="rejectedMessageHandlers">file://C:\SOADir\reject
</activationAgent>
</activationAgents>

Here,
C:\SOADir\reject is my directory where I want my rejected files to come.

Note: If at anytime you try to refresh anything in the BPEL project, this property gets omitted automatically. So be sure to add it again in bpel.xml file if you are refreshing any compomnent in the project.

OWSM: File-based authentication

Problem:
Incorporate File based authentication in OWSM

Thoughts:
A good article is already there from Oracle on this topic. I just want to highlight that there is a change in syntax for encoding the file in SOA 10.1.3.1 and SOA 10.1.3.3. We will be using a md5encode utility for doing text file based authentication in OWSM.

Solution:
After creating Gateway and its related service in OWSM, we need to add a policy i.e. file based authentication.
Create a text file and add a user name and password in the following format:- User_name:Password

Now save the file with extension as .htpassword. Now we have to use the md5encode operation to encode the password associated with a user_name.

Syntax: SOA 10.1.3.1
>wsmadmin md5encode username password htpasswdfile

Here,
username – User name in the text file;
password – Password assigned to the user;
htpasswdfile – Name of the file containing the user name and password

Syntax: SOA 10.1.3.3
>wsmadmin md5encode htpasswdfile username

Here,
htpasswdfile – Name of the file containing the user name and password;
username – User name in the text file

Thursday, July 2, 2009

Header Information in ESB

Problem:
To retrieve Header Information in ESB

Solution:

For FTP Adapter:
1) Create a variable in XSL mapper
2) Use the code in XPath:
ehdr:getRequestHeader("/fhdr:InboundFTPHeaderType/fhdr:fileName","fhdr=http://xmlns.oracle.com/pcbpel/adapter/ftp/;")

For File Adapter:
1) Create a variable in XSL mapper
2) Use the code in XPath:
ehdr:getRequestHeader("/fhdr:InboundFileHeaderType/fhdr:fileName","fhdr=http://xmlns.oracle.com/pcbpel/adapter/file/;")

Passing Dynamic value to IN clause

I came across a wonderful solution for passing values dynamically to IN clause in SQL query and would like to share with all.

Problem:
To pass the list of values in IN clause in SQL Query dynamically. We need to just keep in mind that giving ? after IN clause will not work.

Solution:
1) Use DB Adapter, select Execute Custom SQL as Operation Type and click on Next
2)You need to write a SQL query like the one given below if you want to use IN clause in SQL query and pass the value list dynamically:

SELECT ID,FNAME,MNAME,LNAME,LOC,DEPT
FROM EMP
WHERE LOC

IN (WITH VALUE_LIST AS
(SELECT ? val FROM dual)
SELECT SUBSTR(val, (decode(LEVEL, 1, 0, instr(val, ':', 1, LEVEL -1)) + 1), (decode(instr(val, ':', 1, LEVEL) -1, -1, LENGTH(val), instr(val, ':', 1, LEVEL) -1)) -(decode(LEVEL, 1, 0, instr(val, ':', 1, LEVEL -1)) + 1) + 1) a
FROM VALUE_LIST CONNECT BY LEVEL <=
(SELECT(LENGTH(val) -LENGTH(REPLACE(val, ':', NULL)))
FROM VALUE_LIST) + 1)


NOTE1:
a) Here you need to change the portion showed in Bold as per your query requirement.
b) In this SQL, value list for IN clause should be delimited with a : symbol, If you want to use any other symbol as a delimiter you need to replace : with the symbol you want to use.


3) You need to create IN value list dynamically. Use XSL transformation to generate the dynamic value list and pass it to the DB adapter.

4) To query all the employees from US,INDIA,UK locations you need to create an IN clause value list as US:INDIA:UK

NOTE2:
While generating value list you don’t need to wrap character data with apostrophe.


Limitations:
1) If you create a very big value list for IN query (greater than 4000 characters) than you need to break value list and invoke this query multiple times, otherwise you will get ORA-01704: string literal too long error.

2) If you use SELECT * rather than giving the field list with SELECT, DB adapter won't be able to generate a correct XSD for request.