Some 'more, in-depth' information on Oracle BPEL PM, ESB and other SOA, day2day things

Thursday, March 09, 2006

Initiating a bpel process from a MDB within the same oc4j instance

A colleque of mine reported yesterday the following scenario ..

As per customer requirement, he needs to initiate a new process from an MDB ( a message driven bean, bound to jms queue or topic) .. So he created a standalone java client class and used the com.oracle.bpel.client.Locator class (as in tutorial 102.InvokingProcesses/rmi). As the application was running outside of the server he used the follwing API call


public Locator(java.lang.String domainId,
java.lang.String password,
Hashtable pInitialContextProperties)
throws ServerException


Then he implemented his MDB - with the onMessage() method and the former application code within it .. interestingly it failed, throwing a strange exception .. Not just a NameNotFound (if you encounter this one, here is a link with details) - but also another famous one, the INVALID_WSDL as shown below

<2006-03-07 12:01:27,003> Error while invoking bean "delivery": Failed to read wsdl. Failed to read wsdl at
"http://host:9700/orabpel/default/BPELProcessForRH/
1.0/_BPELProcessForRH.wsdl", because "WSDLException: faultCode=INVALID_WSDL:
The document: http://host:9700/orabpel/default/BPELProcessForRH/
1.0/_BPELProcessForRH.wsdl is not a wsdl file or does not have a root element of "definitions" in the "http://schemas.xmlsoap.org/wsdl/" namespace or the "http://www.w3.org/2004/08/wsdl" namespace.".

Make sure wsdl is valid. You may need to start the OraBPEL server, or make sure the related bpel process is deployed correctly.


Here is the solution ..
As you are already in a container transaction (remember your mdb is an ejb) & within a context, use the following constructor on the Locator class instead

public Locator(java.lang.String domainId,
java.lang.String password)
throws ServerException


and besides, ensure that the mdb application is a child application of orabpel.. (which can be configured in the server.xml with the parent attribute)

Having questions? send your feedback on Initiating a process from within a mdb here

4 Comments:

Anonymous Anonymous said...

this one's interesting...

3:54 AM

 
Anonymous Rajesh said...

Hi Clemens,

Can't we use BPEL JMS technology adapter to acheive the same result. The only draw back here is adapter continuously polls on the source queue for messages.

Regards,
Rajesh

12:30 AM

 
Anonymous Anonymous said...

Hi Clemens,

What is a underlying protocol used by Locator object to locate the BPEL process. If RMI communication is not allowed in organization, how will Locator object work to find the BPEL process ?

Regards,
Prasanna

6:39 PM

 
Blogger Clemens Utschig - Utschig said...

I started off with writing an intelligent proxy- that would fgure out the protocoll to use ..

for now you can also invoke the process over soap, rest, and so forth ..
doc'ed in samples/tutorials/102.InvokingProcesses.

hth

6:43 PM

 

Post a Comment

<< Home