ode-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Logvinov <alogvi...@softech.ru>
Subject Faults
Date Fri, 22 Dec 2006 19:36:59 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#660000">
<font face="Courier New">Hi,<br>
I've got a problem with handling SOAP fault in my BPEL process.<br>
I run </font><font face="Courier New">ODE as a service engine in </font><font
 face="Courier New">Servicemix.<br>
My BPEL process calls the web service that runs in Tomcat. The service
is implemented using XFire.<br>
It has the following operation (this WSDL is generated by XFire):<br>
&nbsp;&nbsp;&nbsp; &lt;wsdl:portType name="WarehousePortType"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;wsdl:operation
name="OrderBook"&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &lt;wsdl:input name="OrderBookRequest"
message="tns:OrderBookRequest"/&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &lt;wsdl:output name="OrderBookResponse"
message="tns:OrderBookResponse"/&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &lt;wsdl:fault name="OrderException"
message="tns:OrderException"/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/wsdl:operation&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;/wsdl:portType&gt;<br>
<br>
that can throw the following fault:<br>
&nbsp;&nbsp;&nbsp; &lt;wsdl:message name="OrderException"&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;wsdl:part name="OrderException"
element="tns:OrderException"/&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;/wsdl:message&gt;<br>
<br>
... of the following type:<br>
&nbsp;&nbsp;&nbsp; &lt;xsd:complexType name="OrderException"&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;xsd:sequence&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&lt;xsd:element minOccurs="0" name="orderMessage"
nillable="true" type="xsd:string"/&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/xsd:sequence&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;/xsd:complexType&gt;<br>
<br>
&nbsp;&nbsp;&nbsp; &lt;xsd:element name="OrderException" type="tns:OrderException"/&gt;<br>
<br>
<br>
My BPEL invokes this operation with the following code:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;scope name="Scope1"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;faultHandlers&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;catchAll&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;empty/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/catchAll&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/faultHandlers&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&lt;invoke name="callWarehouse" <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; partnerLink="warehousePartnerLink"
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; operation="OrderBook" <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; portType="warehouse:WarehousePortType"
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; inputVariable="orderBookIn"
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; outputVariable="orderBookOut"/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/scope&gt;<br>
<br>
The service replies with the following fault:<br>
&lt;soap:Envelope <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xmlns:soap=<a class="moz-txt-link-rfc2396E"
href="http://schemas.xmlsoap.org/soap/envelope/">"http://schemas.xmlsoap.org/soap/envelope/"</a><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xmlns:xsd=<a class="moz-txt-link-rfc2396E"
href="http://www.w3.org/2001/XMLSchema">"http://www.w3.org/2001/XMLSchema"</a><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xmlns:xsi=<a class="moz-txt-link-rfc2396E"
href="http://www.w3.org/2001/XMLSchema-instance">"http://www.w3.org/2001/XMLSchema-instance"</a>&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;soap:Body&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;soap:Fault&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&lt;faultcode&gt;soap:Server&lt;/faultcode&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&lt;faultstring&gt;unknown book: Design
Patterns&lt;/faultstring&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&lt;detail&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &lt;OrderException
xmlns=<a class="moz-txt-link-rfc2396E" href="http://Warehouse.HelloBook.softech.com">"http://Warehouse.HelloBook.softech.com"</a>&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;orderMessage&gt;There
was an error processing
the order.&lt;/orderMessage&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &lt;/OrderException&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&lt;/detail&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/soap:Fault&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;/soap:Body&gt;<br>
&lt;/soap:Envelope&gt;<br>
<br>
<br>
The log contains the following:<br>
It receives the full SOAP message from the server:<br>
</font>
<pre><font face="Courier New">21:44:44,508 | DEBUG | Thread-13  | header     
             | apache.commons.httpclient.Wire   69 | &lt;&lt; "HTTP/1.1 500 Internal
Server Error[\r][\n]"
21:44:44,524 | DEBUG | Thread-13  | header                   | apache.commons.httpclient.Wire
  69 | &lt;&lt; "Content-Type: text/xml;charset=UTF-8[\r][\n]"
21:44:44,524 | DEBUG | Thread-13  | header                   | apache.commons.httpclient.Wire
  69 | &lt;&lt; "Transfer-Encoding: chunked[\r][\n]"
21:44:44,524 | DEBUG | Thread-13  | header                   | apache.commons.httpclient.Wire
  69 | &lt;&lt; "Date: Fri, 22 Dec 2006 18:44:44 GMT[\r][\n]"
21:44:44,524 | DEBUG | Thread-13  | header                   | apache.commons.httpclient.Wire
  69 | &lt;&lt; "Server: Apache-Coyote/1.1[\r][\n]"
21:44:44,524 | DEBUG | Thread-13  | header                   | apache.commons.httpclient.Wire
  69 | &lt;&lt; "Connection: close[\r][\n]"
21:44:44,524 | DEBUG | Thread-13  | content                  | apache.commons.httpclient.Wire
  83 | &lt;&lt; "1"
21:44:44,524 | DEBUG | Thread-13  | content                  | apache.commons.httpclient.Wire
  83 | &lt;&lt; "e"
21:44:44,524 | DEBUG | Thread-13  | content                  | apache.commons.httpclient.Wire
  83 | &lt;&lt; "9"
21:44:44,524 | DEBUG | Thread-13  | content                  | apache.commons.httpclient.Wire
  83 | &lt;&lt; "[\r]"
