You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Ovini Udugala <ov...@gmail.com> on 2011/07/27 14:00:50 UTC

problem in content based routing and xpath evaluation SMX4.3

Hi all,

I'm try to write a content based router with xpath predicates withh camel.
But it seems that the destination service is not receiving the request after
evaluation.  Following is the  xml message I'm sending

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header><routing xmlns="http://someuri
">xadmin;community</routing></soapenv:Header>
<soapenv:Body>
<m:department xmlns:m="http://services.samples.dep/xsd">
<emp><name>TOM</name><dur>4</dur></emp>
<emp><name>JANE</name><dur>3</dur></emp>
</m:department>
</soapenv:Body>
</soapenv:Envelope>

*
http consumer xbean*

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:http="http://servicemix.apache.org/http/1.0"
       xmlns:cbr="http://servicemix.apache.org/cbr"
       xmlns="http://www.springframework.org/schema/beans"
       >

  <http:endpoint service="cbr:routerConsumer"
                 endpoint="consumerEndpoint"
                 role="consumer"
                 locationURI="http://localhost:8192/ContentBasedRouting/"
                 defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
                 targetService="cbr:camelRouter"
                 soap="true" />

</beans>

*
http provider xbean

*<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:http="http://servicemix.apache.org/http/1.0"
       xmlns:cbr="http://servicemix.apache.org/cbr"
       xmlns="http://www.springframework.org/schema/beans"
       >

  <http:endpoint service="cbr:routerProvider"
                 endpoint="providerEndpoint"
                 role="provider"
                 locationURI="http://localhost:1222/EchoService"
                 defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
                 soap="true"
               />

</beans>
*
camel java class*
package org.apache.servicemix.cbr.camel;

import org.apache.camel.builder.RouteBuilder;

/**
 * A Camel Router
 */
public class MyRouteBuilder extends RouteBuilder {

