You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Raidwan <Ra...@hotmail.com> on 2011/01/03 18:23:35 UTC

Servicemix 3.3.2 drools (2010.01) - Received exchange problem

I all,

I'm using servicemix 3.3.2 and drools 2010.01
Note that given sample on servicemix web site does not work with drools 4
(missing $)

I have a problem with some Done exchange that are sent to my drools endpoint
and when i try to get the exchange status to test i always get "Active" ...

my rule file il like that:

package org.apache.servicemix.drools

import org.apache.servicemix.drools.model.Exchange;
import com.itesoft.p2p.servicebus.beans.LoggerService;

global org.apache.servicemix.drools.model.JbiHelper jbi;

rule "ST_WORKITEM"
	when
		$me : Exchange( status == Exchange.ACTIVE, $in : in != null)
		eval($me.getStatus().equals(Exchange.ACTIVE) &&
$in.xpath("(count(//test)>0"))
	then
		jbi.answer( "<result>" + $me.getStatus() + "</result>" );
end

(also try with $me.getInternalExchange().getStatus()  and it's the same)

See my logs :

DEBUG | pool-flow.seda.servicemix-drools-thread-22 | DroolsComponent               
| che.servicemix.common.AsyncBaseLifeCycle  561 | Received exchange: status:
Done, role: provider
then
2011-01-03 17:39:58,641| ERROR | pool-flow.seda.servicemix-drools-thread-20
| DroolsComponent                | che.servicemix.common.AsyncBaseLifeCycle 
537 | Error processing exchange InOut[
id: ID:10.1.20.28-12d4c9ed013-6:15
  status: Done
  role: provider
  service: {http://www.test.com}Test
  endpoint: Test.EndPoint
  in: <?xml version="1.0" encoding="UTF-8"?><test>ok</test>
  out: <?xml version="1.0" encoding="UTF-8"?><result>Active</result>
]
org.drools.spi.ConsequenceException: java.lang.IllegalStateException:
component is not owner
...
Caused by: java.lang.IllegalStateException: component is not owner
	at
org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setMessage(MessageExchangeImpl.java:338)

...


Any idea ?

Thanks !

-- 
View this message in context: http://servicemix.396122.n5.nabble.com/Servicemix-3-3-2-drools-2010-01-Received-exchange-problem-tp3325976p3325976.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: Servicemix 3.3.2 drools (2010.01) - Received exchange problem

Posted by Erwan Guiochet <er...@free.fr>.
For information: issue closed :
https://issues.apache.org/jira/browse/SMXCOMP-973



--
View this message in context: http://servicemix.396122.n5.nabble.com/Servicemix-3-3-2-drools-2010-01-Received-exchange-problem-tp3325976p5717816.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: Servicemix 3.3.2 drools (2010.01) - Received exchange problem

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

Please fill a jira and append your patch.

Thanks
-------------
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: @Freeman小屋



On 2013-9-12, at 下午5:56, Erwan Guiochet wrote:

> Hi all,
> 
> I have found and fix an issue on servicemix-drools for this problem.
> 
> I don't know why but the exchange is submit two times to drools, that's why
> the first issue was fixed in the DroolsEndPoint in 
> private void handleProviderExchange(MessageExchange exchange) throws
> Exception {
>        if (exchange.getStatus() == ExchangeStatus.ACTIVE) {
> 
> In order to process Active exchange only.
> 
> In my case, the error appears in the jbiHelper.answer that was be processed
> two times, but the second time the exchange was not active but done, so i
> have add this in  jbiHelper.answer :
>    public void answer(Source content) throws Exception {        
>        MessageExchange me = this.exchange.getInternalExchange();               
>        if (me.getStatus() == ExchangeStatus.ACTIVE)
>        { 
>          ...
> 
> Then no more error :)
> 
> I don't know if this require a JIRA, i will build my own drools component
> for my project.
> 
> Regards,
> 
> Raid
> 
> 
> 
> --
> View this message in context: http://servicemix.396122.n5.nabble.com/Servicemix-3-3-2-drools-2010-01-Received-exchange-problem-tp3325976p5717795.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Servicemix 3.3.2 drools (2010.01) - Received exchange problem

Posted by Erwan Guiochet <er...@free.fr>.
Hi all,

I have found and fix an issue on servicemix-drools for this problem.

I don't know why but the exchange is submit two times to drools, that's why
the first issue was fixed in the DroolsEndPoint in 
private void handleProviderExchange(MessageExchange exchange) throws
Exception {
        if (exchange.getStatus() == ExchangeStatus.ACTIVE) {

In order to process Active exchange only.

In my case, the error appears in the jbiHelper.answer that was be processed
two times, but the second time the exchange was not active but done, so i
have add this in  jbiHelper.answer :
    public void answer(Source content) throws Exception {        
        MessageExchange me = this.exchange.getInternalExchange();               
        if (me.getStatus() == ExchangeStatus.ACTIVE)
        { 
          ...

Then no more error :)

I don't know if this require a JIRA, i will build my own drools component
for my project.

Regards,

Raid



--
View this message in context: http://servicemix.396122.n5.nabble.com/Servicemix-3-3-2-drools-2010-01-Received-exchange-problem-tp3325976p5717795.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: Servicemix 3.3.2 drools (2010.01) - Received exchange problem

Posted by Raidwan <Ra...@hotmail.com>.
Hi,

My test is composed of these services :
HTTP consumer
EIP : static-routing-slip named Test.drools.EIP that call
 - a Saxon service named xsltRemoveXmlns : a simple xsl transformation
 - a Drools service named Test.drools

my rule :
rule "TEST_RULE"
	when
		$me : Exchange( status == Exchange.ACTIVE, $in : in != null)
		eval($in.xpath("count(//test)>0"))
	then
		jbi.answer( "<result>" + $me.getStatus() + "</result>" );
end

Here is the complete log with sedaqueue in debug mode
http://servicemix.396122.n5.nabble.com/file/n3326715/Drools.log Drools.log 

Thanks
-- 
View this message in context: http://servicemix.396122.n5.nabble.com/Servicemix-3-3-2-drools-2010-01-Received-exchange-problem-tp3325976p3326715.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: Servicemix 3.3.2 drools (2010.01) - Received exchange problem

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

could you provide the complete stack trace ?

Regards
JB

On 01/03/2011 06:23 PM, Raidwan wrote:
>
> I all,
>
> I'm using servicemix 3.3.2 and drools 2010.01
> Note that given sample on servicemix web site does not work with drools 4
> (missing $)
>
> I have a problem with some Done exchange that are sent to my drools endpoint
> and when i try to get the exchange status to test i always get "Active" ...
>
> my rule file il like that:
>
> package org.apache.servicemix.drools
>
> import org.apache.servicemix.drools.model.Exchange;
> import com.itesoft.p2p.servicebus.beans.LoggerService;
>
> global org.apache.servicemix.drools.model.JbiHelper jbi;
>
> rule "ST_WORKITEM"
> 	when
> 		$me : Exchange( status == Exchange.ACTIVE, $in : in != null)
> 		eval($me.getStatus().equals(Exchange.ACTIVE)&&
> $in.xpath("(count(//test)>0"))
> 	then
> 		jbi.answer( "<result>" + $me.getStatus() +"</result>" );
> end
>
> (also try with $me.getInternalExchange().getStatus()  and it's the same)
>
> See my logs :
>
> DEBUG | pool-flow.seda.servicemix-drools-thread-22 | DroolsComponent
> | che.servicemix.common.AsyncBaseLifeCycle  561 | Received exchange: status:
> Done, role: provider
> then
> 2011-01-03 17:39:58,641| ERROR | pool-flow.seda.servicemix-drools-thread-20
> | DroolsComponent                | che.servicemix.common.AsyncBaseLifeCycle
> 537 | Error processing exchange InOut[
> id: ID:10.1.20.28-12d4c9ed013-6:15
>    status: Done
>    role: provider
>    service: {http://www.test.com}Test
>    endpoint: Test.EndPoint
>    in:<?xml version="1.0" encoding="UTF-8"?><test>ok</test>
>    out:<?xml version="1.0" encoding="UTF-8"?><result>Active</result>
> ]
> org.drools.spi.ConsequenceException: java.lang.IllegalStateException:
> component is not owner
> ...
> Caused by: java.lang.IllegalStateException: component is not owner
> 	at
> org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setMessage(MessageExchangeImpl.java:338)
>
> ...
>
>
> Any idea ?
>
> Thanks !
>