21:44:44,524 | DEBUG | Thread-13  | content                  | apache.commons.httpclient.Wire
  69 | &lt;&lt; "[\n]"
21:44:44,539 | DEBUG | Thread-13  | content                  | apache.commons.httpclient.Wire
  83 | &lt;&lt; "&lt;soap:Envelope xmlns:soap=<a class="moz-txt-link-rfc2396E"
href="http://schemas.xmlsoap.org/soap/envelope/">"http://schemas.xmlsoap.org/soap/envelope/"</a>
xmlns:xsd=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2001/XMLSchema">"http://www.w3.org/2001/XMLSchema"</a>
xmlns:xsi=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2001/XMLSchema-instance">"http://www.w3.org/2001/XMLSchema-instance"</a>&gt;&lt;soap:Body&gt;&lt;soap:Fault&gt;&lt;faultcode&gt;soap:Server&lt;/faultcode&gt;&lt;faultstring&gt;unknown
book: Design Patterns&lt;/faultstring&gt;&lt;detail&gt;&lt;OrderException
xmlns=<a class="moz-txt-link-rfc2396E" href="http://Warehouse.HelloBook.softech.com">"http://Warehouse.HelloBook.softech.com"</a>&gt;&lt;orderMessage&gt;There
was an error processing the order.&lt;/orderMessage&gt;&lt;/OrderException&gt;&lt;/detail&gt;&lt;/soap:Fault&gt;&
lt;/soap:Body&gt;&lt;/soap:Envelope&gt;"
</font></pre>
<font face="Courier New"><br>
Then the fault message is truncated and the JBI message will not
contain faultstring and faultcode:<br>
</font>
<pre><font face="Courier New">21:44:44,555 | DEBUG | Thread-12  | DeliveryChannelImpl
     | .messaging.DeliveryChannelImpl  300 | Accepted: InOut[
  id: ID:alogvinov-3320-1166813006883-6:0
  status: Active
  role: consumer
  service: {<a class="moz-txt-link-freetext" href="http://Warehouse.HelloBook.softech.com">http://Warehouse.HelloBook.softech.com</a>}Warehouse
  endpoint: WarehouseHttpPort
  operation: {<a class="moz-txt-link-freetext" href="http://Warehouse.HelloBook.softech.com">http://Warehouse.HelloBook.softech.com</a>}OrderBook
  in: &lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;OrderBook xmlns=<a class="moz-txt-link-rfc2396E"
href="http://Warehouse.HelloBook.softech.com">"http://Warehouse.HelloBook.softech.com"</a>
xmlns:warehouse=<a class="moz-txt-link-rfc2396E" href="http://Warehouse.HelloBook.softech.com">"http://Warehouse.HelloBook.softech.com"</a>&gt;
							&lt;customerID&gt;123&lt;/customerID&gt;
							&lt;bookName&gt;Design Patterns&lt;/bookName&gt;
						&lt;/OrderBook&gt;
  fault: &lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;OrderException xmlns=<a
class="moz-txt-link-rfc2396E" href="http://Warehouse.HelloBook.softech.com">"http://Warehouse.HelloBook.softech.com"</a>&gt;&lt;orderMessage&gt;There
was an error processing the order.&lt;/orderMessage&gt;&lt;/OrderException&gt;
]
</font></pre>
<font face="Courier New"><br>
After a while I've got an error:<br>
</font>
<pre>21:44:44,899 | ERROR | pool-3-thread-2 | Receiver                 | org.apache.ode.jbi.Receiver$1
  192 | Error processing JBI message.
java.lang.AssertionError: todo
	at org.apache.ode.jbi.OdeConsumer$2.call(OdeConsumer.java:199)
	at org.apache.ode.jbi.OdeConsumer$2.call(OdeConsumer.java:183)
	at org.apache.ode.bpel.scheduler.quartz.QuartzSchedulerImpl.execTransaction(QuartzSchedulerImpl.java:212)
	at org.apache.ode.jbi.OdeConsumer.outResponse(OdeConsumer.java:182)
	at org.apache.ode.jbi.OdeConsumer.onJbiMessageExchange(OdeConsumer.java:134)
	at org.apache.ode.jbi.JbiMessageExchangeEventRouter.onJbiMessageExchange(JbiMessageExchangeEventRouter.java:40)
	at org.apache.ode.jbi.Receiver$1.run(Receiver.java:190)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
	at java.util.concurrent.FutureTask.run(FutureTask.java:123)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
	at java.lang.Thread.run(Thread.java:595)
</pre>
<font face="Courier New"><br>
It seems that it is raised by the following code in OdeConsumer.java<br>
<br>
&nbsp;&nbsp;&nbsp; Fault jbiFlt = jbiMex.getFault();<br>
&nbsp;&nbsp;&nbsp; if (jbiFlt != null) {<br>
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // TODO: How are we supposed
to figure out the fault type
exactly?<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; throw new AssertionError("todo");<br>
&nbsp;&nbsp;&nbsp; }<br>
</font><font face="Courier New"><br>
<br>
Here are my questions:<br>
- Is there a proper way of </font><font face="Courier New">handling a
fault in a BPEL process in the current version of ODE?<br>
- Can the BPEL process receive the data from </font><font
 face="Courier New">faultstring and faultcode fields?<br>
<br>
Thanks!<br>
<br>
</font>
</body>
</html>

Mime
View raw message