    public void configure() {

        from("jbi:endpoint:
http://servicemix.apache.org/cbr/camelRouter/consumerEndpoint").
            filter().
            xpath("//emp[1]/name/text() = 'TOM' ").
            to("jbi:endpoint:
http://servicemix.apache.org/cbr/routerProvider/providerEndpoint");
    }
}

I tried the above configuration with
  from("jbi:endpoint:
http://servicemix.apache.org/cbr/camelRouter/consumerEndpoint").streamCaching().
to("jbi:endpoint:
http://servicemix.apache.org/cbr/routerProvider/providerEndpoint");

then the echo service echo backs the same xml message.
However I  intercepted the conversation and listened on poert 1222. It seems
that the servicemix  only send
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body/></soapenv:Envelope>
to the Echoservice. What I want to be done is that is the predicate is
evaluated successfully  the EchoService should receive the same xml message
I'm sending.

How to achieve this? Have I done anything wrong in the configuration?

Re: problem in content based routing and xpath evaluation SMX4.3

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

Did you already add dependency which have org/apache/commons/mail/EmailException class in your su pom.xml?

Or if the bundle which have org/apache/commons/mail/EmailException already get installed in your OSGi container, you can use the way I mentioned before, like
<classpath> 
  <library>osgi:<bundle symbolic name></library> 
</classpath> 
into your SU beans.xml, take a look at [1] to get more details, the "New in ServiceMix 4.2.0" chapter. 

Btw, SMX 4.3 is quite old, why not use more recent version?

[1]http://servicemix.apache.org/classloaders.html

Freeman
-------------
Freeman Fang

FuseSource
Email:ffang@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: http://weibo.com/u/1473905042

On 2012-8-20, at 上午11:45, gumba wrote:

> I already have the activiti-engine 5.9 jar in my POM declaration, and it
> pulls the jar, but still not accepting the mail task, I understand that this
> is the way it should work I cannot understand why it does not, there is any
> other way to instruct Servicemix to pull jars?
> 
> 
> 
> -----
> Gumba
> --
> View this message in context: http://servicemix.396122.n5.nabble.com/problem-in-content-based-routing-and-xpath-evaluation-SMX4-3-tp4638543p5714176.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: problem in content based routing and xpath evaluation SMX4.3

Posted by gumba <an...@gmail.com>.
I am using the bridge-camel example from Servicemix 4.3.0 and activiti 5.9

This the error:
java.lang.NoClassDefFoundError: org/apache/commons/mail/EmailException

the trace:

18:30:10,018 | ERROR | rovider-thread-1 | BpmnParse                        | 
-  -  | Uknown exception
org.activiti.engine.ActivitiException: couldn't instantiate class
org.activiti.engine.impl.bpmn.behavior.MailActivityBehavior
	at
org.activiti.engine.impl.util.ReflectUtil.instantiate(ReflectUtil.java:131)[activiti-engine-5.9.jar:5.9]
	at
org.activiti.engine.impl.bpmn.helper.ClassDelegate.instantiateDelegate(ClassDelegate.java:162)[activiti-engine-5.9.jar:5.9]
	at
org.activiti.engine.impl.bpmn.helper.ClassDelegate.instantiateDelegate(ClassDelegate.java:158)[activiti-engine-5.9.jar:5.9]
	at
org.activiti.engine.impl.bpmn.parser.BpmnParse.parseEmailServiceTask(BpmnParse.java:1547)[activiti-engine-5.9.jar:5.9]
	at
org.activiti.engine.impl.bpmn.parser.BpmnParse.parseServiceTask(BpmnParse.java:1329)[activiti-engine-5.9.jar:5.9]
	at
org.activiti.engine.impl.bpmn.parser.BpmnParse.parseActivity(BpmnParse.java:901)[activiti-engine-5.9.jar:5.9]
	at
org.activiti.engine.impl.bpmn.parser.BpmnParse.parseActivities(BpmnParse.java:886)[activiti-engine-5.9.jar:5.9]
	at
org.activiti.engine.impl.bpmn.parser.BpmnParse.parseScope(BpmnParse.java:585)[activiti-engine-5.9.jar:5.9]
	at
org.activiti.engine.impl.bpmn.parser.BpmnParse.parseProcess(BpmnParse.java:558)[activiti-engine-5.9.jar:5.9]
	at
org.activiti.engine.impl.bpmn.parser.BpmnParse.parseProcessDefinitions(BpmnParse.java:524)[activiti-engine-5.9.jar:5.9]
	at
org.activiti.engine.impl.bpmn.parser.BpmnParse.parseRootElement(BpmnParse.java:241)[activiti-engine-5.9.jar:5.9]
	at
org.activiti.engine.impl.bpmn.parser.BpmnParse.execute(BpmnParse.java:213)[activiti-engine-5.9.jar:5.9]
	at
org.activiti.engine.impl.bpmn.deployer.BpmnDeployer.deploy(BpmnDeployer.java:86)[activiti-engine-5.9.jar:5.9]
	at
org.activiti.engine.impl.persistence.deploy.DeploymentCache.deploy(DeploymentCache.java:38)[activiti-engine-5.9.jar:5.9]
	at
org.activiti.engine.impl.persistence.deploy.DeploymentCache.resolveProcessDefinition(DeploymentCache.java:91)[activiti-engine-5.9.jar:5.9]
	at
org.activiti.engine.impl.persistence.deploy.DeploymentCache.findDeployedLatestProcessDefinitionByKey(DeploymentCache.java:65)[activiti-engine-5.9.jar:5.9]
	at
org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:58)[activiti-engine-5.9.jar:5.9]
	at
org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:31)[activiti-engine-5.9.jar:5.9]
	at
org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)[activiti-engine-5.9.jar:5.9]
	at
org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:42)[activiti-engine-5.9.jar:5.9]
	at
org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)[activiti-engine-5.9.jar:5.9]
	at
org.activiti.engine.impl.RuntimeServiceImpl.startProcessInstanceByKey(RuntimeServiceImpl.java:46)[activiti-engine-5.9.jar:5.9]
	at
org.activiti.camel.ActivitiMainComponent.startProcess(ActivitiMainComponent.java:37)[file:/Users/paundejr/apache-servicemix-4.3.0/data/jbi/bridge-camel-sa/sus/bridge-camel-su/:]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.6.0_33]
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[:1.6.0_33]
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_33]
	at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_33]
	at
org.apache.camel.component.bean.MethodInfo.invoke(MethodInfo.java:322)[68:org.apache.camel.camel-core:2.6.0]
	at
