You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by youhaodeyi <yo...@gmail.com> on 2009/09/24 11:19:04 UTC

Does anyone know this error "Error processing exchange"

I made one SA including two SU. The BC is http su and the SE is bean su. 
The http xbean.xml file is shown as below:

<beans xmlns:http="http://servicemix.apache.org/http/1.0"
       xmlns:replaceMe="http://servicemix.apache.org/replaceMe">

  <http:endpoint service="replaceMe:http"
                 endpoint="endpoint"
                 role="consumer" 
		 targetService="replaceMe:service"
		 locationURI="http://localhost:8000/example/"
                 defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
                 soap="true" />             

</beans>

The bean SE is shown as below:
<beans xmlns:bean="http://servicemix.apache.org/bean/1.0"
       xmlns:replaceMe="http://servicemix.apache.org/replaceMe">

  <bean:endpoint service="replaceMe:service" endpoint="endpoint"
bean="#myBean"/>

  <bean id="myBean" class="org.servicemix.samples.hello_world.su1.MyBean"/>

</beans>

When I send soap message to the http su, I will get this error:

Received exchange: InOut
ERROR - BeanComponent                  - Error processing exchange 
javax.jbi.messaging.MessagingException: illegal exchange status: done
        at
org.apache.servicemix.jbi.messaging.MessageExchangeImpl.handleSend(Me
ssageExchangeImpl.java:626)

Does anyone know what the problem is?

thanks

-- 
View this message in context: http://www.nabble.com/Does-anyone-know-this-error-%22Error-processing-exchange%22-tp25547115p25547115.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Does anyone know this error "Error processing exchange"

Posted by Gert Vanthienen <ge...@gmail.com>.
L.S.,

There's probably a problem with the way your bean handles the InOut
MEP.  If you look at the diagram at
http://servicemix.apache.org/5-jbi.html#5.JBI-Invocationexample, your
bean is at the provider end of the diagram.  This means every exchange
will be delivered to your bean twice: once in an ACTIVE state, where
you can fill the out message and send the Exchange back.  The second
time around is when the DONE exchange is being delivered to your bean
to confirm completion of the exchange.

Your bean is either responding with a DONE exchange at step 3 in the
diagram or (more likely) responding with a DONE exchange after
receiving the DONE exchange in step 6 of the diagram.  Usually, for
handling an InOut exchange, your code will have to look something like
public void onMessageExchange(MessageExchange exchange) {
  if (exchange.getStatus() == ExchangeStatus.ACTIVE) {
     // set the out message, but don't change the status
     // send() the exchange
  } else {
     // just ignore DONE/ERROR exchanges
  }
}

If you need more help figuring out the exact cause of the problem,
could you please post your bean's java code?

Regards,

Gert Vanthienen
------------------------
Open Source SOA: http://fusesource.com
Blog: http://gertvanthienen.blogspot.com/



2009/9/24 youhaodeyi <yo...@gmail.com>:
>
> I made one SA including two SU. The BC is http su and the SE is bean su.
> The http xbean.xml file is shown as below:
>
> <beans xmlns:http="http://servicemix.apache.org/http/1.0"
>       xmlns:replaceMe="http://servicemix.apache.org/replaceMe">
>
>  <http:endpoint service="replaceMe:http"
>                 endpoint="endpoint"
>                 role="consumer"
>                 targetService="replaceMe:service"
>                 locationURI="http://localhost:8000/example/"
>                 defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
>                 soap="true" />
>
> </beans>
>
> The bean SE is shown as below:
> <beans xmlns:bean="http://servicemix.apache.org/bean/1.0"
>       xmlns:replaceMe="http://servicemix.apache.org/replaceMe">
>
>  <bean:endpoint service="replaceMe:service" endpoint="endpoint"
> bean="#myBean"/>
>
>  <bean id="myBean" class="org.servicemix.samples.hello_world.su1.MyBean"/>
>
> </beans>
>
> When I send soap message to the http su, I will get this error:
>
> Received exchange: InOut
> ERROR - BeanComponent                  - Error processing exchange
> javax.jbi.messaging.MessagingException: illegal exchange status: done
>        at
> org.apache.servicemix.jbi.messaging.MessageExchangeImpl.handleSend(Me
> ssageExchangeImpl.java:626)
>
> Does anyone know what the problem is?
>
> thanks
>
> --
> View this message in context: http://www.nabble.com/Does-anyone-know-this-error-%22Error-processing-exchange%22-tp25547115p25547115.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>