| View previous topic :: View next topic |
| Author |
Message |
hksduhksdu
Joined: 23 Sep 2008 Posts: 5
|
Posted: Fri Oct 23, 2009 3:54 pm Post subject: How To Handle SQL Select Return 0? |
|
|
Hi all,
I created a simple Database binding attached to BPEL. The public WSDL is to get all records from this database through Database binding module. The select statement is default.
It works when there are records but when there are no records, it shows exception as follow:
| Code: |
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.xmlsoap.org/soap/envelope/ http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode xmlns="">SOAP-ENV:Server</faultcode>
<faultstring xmlns="">BPCOR-6135: A fault was not handled in the process scope; Fault Name is {http://docs.oasis-open.org/wsbpel/2.0/process/executable}selectionFailure; Fault Data is &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;jbi:message xmlns:sxeh=&quot;http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/ErrorHandling&quot; type=&quot;sxeh:faultMessage&quot; version=&quot;1.0&quot; xmlns:jbi=&quot;http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper&quot;&gt;&lt;jbi:part&gt;BPCOR-6174: Selection Failure occurred in BPEL({http://enterprise.netbeans.org/bpel/CareerManagement/AccountService}FindAccountById) at line 44&lt;/jbi:part&gt;&lt;/jbi:message&gt;. Sending errors for the pending requests in the process scope before terminating the process instance</faultstring>
<faultactor xmlns="">sun-bpel-engine</faultactor>
<detail xmlns="">
<detailText>BPCOR-6135: A fault was not handled in the process scope; Fault Name is {http://docs.oasis-open.org/wsbpel/2.0/process/executable}selectionFailure; Fault Data is &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;jbi:message xmlns:sxeh=&quot;http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/ErrorHandling&quot; type=&quot;sxeh:faultMessage&quot; version=&quot;1.0&quot; xmlns:jbi=&quot;http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper&quot;&gt;&lt;jbi:part&gt;BPCOR-6174: Selection Failure occurred in BPEL({http://enterprise.netbeans.org/bpel/CareerManagement/AccountService}FindAccountById) at line 44&lt;/jbi:part&gt;&lt;/jbi:message&gt;. Sending errors for the pending requests in the process scope before terminating the process instance
Caused by: BPCOR-6174: Selection Failure occurred in BPEL({http://enterprise.netbeans.org/bpel/CareerManagement/AccountService}FindAccountById) at line 44
BPCOR-6129: Line Number is 38
BPCOR-6130: Activity Name is Assign2</detailText>
</detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
|
Any clue?
Thanks in advance,
Andy |
|
| Back to top |
|
 |
bako
Joined: 11 Sep 2009 Posts: 10 Location: Italy
|
Posted: Sat Oct 24, 2009 1:00 pm Post subject: |
|
|
how is your code that extracts the record?
is a method that throws exception or u put a try catch statement.
the fault looks like a throws without a fault in the wsdl
so u can simply use the try catch in the code, when there's an exception u can return what u want in ur method. |
|
| Back to top |
|
 |
hksduhksdu
Joined: 23 Sep 2008 Posts: 5
|
Posted: Thu Oct 29, 2009 4:46 am Post subject: |
|
|
| bako wrote: | how is your code that extracts the record?
is a method that throws exception or u put a try catch statement.
the fault looks like a throws without a fault in the wsdl
so u can simply use the try catch in the code, when there's an exception u can return what u want in ur method. |
Thanks for your reply.
I wonder why it is a fault though. Isn't SQL select statement returning 0 query is a normal return? |
|
| Back to top |
|
 |
bako
Joined: 11 Sep 2009 Posts: 10 Location: Italy
|
Posted: Thu Oct 29, 2009 9:02 am Post subject: |
|
|
| hksduhksdu wrote: | | bako wrote: | how is your code that extracts the record?
is a method that throws exception or u put a try catch statement.
the fault looks like a throws without a fault in the wsdl
so u can simply use the try catch in the code, when there's an exception u can return what u want in ur method. |
Thanks for your reply.
I wonder why it is a fault though. Isn't SQL select statement returning 0 query is a normal return? |
maybe the sql returns 0 rows, and the bpel tries to extract data, but the dataset is empty.
i'm not sure about that, look at the row 44 or 38 of the bpel what is it. |
|
| Back to top |
|
 |
hksduhksdu
Joined: 23 Sep 2008 Posts: 5
|
Posted: Thu Nov 05, 2009 5:46 am Post subject: How to handle fault? |
|
|
Thanks for your reply.
I find that it's okay to have fault there since it's coming from assigning uninitialized values to the reply.
But I can't find any good tutorial that shows me how to use fault properly. I find that the GlassfishESB documentation is not very informative. I have no idea how to properly handle fault.
Also normally when you retrieve information from DB, it may return 0 result. In many web services, it will return an empty Set/Collection, how do you do that in NetBeans' SOA?
Thanks in advance.
Andy |
|
| Back to top |
|
 |
bako
Joined: 11 Sep 2009 Posts: 10 Location: Italy
|
Posted: Thu Nov 05, 2009 7:55 am Post subject: Re: How to handle fault? |
|
|
| hksduhksdu wrote: |
Also normally when you retrieve information from DB, it may return 0 result. In many web services, it will return an empty Set/Collection, how do you do that in NetBeans' SOA?
|
i don't really know, i'm not so expert, you might try using an if or using the trhow excpetion.
http://www.netbeans.org/kb/61/soa/bpel-guide-elements.html#ggbyc |
|
| Back to top |
|
 |
hksduhksdu
Joined: 23 Sep 2008 Posts: 5
|
Posted: Fri Nov 13, 2009 4:52 pm Post subject: Re: How to handle fault? |
|
|
| bako wrote: | | hksduhksdu wrote: |
Also normally when you retrieve information from DB, it may return 0 result. In many web services, it will return an empty Set/Collection, how do you do that in NetBeans' SOA?
|
i don't really know, i'm not so expert, you might try using an if or using the trhow excpetion.
http://www.netbeans.org/kb/61/soa/bpel-guide-elements.html#ggbyc |
Thank you.
I think I got the answer now. It's from the NetBeans SOA book. The example shows it but then I haven't got it working, once I have any update, I will post back.
Thanks again.  |
|
| Back to top |
|
 |
|