org.apache.camel.component.bean.MethodInfo$1.proceed(MethodInfo.java:224)[68:org.apache.camel.camel-core:2.6.0]
	at
org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:167)[68:org.apache.camel.camel-core:2.6.0]
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:91)[68:org.apache.camel.camel-core:2.6.0]
	at
org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:74)[68:org.apache.camel.camel-core:2.6.0]
	at
org.apache.camel.impl.ProcessorEndpoint.onExchange(ProcessorEndpoint.java:102)[68:org.apache.camel.camel-core:2.6.0]
	at
org.apache.camel.impl.ProcessorEndpoint$1.process(ProcessorEndpoint.java:72)[68:org.apache.camel.camel-core:2.6.0]
	at
org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)[68:org.apache.camel.camel-core:2.6.0]
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)[68:org.apache.camel.camel-core:2.6.0]
	at
org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:104)[68:org.apache.camel.camel-core:2.6.0]
	at
org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:272)[68:org.apache.camel.camel-core:2.6.0]
	at
org.apache.camel.processor.SendProcessor.process(SendProcessor.java:98)[68:org.apache.camel.camel-core:2.6.0]
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)[68:org.apache.camel.camel-core:2.6.0]
	at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[68:org.apache.camel.camel-core:2.6.0]
	at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[68:org.apache.camel.camel-core:2.6.0]
	at
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99)[68:org.apache.camel.camel-core:2.6.0]
	at
org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:53)[68:org.apache.camel.camel-core:2.6.0]
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)[68:org.apache.camel.camel-core:2.6.0]
	at
org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:299)[68:org.apache.camel.camel-core:2.6.0]
	at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:208)[68:org.apache.camel.camel-core:2.6.0]
	at
org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:269)[68:org.apache.camel.camel-core:2.6.0]
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)[68:org.apache.camel.camel-core:2.6.0]
	at
org.apache.camel.processor.Pipeline.process(Pipeline.java:125)[68:org.apache.camel.camel-core:2.6.0]
	at
org.apache.camel.processor.Pipeline.process(Pipeline.java:80)[68:org.apache.camel.camel-core:2.6.0]
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)[68:org.apache.camel.camel-core:2.6.0]
	at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[68:org.apache.camel.camel-core:2.6.0]
	at
org.apache.camel.processor.ChoiceProcessor.process(ChoiceProcessor.java:80)[68:org.apache.camel.camel-core:2.6.0]
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)[68:org.apache.camel.camel-core:2.6.0]
	at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[68:org.apache.camel.camel-core:2.6.0]
	at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[68:org.apache.camel.camel-core:2.6.0]
	at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)[68:org.apache.camel.camel-core:2.6.0]
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)[68:org.apache.camel.camel-core:2.6.0]
	at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[68:org.apache.camel.camel-core:2.6.0]
	at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[68:org.apache.camel.camel-core:2.6.0]
	at
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99)[68:org.apache.camel.camel-core:2.6.0]
	at
org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:53)[68:org.apache.camel.camel-core:2.6.0]
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)[68:org.apache.camel.camel-core:2.6.0]
	at
org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:299)[68:org.apache.camel.camel-core:2.6.0]
	at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:208)[68:org.apache.camel.camel-core:2.6.0]
	at
org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:269)[68:org.apache.camel.camel-core:2.6.0]
	at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:102)[68:org.apache.camel.camel-core:2.6.0]
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)[68:org.apache.camel.camel-core:2.6.0]
	at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[68:org.apache.camel.camel-core:2.6.0]
	at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[68:org.apache.camel.camel-core:2.6.0]
	at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)[68:org.apache.camel.camel-core:2.6.0]
	at
org.apache.servicemix.camel.CamelProviderEndpoint$1.call(CamelProviderEndpoint.java:109)[172:servicemix-camel:2011.01.0]
	at
org.apache.servicemix.camel.JbiBinding.runWithCamelContextClassLoader(JbiBinding.java:116)[172:servicemix-camel:2011.01.0]
	at
org.apache.servicemix.camel.CamelProviderEndpoint.handleActiveProviderExchange(CamelProviderEndpoint.java:107)[172:servicemix-camel:2011.01.0]
	at
org.apache.servicemix.camel.CamelProviderEndpoint.process(CamelProviderEndpoint.java:85)[172:servicemix-camel:2011.01.0]
	at
org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:651)[120:servicemix-common:2011.01.0]
	at
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:606)[120:servicemix-common:2011.01.0]
	at
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchangeInTx(AsyncBaseLifeCycle.java:501)[120:servicemix-common:2011.01.0]
	at
org.apache.servicemix.common.AsyncBaseLifeCycle$2.run(AsyncBaseLifeCycle.java:370)[120:servicemix-common:2011.01.0]
	at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)[:1.6.0_33]
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)[:1.6.0_33]
	at java.lang.Thread.run(Thread.java:680)[:1.6.0_33]
Caused by: org.activiti.engine.ActivitiClassLoadingException: Could not load
class: org.activiti.engine.impl.bpmn.behavior.MailActivityBehavior
	at
org.activiti.engine.impl.util.ReflectUtil.loadClass(ReflectUtil.java:81)[activiti-engine-5.9.jar:5.9]
	at
org.activiti.engine.impl.util.ReflectUtil.instantiate(ReflectUtil.java:128)[activiti-engine-5.9.jar:5.9]
	... 82 more
Caused by: java.lang.NoClassDefFoundError:
org/apache/commons/mail/EmailException
	at java.lang.Class.forName0(Native Method)[:1.6.0_33]
	at java.lang.Class.forName(Class.java:247)[:1.6.0_33]
	at
org.activiti.engine.impl.util.ReflectUtil.loadClass(ReflectUtil.java:62)[activiti-engine-5.9.jar:5.9]
	... 83 more
Caused by: java.lang.ClassNotFoundException:
org.apache.commons.mail.EmailException in classloader
org.apache.xbean.spring.context.FileSystemXmlApplicationContext@29abbe6c
	at
org.apache.xbean.classloader.MultiParentClassLoader.loadClass(MultiParentClassLoader.java:206)[139:org.apache.xbean.classloader:3.7]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)[:1.6.0_33]



-----
Gumba
--
View this message in context: http://servicemix.396122.n5.nabble.com/problem-in-content-based-routing-and-xpath-evaluation-SMX4-3-tp4638543p5714185.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: problem in content based routing and xpath evaluation SMX4.3

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

Which exact class not be found?

If the class not be found from your SU already in some bundle installed in OSGi container, you can add something like
<classpath>
  <library>osgi:<bundle symbolic name></library>
</classpath>
into your SU beans.xml, take a look at [1] to get more details, the "New in ServiceMix 4.2.0" chapter.

[1]http://servicemix.apache.org/classloaders.html

Freeman

-------------
Freeman Fang

FuseSource
Email:ffang@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: http://weibo.com/u/1473905042

On 2012-8-20, at 上午11:45, gumba wrote:

> I already have the activiti-engine 5.9 jar in my POM declaration, and it
> pulls the jar, but still not accepting the mail task, I understand that this
> is the way it should work I cannot understand why it does not, there is any
> other way to instruct Servicemix to pull jars?
> 
> 
> 
> -----
> Gumba
> --
> View this message in context: http://servicemix.396122.n5.nabble.com/problem-in-content-based-routing-and-xpath-evaluation-SMX4-3-tp4638543p5714176.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: problem in content based routing and xpath evaluation SMX4.3

Posted by gumba <an...@gmail.com>.
I already have the activiti-engine 5.9 jar in my POM declaration, and it
pulls the jar, but still not accepting the mail task, I understand that this
is the way it should work I cannot understand why it does not, there is any
other way to instruct Servicemix to pull jars?



-----
Gumba
--
View this message in context: http://servicemix.396122.n5.nabble.com/problem-in-content-based-routing-and-xpath-evaluation-SMX4-3-tp4638543p5714176.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: problem in content based routing and xpath evaluation SMX4.3

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

Add activiti 5.9 dependency into your camel su pom.xml should be able to pull in that jar to your SU.

Freeman
-------------
Freeman Fang

FuseSource
Email:ffang@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: http://weibo.com/u/1473905042

On 2012-8-16, at 上午5:49, gumba wrote:

> I found de cause of the error, because I want to use Service Task and Mail
> task on activiti integrated with Servicemix, it gives classNotFound for the
> Java class supporting the service task and for the class supporting the mail
> task.
> Now I guess I have too import the jar of activiti 5.9 and jar created on my
> project to servicemix Camel  SU, any tip on how to do it? or if this is the
> correct approach?
> 
> 
> 
> -----
> Gumba
> --
> View this message in context: http://servicemix.396122.n5.nabble.com/problem-in-content-based-routing-and-xpath-evaluation-SMX4-3-tp4638543p5714156.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: problem in content based routing and xpath evaluation SMX4.3

Posted by gumba <an...@gmail.com>.
I found de cause of the error, because I want to use Service Task and Mail
task on activiti integrated with Servicemix, it gives classNotFound for the
Java class supporting the service task and for the class supporting the mail
task.
Now I guess I have too import the jar of activiti 5.9 and jar created on my
project to servicemix Camel  SU, any tip on how to do it? or if this is the
correct approach?



-----
Gumba
--
View this message in context: http://servicemix.396122.n5.nabble.com/problem-in-content-based-routing-and-xpath-evaluation-SMX4-3-tp4638543p5714156.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: problem in content based routing and xpath evaluation SMX4.3

Posted by gumba <an...@gmail.com>.
I post here because maybe have to do with the Cache instruction



-----
Gumba
--
View this message in context: http://servicemix.396122.n5.nabble.com/problem-in-content-based-routing-and-xpath-evaluation-SMX4-3-tp4638543p5714155.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: problem in content based routing and xpath evaluation SMX4.3

Posted by gumba <an...@gmail.com>.
I am running the Servicemix 4.3.0 Bridge example with java version 1.6.0_33
when I send the envelop to the Activiti 5.9, via a BEAN I access the API,
instance running I got the following error. 
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>Error 500 deployment '613' didn't put process definition 'gpi:1:616'
in the cache</title>
</head>
<body>
HTTP ERROR 500

<p>Problem accessing /bridge/. Reason:
<pre>    deployment '613' didn't put process definition 'gpi:1:616' in the
cache</pre></p>
Caused by:
<pre>org.activiti.engine.ActivitiException: deployment '613' didn't put
process definition 'gpi:1:616' in the cache
	at
org.activiti.engine.impl.persistence.deploy.DeploymentCache.resolveProcessDefinition(DeploymentCache.java:95)
	at
org.activiti.engine.impl.persistence.deploy.DeploymentCache.findDeployedLatestProcessDefinitionByKey(DeploymentCache.java:65)
	at
org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:58)
	at
org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:31)
	at
org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
	at
org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:42)
	at
org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
	at
org.activiti.engine.impl.RuntimeServiceImpl.startProcessInstanceByKey(RuntimeServiceImpl.java:46)
	at
org.activiti.camel.ActivitiMainComponent.startProcess(ActivitiMainComponent.java:37)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.camel.component.bean.MethodInfo.invoke(MethodInfo.java:322)
	at
org.apache.camel.component.bean.MethodInfo$1.proceed(MethodInfo.java:224)
	at
org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:167)
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:91)
	at
org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:74)
	at
org.apache.camel.impl.ProcessorEndpoint.onExchange(ProcessorEndpoint.java:102)
	at
org.apache.camel.impl.ProcessorEndpoint$1.process(ProcessorEndpoint.java:72)
	at
org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
	at
org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:104)
	at
org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:272)
	at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:98)
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
	at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
	at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
	at
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99)
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
	at
org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:299)
	at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:208)
	at
org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:269)
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:125)
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
	at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
	at
org.apache.camel.processor.ChoiceProcessor.process(ChoiceProcessor.java:80)
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
	at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
	at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
	at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
	at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
	at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
	at
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99)
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
	at
org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:299)
	at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:208)
	at
org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:269)
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:125)
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
	at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:102)
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
	at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
	at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
	at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
	at
org.apache.servicemix.camel.CamelProviderEndpoint$1.call(CamelProviderEndpoint.java:109)
	at
org.apache.servicemix.camel.JbiBinding.runWithCamelContextClassLoader(JbiBinding.java:116)
	at
org.apache.servicemix.camel.CamelProviderEndpoint.handleActiveProviderExchange(CamelProviderEndpoint.java:107)
	at
org.apache.servicemix.camel.CamelProviderEndpoint.process(CamelProviderEndpoint.java:85)
	at
org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:651)
	at
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:606)
	at
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchangeInTx(AsyncBaseLifeCycle.java:501)
	at
org.apache.servicemix.common.AsyncBaseLifeCycle$2.run(AsyncBaseLifeCycle.java:370)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:680)
</pre>
<hr />/<small>Powered by Jetty://</small>/<br/>


What am I doing wrong?



-----
Gumba
--
View this message in context: http://servicemix.396122.n5.nabble.com/problem-in-content-based-routing-and-xpath-evaluation-SMX4-3-tp4638543p5714154.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: problem in content based routing and xpath evaluation SMX4.3

Posted by gumba <an...@gmail.com>.
Thank you for your reply it worked fine...

-----
Gumba
--
View this message in context: http://servicemix.396122.n5.nabble.com/problem-in-content-based-routing-and-xpath-evaluation-SMX4-3-tp4638543p5713907.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: problem in content based routing and xpath evaluation SMX4.3

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

Yeah, logging the message also means change the underlying stream message to re-readable, same effect as add streamCache="true" to the camelContext
-------------
Freeman Fang

FuseSource
Email:ffang@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: http://weibo.com/u/1473905042

On 2012-7-16, at 下午11:20, gumba wrote:

> I solved the problem with this code, I logged the message before use path on
> it.
> 
> <camelContext id="camelProcess"
> xmlns="http://camel.apache.org/schema/spring">
>            <route>
>          		<from
> uri="jbi:endpoint:http://servicemix.apache.org/samples/bridge/pipeline/endpoint"/>
>              	<to uri="log:org.apache.servicemix.example?level=INFO"/>
>              	<choice>
>                	<when>
>                		<xpath>//method='startProcess'</xpath>
>                  		<to uri="xslt:bridge.xslt"/>
>                  		<to uri="bean:initiateProcess"/>
>                  		
>                	</when>
>                	<otherwise>
>                  		<to uri="file:/Users/paundejr/..."/>
>                	</otherwise>
>              	</choice>
>            </route>
>      </camelContext>
> 
> -----
> Gumba
> --
> View this message in context: http://servicemix.396122.n5.nabble.com/problem-in-content-based-routing-and-xpath-evaluation-SMX4-3-tp4638543p5713899.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: problem in content based routing and xpath evaluation SMX4.3

Posted by gumba <an...@gmail.com>.
I solved the problem with this code, I logged the message before use path on
it.

<camelContext id="camelProcess"
xmlns="http://camel.apache.org/schema/spring">
            <route>
          		<from
uri="jbi:endpoint:http://servicemix.apache.org/samples/bridge/pipeline/endpoint"/>
              	<to uri="log:org.apache.servicemix.example?level=INFO"/>
              	<choice>
                	<when>
                		<xpath>//method='startProcess'</xpath>
                  		<to uri="xslt:bridge.xslt"/>
                  		<to uri="bean:initiateProcess"/>
                  		
                	</when>
                	<otherwise>
                  		<to uri="file:/Users/paundejr/..."/>
                	</otherwise>
              	</choice>
            </route>
      </camelContext>

-----
Gumba
--
View this message in context: http://servicemix.396122.n5.nabble.com/problem-in-content-based-routing-and-xpath-evaluation-SMX4-3-tp4638543p5713899.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: problem in content based routing and xpath evaluation SMX4.3

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

This generally means the stream was consumed already. You need cache the stream . Add streamCache="true" to the camelContext can simply fix it.
Take a look at [1] to get more details.

[1]http://camel.apache.org/stream-caching.html
Freeman
-------------
Freeman Fang

FuseSource
Email:ffang@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: http://weibo.com/u/1473905042

On 2012-7-16, at 下午6:24, gumba wrote:

> <?xml version="1.0" encoding="UTF-8"?>
> <e:Envelope xmlns:e="http://schemas.xmlsoap.org/soap/envelope/">
>  <e:Body>
>    <ping>
>      <pingRequest>
>        <message>
>        	<method>startProcess</method>
>        	<content>gpi</content>
>        </message>
>      </pingRequest>
>    </ping>
>  </e:Body>
> </e:Envelope>
> 
> 
> 
> <camelContext id="camelProcess"
> xmlns="http://camel.apache.org/schema/spring">
>            <route>
>          		<from
> uri="jbi:endpoint:http://servicemix.apache.org/samples/bridge/pipeline/endpoint"/>
>              	<choice>
>                	<when>
>                		<xpath>//method='startProcess'</xpath>
>                  		<to uri="xslt:bridge.xslt"/>
>                  		<to uri="bean:initiateProcess"/>
>                	</when>
>                	<otherwise>
>                  		<to uri="file:/Users/folder"/>
>                	</otherwise>
>              	</choice>
>            </route>
>      </camelContext>
> 
> I have this camel route, after I evaluate the XPath the message become empty
> and I get an error:
> "premature end of file" which means the file is empty and I proof that by
> redirecting it to a folder.
> What is wrong with my XPath expression?
> 
> -----
> Gumba
> --
> View this message in context: http://servicemix.396122.n5.nabble.com/problem-in-content-based-routing-and-xpath-evaluation-SMX4-3-tp4638543p5713897.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: problem in content based routing and xpath evaluation SMX4.3

Posted by gumba <an...@gmail.com>.
<?xml version="1.0" encoding="UTF-8"?>
<e:Envelope xmlns:e="http://schemas.xmlsoap.org/soap/envelope/">
  <e:Body>
    <ping>
      <pingRequest>
        <message>
        	<method>startProcess</method>
        	<content>gpi</content>
        </message>
      </pingRequest>
    </ping>
  </e:Body>
</e:Envelope>



<camelContext id="camelProcess"
xmlns="http://camel.apache.org/schema/spring">
            <route>
          		<from
uri="jbi:endpoint:http://servicemix.apache.org/samples/bridge/pipeline/endpoint"/>
              	<choice>
                	<when>
                		<xpath>//method='startProcess'</xpath>
                  		<to uri="xslt:bridge.xslt"/>
                  		<to uri="bean:initiateProcess"/>
                	</when>
                	<otherwise>
                  		<to uri="file:/Users/folder"/>
                	</otherwise>
              	</choice>
            </route>
      </camelContext>

I have this camel route, after I evaluate the XPath the message become empty
and I get an error:
"premature end of file" which means the file is empty and I proof that by
redirecting it to a folder.
What is wrong with my XPath expression?

-----
Gumba
--
View this message in context: http://servicemix.396122.n5.nabble.com/problem-in-content-based-routing-and-xpath-evaluation-SMX4-3-tp4638543p5713897.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: problem in content based routing and xpath evaluation SMX4.3

Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Jul 29, 2011 at 3:24 PM, Ovini Udugala <ov...@gmail.com> wrote:
> On Fri, Jul 29, 2011 at 3:11 PM, Claus Ibsen <cl...@gmail.com> wrote:
>
>> When using XPath you must take care of namespaces. So if your XML uses
>> namespace, you must use those in the xpath expression as well.
>>
>>
>>
>> On Fri, Jul 29, 2011 at 11:37 AM, Ovini Udugala <ov...@gmail.com> wrote:
>> Thanx for being responsive,
>>
>
>   This is the message i'm sending
>
>>
>> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/
>> ">
>> <soapenv:Header><routing xmlns="http://someuri">xadmin;
>> community</routing></soapenv:Header>
>> <soapenv:Body>
>> <m:department xmlns:m="http://services.samples.dep/xsd">
>> <emp><name>TOM</name><dur>4</dur></emp>
>> <emp><name>JANE</name><dur>3</dur></emp>
>> </m:department>
>> </soapenv:Body>
>> </soapenv:Envelope>
>>
>
> I changed the configuration to
>
> <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"  xmlns:m="
> http://services.samples.dep/xsd">
>        <route>
>            <from uri="jbi:endpoint:
> http://servicemix.apache.org/cbr/camelRouter/consumerEndpoint"/>
>            <choice>
>                <when>
>
> <xpath>/soapenv:Envelope/soapenv:Body/m:department/emp[1]/name = 'TOM'
> </xpath>
>                    <to uri="jbi:endpoint:
> jbi:endpoint:http://servicemix.apache.org/routerProvider/providerEndpoint<http://servicemix.apache.org/cbr/routerProvider>
> "/>
>                </when>
>            </choice>
>        </route>
>   </camelContext>
>
> Still I'm getting the same response. Whether the first emp tag contains the
> name TOM or not, the message reaches the providerEndpont
>

XPath expressions can be a pain in the *** to get working.

Maybe try with a single namespace and // for looking in any node (or
something like that)
"m://emp[1]/name = 'TOM'"

You can always mess with it from some java code, to try it out until
you get the xpath expression correct.
Its a bit cumbersome to use the XPath API from the JDK.



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: problem in content based routing and xpath evaluation SMX4.3

Posted by Ovini Udugala <ov...@gmail.com>.
On Fri, Jul 29, 2011 at 3:11 PM, Claus Ibsen <cl...@gmail.com> wrote:

> When using XPath you must take care of namespaces. So if your XML uses
> namespace, you must use those in the xpath expression as well.
>
>
>
> On Fri, Jul 29, 2011 at 11:37 AM, Ovini Udugala <ov...@gmail.com> wrote:
> Thanx for being responsive,
>

   This is the message i'm sending

>
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/
> ">
> <soapenv:Header><routing xmlns="http://someuri">xadmin;
> community</routing></soapenv:Header>
> <soapenv:Body>
> <m:department xmlns:m="http://services.samples.dep/xsd">
> <emp><name>TOM</name><dur>4</dur></emp>
> <emp><name>JANE</name><dur>3</dur></emp>
> </m:department>
> </soapenv:Body>
> </soapenv:Envelope>
>

I changed the configuration to

<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"  xmlns:m="
http://services.samples.dep/xsd">
        <route>
            <from uri="jbi:endpoint:
http://servicemix.apache.org/cbr/camelRouter/consumerEndpoint"/>
            <choice>
                <when>

<xpath>/soapenv:Envelope/soapenv:Body/m:department/emp[1]/name = 'TOM'
</xpath>
                    <to uri="jbi:endpoint:
jbi:endpoint:http://servicemix.apache.org/routerProvider/providerEndpoint<http://servicemix.apache.org/cbr/routerProvider>
"/>
                </when>
            </choice>
        </route>
   </camelContext>

Still I'm getting the same response. Whether the first emp tag contains the
name TOM or not, the message reaches the providerEndpont

Re: problem in content based routing and xpath evaluation SMX4.3

Posted by Claus Ibsen <cl...@gmail.com>.
When using XPath you must take care of namespaces. So if your XML uses
namespace, you must use those in the xpath expression as well.



On Fri, Jul 29, 2011 at 11:37 AM, Ovini Udugala <ov...@gmail.com> wrote:
>>
>> Hi,
>>
> I think I got the problem solved to some extend.
>
> I have specified the whole configuration in camel contex as follows
>
>   <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
>        <route>
>            <from uri="jbi:endpoint:
> http://servicemix.apache.org/cbr/camelRouter/consumerEndpoint"/>
>            <choice>
>                <when>
>                    <xpath>//emp[1]/name/ = 'TOM' </xpath>
>                    <to uri="jbi:service:
> http://servicemix.apache.org/cbr/routerProvider"/>
>                </when>
>            </choice>
>        </route>
>   </camelContext>
>
> It seems that the Xpath predicate is not being evaluated. No matter which
> messages is sent the final response I get the same result.
> That is even if the tag contains TOM or not I get the following result. Also
> the body of the message is missing.
>
> <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="
> http://schemas.xmlsoap.org/soap/envelope/
> "><soapenv:Body/></soapenv:Envelope>
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: problem in content based routing and xpath evaluation SMX4.3

Posted by Ovini Udugala <ov...@gmail.com>.
>
> Hi,
>
I think I got the problem solved to some extend.

I have specified the whole configuration in camel contex as follows

   <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
        <route>
            <from uri="jbi:endpoint:
http://servicemix.apache.org/cbr/camelRouter/consumerEndpoint"/>
            <choice>
                <when>
                    <xpath>//emp[1]/name/ = 'TOM' </xpath>
                    <to uri="jbi:service:
http://servicemix.apache.org/cbr/routerProvider"/>
                </when>
            </choice>
        </route>
   </camelContext>

It seems that the Xpath predicate is not being evaluated. No matter which
messages is sent the final response I get the same result.
That is even if the tag contains TOM or not I get the following result. Also
the body of the message is missing.

<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="
http://schemas.xmlsoap.org/soap/envelope/
"><soapenv:Body/></soapenv:Envelope>