You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by John MIPIH <wo...@free.fr> on 2008/06/23 11:31:26 UTC
Content Based Routing with Camel
Hello,
Here is my camel config file :
<camelContext xmlns="http://activemq.apache.org/camel/schema/spring">
<route>
<from
uri="jbi:endpoint:urn:fr:mipih:poc:soa:Routage:RouteVersAdmission"/>
<to uri="log:Before-routing"/>
<choice>
<when>
<xpath>.//prenom = 'John'</xpath>
<to
uri="jbi:endpoint:urn:fr:mipih:poc:soa:ProcessusAdmissionImplService:ProcessusAdmissionImplPort?mep=in-out"/>
<to uri="log:Routage-vers-reference"/>
</when>
<otherwise>
<to
uri="jbi:endpoint:urn:fr:mipih:poc:soa:ProcessusAdmissionImplBisService:ProcessusAdmissionImplBisPort?mep=in-out"/>
<to uri="log:Routage-vers-convergence"/>
</otherwise>
</choice>
</route>
</camelContext>
When an incoming message comes I get in the console :
2008-06-23 11:27:07,892 [-camel-thread-1] INFO Avant-routage -
Exchange[JbiMessage:
org.apache.servicemix.jbi.messaging.NormalizedMessageImpl@2f1622{properties:
{}}]
2008-06-23 11:27:08,282 [-camel-thread-1] INFO Routage-vers-convergence -
Exchange[Message: org.apache.servicemix.jbi.jaxp.StaxSource@1db8f3a]
or
2008-06-23 11:27:16,048 [-camel-thread-4] INFO Avant-routage -
Exchange[JbiMessage:
org.apache.servicemix.jbi.messaging.NormalizedMessageImpl@193229{properties:
{}}]
2008-06-23 11:27:16,079 [-camel-thread-4] INFO Routage-vers-reference -
Exchange[Message: org.apache.servicemix.jbi.jaxp.StaxSource@1ace672]
according to the message content (so the routing works fine !)
This is good but the target service (cxf webservice) receives a bad message
(nullpointer exception). Why do the message change between my first log and
the second from NormalizedMessage to StaxSource ? The problem is this change
because when I change my camel context to :
<camelContext xmlns="http://activemq.apache.org/camel/schema/spring">
<route>
<from uri="jbi:endpoint:urn:fr:mipih:poc:soa:Routage:RouteVersAdmission"/>
<to
uri="jbi:endpoint:urn:fr:mipih:poc:soa:ProcessusAdmissionImplBisService:ProcessusAdmissionImplBisPort?mep=in-out"/>
</route>
</camelContext>
everything works fine (but no routing...)
--
View this message in context: http://www.nabble.com/Content-Based-Routing-with-Camel-tp18065614p18065614.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: Content Based Routing with Camel
Posted by John MIPIH <wo...@free.fr>.
Using java 1.6 it works well. Thanks a lot Gert. Adding jaxb-api and
jaxb-impl doesn't work, it leads to another error but for me using java 6 is
fine.
--
View this message in context: http://www.nabble.com/Content-Based-Routing-with-Camel-tp18065614p18196758.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: Content Based Routing with Camel
Posted by John MIPIH <wo...@free.fr>.
I did all of this but when i try do put my SA in servicemix I get the
following error message. I not using anymore mvn jbi:servicemix, I am
deploying my SA directly on a servicemix 3.2.2-SNAPSHOT
(apache-servicemix-3.2.2-20080629.225733-21) with the fine version of camel
component (I checked).
java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2357)
at java.lang.Class.getConstructor0(Class.java:2671)
at java.lang.Class.getDeclaredConstructor(Class.java:1953)
at
org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:60)
at
org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver.initHandlerMappings(DefaultNamespaceHandlerResolver.java:122)
at
org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver.<init>(DefaultNamespaceHandlerResolver.java:96)
at
org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver.<init>(DefaultNamespaceHandlerResolver.java:82)
at
org.apache.xbean.spring.context.v2.XBeanNamespaceHandlerResolver.<init>(XBeanNamespaceHandlerResolver.java:26)
at
org.apache.xbean.spring.context.v2.XBeanXmlBeanDefinitionReader.createDefaultNamespaceHandlerResolver(XBeanXmlBeanDefinitionReader.java:87)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.createReaderContext(XmlBeanDefinitionReader.java:477)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:458)
at
org.apache.xbean.spring.context.v2.XBeanXmlBeanDefinitionReader.registerBeanDefinitions(XBeanXmlBeanDefinitionReader.java:79)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:353)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:280)
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:131)
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:147)
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:173)
at
org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:112)
at
org.apache.xbean.spring.context.FileSystemXmlApplicationContext.loadBeanDefinitions(FileSystemXmlApplicationContext.java:168)
at
org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:101)
at
org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:389)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:324)
at
org.apache.xbean.server.spring.configuration.SpringConfiguration.<init>(SpringConfiguration.java:63)
at
org.apache.xbean.server.spring.configuration.SpringConfigurationServiceFactory.createService(SpringConfigurationServiceFactory.java:106)
at
org.apache.xbean.kernel.standard.ServiceManager.start(ServiceManager.java:420)
at
org.apache.xbean.kernel.standard.ServiceManager.initialize(ServiceManager.java:200)
at
org.apache.xbean.kernel.standard.RegistryFutureTask$RegisterCallable.call(RegistryFutureTask.java:110)
at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
at java.util.concurrent.FutureTask.run(FutureTask.java:123)
at
org.apache.xbean.kernel.standard.ServiceManagerRegistry.registerService(ServiceManagerRegistry.java:409)
at
org.apache.xbean.kernel.standard.StandardKernel.registerService(StandardKernel.java:220)
at
org.apache.xbean.server.spring.loader.SpringLoader.load(SpringLoader.java:152)
at
org.apache.servicemix.common.xbean.AbstractXBeanDeployer.deploy(AbstractXBeanDeployer.java:83)
at
org.apache.servicemix.camel.CamelSpringDeployer.deploy(CamelSpringDeployer.java:83)
at
org.apache.servicemix.common.BaseServiceUnitManager.doDeploy(BaseServiceUnitManager.java:88)
at
org.apache.servicemix.common.BaseServiceUnitManager.deploy(BaseServiceUnitManager.java:69)
at
org.apache.servicemix.jbi.framework.DeploymentService.deployServiceAssembly(DeploymentService.java:508)
at
org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServiceAssembly(AutoDeploymentService.java:353)
at
org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchive(AutoDeploymentService.java:256)
at
org.apache.servicemix.jbi.framework.AutoDeploymentService.monitorDirectory(AutoDeploymentService.java:664)
at
org.apache.servicemix.jbi.framework.AutoDeploymentService.access$800(AutoDeploymentService.java:62)
at
org.apache.servicemix.jbi.framework.AutoDeploymentService$1.run(AutoDeploymentService.java:628)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
INFO - DeploymentService - UnDeployed ServiceUnit
http-provider-admission-bis from Component: servicemix-http
INFO - DeploymentService - UnDeployed ServiceUnit
http-provider-admission from Component: servicemix-http
INFO - DeploymentService - UnDeployed ServiceUnit
http-consumer-admission from Component: servicemix-http
ERROR - AutoDeploymentService - Failed to update Service Assembly:
ServiceAssembly
java.lang.Exception: <?xml version="1.0" encoding="UTF-8"?>
<jbi-task xmlns="http://java.sun.com/xml/ns/jbi/management-message"
version="1.0">
<jbi-task-result>
<frmwk-task-result>
<frmwk-task-result-details>
<task-result-details>
<task-id>deploy</task-id>
<task-result>FAILED</task-result>
<message-type>ERROR</message-type>
</task-result-details>
</frmwk-task-result-details>
</frmwk-task-result>
<component-task-result
xmlns="http://java.sun.com/xml/ns/jbi/management-message">
<component-name>servicemix-http</component-name>
<component-task-result-details>
<task-result-details>
<task-id>deploy</task-id>
<task-result>SUCCESS</task-result>
</task-result-details>
</component-task-result-details>
</component-task-result>
<component-task-result
xmlns="http://java.sun.com/xml/ns/jbi/management-message">
<component-name>servicemix-http</component-name>
<component-task-result-details>
<task-result-details>
<task-id>deploy</task-id>
<task-result>SUCCESS</task-result>
</task-result-details>
</component-task-result-details>
</component-task-result>
<component-task-result
xmlns="http://java.sun.com/xml/ns/jbi/management-message">
<component-name>servicemix-camel</component-name>
<component-task-result-details>
<task-result-details>
<task-id>deploy</task-id>
<task-result>FAILED</task-result>
<message-type>ERROR</message-type>
<task-status-msg>
<msg-loc-info>
<loc-token/>
<loc-message>Could not deploy xbean service unit</loc-message>
</msg-loc-info>
</task-status-msg>
<exception-info>
<nesting-level>1</nesting-level>
<msg-loc-info>
<loc-token/>
<loc-message>org.springframework.beans.factory.BeanDefinitionStoreException:
Unrecognized xbean namespace mapping: http:
//activemq.apache.org/camel/schema/spring</loc-message>
<stack-trace><![CDATA[org.apache.xbean.kernel.ServiceRegistrationException:
org.springframework.beans.factory.BeanDefini
tionStoreException: Unrecognized xbean namespace mapping:
http://activemq.apache.org/camel/schema/spring
at
org.apache.xbean.kernel.standard.ServiceManagerRegistry.registerService(ServiceManagerRegistry.java:424)
at
org.apache.xbean.kernel.standard.StandardKernel.registerService(StandardKernel.java:220)
at
org.apache.xbean.server.spring.loader.SpringLoader.load(SpringLoader.java:152)
at
org.apache.servicemix.common.xbean.AbstractXBeanDeployer.deploy(AbstractXBeanDeployer.java:83)
at
org.apache.servicemix.camel.CamelSpringDeployer.deploy(CamelSpringDeployer.java:83)
at
org.apache.servicemix.common.BaseServiceUnitManager.doDeploy(BaseServiceUnitManager.java:88)
at
org.apache.servicemix.common.BaseServiceUnitManager.deploy(BaseServiceUnitManager.java:69)
at
org.apache.servicemix.jbi.framework.DeploymentService.deployServiceAssembly(DeploymentService.java:508)
at
org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServiceAssembly(AutoDeploymentService.java:353)
at
org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchive(AutoDeploymentService.java:256)
at
org.apache.servicemix.jbi.framework.AutoDeploymentService.monitorDirectory(AutoDeploymentService.java:664)
at
org.apache.servicemix.jbi.framework.AutoDeploymentService.access$800(AutoDeploymentService.java:62)
at
org.apache.servicemix.jbi.framework.AutoDeploymentService$1.run(AutoDeploymentService.java:628)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException:
Unrecognized xbean namespace mapping:
http://activemq.apache.org/camel/schema/spring
at
org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.parseBeanFromExtensionElement(XBeanNamespaceHandler.java:268)
at
org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.parse(XBeanNamespaceHandler.java:155)
at
org.apache.xbean.spring.context.v2.XBeanNamespaceHandler.parse(XBeanNamespaceHandler.java:49)
at
org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1114)
at
org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1104)
at
org.apache.xbean.spring.context.v2.XBeanBeanDefinitionDocumentReader.parseBeanDefinitions(XBeanBeanDefinitionDocumentReader.java:84)
at
org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:90)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:458)
at
org.apache.xbean.spring.context.v2.XBeanXmlBeanDefinitionReader.registerBeanDefinitions(XBeanXmlBeanDefinitionReader.java:79)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:353)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:280)
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:131)
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:147)
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:173)
at
org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:112)
at
org.apache.xbean.spring.context.FileSystemXmlApplicationContext.loadBeanDefinitions(FileSystemXmlApplicationContext.java:168)
at
org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:101)
at
org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:389)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:324)
at
org.apache.xbean.server.spring.configuration.SpringConfiguration.<init>(SpringConfiguration.java:63)
at
org.apache.xbean.server.spring.configuration.SpringConfigurationServiceFactory.createService(SpringConfigurationServiceFactory.java:106)
at
org.apache.xbean.kernel.standard.ServiceManager.start(ServiceManager.java:420)
at
org.apache.xbean.kernel.standard.ServiceManager.initialize(ServiceManager.java:200)
at
org.apache.xbean.kernel.standard.RegistryFutureTask$RegisterCallable.call(RegistryFutureTask.java:110)
at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
at java.util.concurrent.FutureTask.run(FutureTask.java:123)
at
org.apache.xbean.kernel.standard.ServiceManagerRegistry.registerService(ServiceManagerRegistry.java:409)
... 14 more
]]></stack-trace>
</msg-loc-info>
</exception-info>
</task-result-details>
</component-task-result-details>
</component-task-result>
<component-task-result
xmlns="http://java.sun.com/xml/ns/jbi/management-message">
<component-name>servicemix-http</component-name>
<component-task-result-details>
<task-result-details>
<task-id>deploy</task-id>
<task-result>SUCCESS</task-result>
</task-result-details>
</component-task-result-details>
</component-task-result>
</jbi-task-result>
</jbi-task>
at
org.apache.servicemix.jbi.framework.ManagementSupport.failure(ManagementSupport.java:125)
at
org.apache.servicemix.jbi.framework.ManagementSupport.failure(ManagementSupport.java:111)
at
org.apache.servicemix.jbi.framework.DeploymentService.deployServiceAssembly(DeploymentService.java:543)
at
org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServiceAssembly(AutoDeploymentService.java:353)
at
org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchive(AutoDeploymentService.java:256)
at
org.apache.servicemix.jbi.framework.AutoDeploymentService.monitorDirectory(AutoDeploymentService.java:664)
at
org.apache.servicemix.jbi.framework.AutoDeploymentService.access$800(AutoDeploymentService.java:62)
at
org.apache.servicemix.jbi.framework.AutoDeploymentService$1.run(AutoDeploymentService.java:628)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
WARN - AutoDeploymentService - Directory: hotdeploy: Automatic
install of
C:\Travail\apache-servicemix-3.2.2-SNAPSHOT\hotdeploy\ServiceAssembly-1.0.ja
r failed
javax.jbi.management.DeploymentException: Failed to update Service Assembly:
ServiceAssembly
at
org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServiceAssembly(AutoDeploymentService.java:368)
at
org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchive(AutoDeploymentService.java:256)
at
org.apache.servicemix.jbi.framework.AutoDeploymentService.monitorDirectory(AutoDeploymentService.java:664)
at
org.apache.servicemix.jbi.framework.AutoDeploymentService.access$800(AutoDeploymentService.java:62)
at
org.apache.servicemix.jbi.framework.AutoDeploymentService$1.run(AutoDeploymentService.java:628)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
Caused by: java.lang.Exception: <?xml version="1.0" encoding="UTF-8"?>
<jbi-task xmlns="http://java.sun.com/xml/ns/jbi/management-message"
version="1.0">
<jbi-task-result>
<frmwk-task-result>
<frmwk-task-result-details>
<task-result-details>
<task-id>deploy</task-id>
<task-result>FAILED</task-result>
<message-type>ERROR</message-type>
</task-result-details>
</frmwk-task-result-details>
</frmwk-task-result>
<component-task-result
xmlns="http://java.sun.com/xml/ns/jbi/management-message">
<component-name>servicemix-http</component-name>
<component-task-result-details>
<task-result-details>
<task-id>deploy</task-id>
<task-result>SUCCESS</task-result>
</task-result-details>
</component-task-result-details>
</component-task-result>
<component-task-result
xmlns="http://java.sun.com/xml/ns/jbi/management-message">
<component-name>servicemix-http</component-name>
<component-task-result-details>
<task-result-details>
<task-id>deploy</task-id>
<task-result>SUCCESS</task-result>
</task-result-details>
</component-task-result-details>
</component-task-result>
<component-task-result
xmlns="http://java.sun.com/xml/ns/jbi/management-message">
<component-name>servicemix-camel</component-name>
<component-task-result-details>
<task-result-details>
<task-id>deploy</task-id>
<task-result>FAILED</task-result>
<message-type>ERROR</message-type>
<task-status-msg>
<msg-loc-info>
<loc-token/>
<loc-message>Could not deploy xbean service unit</loc-message>
</msg-loc-info>
</task-status-msg>
<exception-info>
<nesting-level>1</nesting-level>
<msg-loc-info>
<loc-token/>
<loc-message>org.springframework.beans.factory.BeanDefinitionStoreException:
Unrecognized xbean namespace mapping: http:
//activemq.apache.org/camel/schema/spring</loc-message>
<stack-trace><![CDATA[org.apache.xbean.kernel.ServiceRegistrationException:
org.springframework.beans.factory.BeanDefini
tionStoreException: Unrecognized xbean namespace mapping:
http://activemq.apache.org/camel/schema/spring
at
org.apache.xbean.kernel.standard.ServiceManagerRegistry.registerService(ServiceManagerRegistry.java:424)
at
org.apache.xbean.kernel.standard.StandardKernel.registerService(StandardKernel.java:220)
at
org.apache.xbean.server.spring.loader.SpringLoader.load(SpringLoader.java:152)
at
org.apache.servicemix.common.xbean.AbstractXBeanDeployer.deploy(AbstractXBeanDeployer.java:83)
at
org.apache.servicemix.camel.CamelSpringDeployer.deploy(CamelSpringDeployer.java:83)
at
org.apache.servicemix.common.BaseServiceUnitManager.doDeploy(BaseServiceUnitManager.java:88)
at
org.apache.servicemix.common.BaseServiceUnitManager.deploy(BaseServiceUnitManager.java:69)
at
org.apache.servicemix.jbi.framework.DeploymentService.deployServiceAssembly(DeploymentService.java:508)
at
org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServiceAssembly(AutoDeploymentService.java:353)
at
org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchive(AutoDeploymentService.java:256)
at
org.apache.servicemix.jbi.framework.AutoDeploymentService.monitorDirectory(AutoDeploymentService.java:664)
at
org.apache.servicemix.jbi.framework.AutoDeploymentService.access$800(AutoDeploymentService.java:62)
at
org.apache.servicemix.jbi.framework.AutoDeploymentService$1.run(AutoDeploymentService.java:628)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException:
Unrecognized xbean namespace mapping:
http://activemq.apache.org/camel/schema/spring
at
org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.parseBeanFromExtensionElement(XBeanNamespaceHandler.java:268)
at
org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.parse(XBeanNamespaceHandler.java:155)
at
org.apache.xbean.spring.context.v2.XBeanNamespaceHandler.parse(XBeanNamespaceHandler.java:49)
at
org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1114)
at
org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1104)
at
org.apache.xbean.spring.context.v2.XBeanBeanDefinitionDocumentReader.parseBeanDefinitions(XBeanBeanDefinitionDocumentReader.java:84)
at
org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:90)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:458)
at
org.apache.xbean.spring.context.v2.XBeanXmlBeanDefinitionReader.registerBeanDefinitions(XBeanXmlBeanDefinitionReader.java:79)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:353)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:280)
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:131)
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:147)
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:173)
at
org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:112)
at
org.apache.xbean.spring.context.FileSystemXmlApplicationContext.loadBeanDefinitions(FileSystemXmlApplicationContext.java:168)
at
org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:101)
at
org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:389)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:324)
at
org.apache.xbean.server.spring.configuration.SpringConfiguration.<init>(SpringConfiguration.java:63)
at
org.apache.xbean.server.spring.configuration.SpringConfigurationServiceFactory.createService(SpringConfigurationServiceFactory.java:106)
at
org.apache.xbean.kernel.standard.ServiceManager.start(ServiceManager.java:420)
at
org.apache.xbean.kernel.standard.ServiceManager.initialize(ServiceManager.java:200)
at
org.apache.xbean.kernel.standard.RegistryFutureTask$RegisterCallable.call(RegistryFutureTask.java:110)
at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
at java.util.concurrent.FutureTask.run(FutureTask.java:123)
at
org.apache.xbean.kernel.standard.ServiceManagerRegistry.registerService(ServiceManagerRegistry.java:409)
... 14 more
]]></stack-trace>
</msg-loc-info>
</exception-info>
</task-result-details>
</component-task-result-details>
</component-task-result>
<component-task-result
xmlns="http://java.sun.com/xml/ns/jbi/management-message">
<component-name>servicemix-http</component-name>
<component-task-result-details>
<task-result-details>
<task-id>deploy</task-id>
<task-result>SUCCESS</task-result>
</task-result-details>
</component-task-result-details>
</component-task-result>
</jbi-task-result>
</jbi-task>
at
org.apache.servicemix.jbi.framework.ManagementSupport.failure(ManagementSupport.java:125)
at
org.apache.servicemix.jbi.framework.ManagementSupport.failure(ManagementSupport.java:111)
at
org.apache.servicemix.jbi.framework.DeploymentService.deployServiceAssembly(DeploymentService.java:543)
at
org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServiceAssembly(AutoDeploymentService.java:353)
... 6 more
Gert Vanthienen wrote:
>
> L.S.,
>
> Did you manage to get this working? If you rebuild you local project
> now with ServiceMix 3.2.2-SNAPSHOT and Camel 1.4-SNAPSHOT as the
> dependencies, the problem should go away -- all of these are now
> available in the snapshot repos. You will also have to upgrade your
> ServiceMix container's Camel component with the new 3.2.2-SNAPSHOT
> version as well -- be sure to remove the old one before copying the new
> version in the deploy folder.
>
> Regards,
>
> Gert
>
> John MIPIH wrote:
>> Thanks a lot Gert. How can I get the patch and build new camel jars ? I
>> wanted to add the deprecated method by mysel but i can't download the
>> camel
>> source distribution from the official website... (The requested URL
>> /dist/activemq/apache-camel/1.4.0/apache-camel-1.4.0-src.zip was not
>> found
>> on this server. for every mirror)
>>
>> I tried mvn -X clean install but "camel-core:jar:1.3.0" appear 10 times,
>> I
>> don't know how to change it. Here's my pom and i enclosed the log of mvn
>> -X
>> ( http://www.nabble.com/file/p18086666/log.txt log.txt ) :
>>
>> <?xml version="1.0" encoding="UTF-8"?><project>
>> <parent>
>> <artifactId>parent</artifactId>
>> <groupId>fr.mm.pocsoa.esb</groupId>
>> <version>1.0</version>
>> </parent>
>> <modelVersion>4.0.0</modelVersion>
>> <groupId>fr.mm.pocsoa.esb</groupId>
>> <artifactId>camel-routage</artifactId>
>> <packaging>jbi-service-unit</packaging>
>> <name>SE : Camel</name>
>> <version>1.0</version>
>> <url>http://www.mipih.fr</url>
>> <build>
>> <defaultGoal>install</defaultGoal>
>> <plugins>
>> <plugin>
>> <artifactId>maven-compiler-plugin</artifactId>
>> <configuration>
>> <source>1.5</source>
>> <target>1.5</target>
>> </configuration>
>> </plugin>
>> <plugin>
>> <groupId>org.apache.servicemix.tooling</groupId>
>> <artifactId>jbi-maven-plugin</artifactId>
>> <version>${servicemix-version}</version>
>> <extensions>true</extensions>
>> </plugin>
>> <plugin>
>> <groupId>org.apache.camel</groupId>
>> <artifactId>camel-maven-plugin</artifactId>
>> <version>${camel-version}</version>
>> </plugin>
>> </plugins>
>> </build>
>> <repositories>
>> <repository>
>> <releases />
>> <snapshots>
>> <enabled>false</enabled>
>> </snapshots>
>> <id>apache</id>
>> <name>Apache Repository</name>
>>
>> <url>http://people.apache.org/repo/m2-ibiblio-rsync-repository</url>
>> </repository>
>> <repository>
>> <releases>
>> <enabled>false</enabled>
>> </releases>
>> <snapshots />
>> <id>apache.snapshots</id>
>> <name>Apache Snapshots Repository</name>
>> <url>http://people.apache.org/repo/m2-snapshot-repository</url>
>> </repository>
>> </repositories>
>> <pluginRepositories>
>> <pluginRepository>
>> <releases />
>> <snapshots>
>> <enabled>false</enabled>
>> </snapshots>
>> <id>apache</id>
>> <name>Apache Repository</name>
>>
>> <url>http://people.apache.org/repo/m2-ibiblio-rsync-repository</url>
>> </pluginRepository>
>> <pluginRepository>
>> <releases>
>> <enabled>false</enabled>
>> </releases>
>> <snapshots />
>> <id>apache.snapshots</id>
>> <name>Apache Snapshots Repository</name>
>> <url>http://people.apache.org/repo/m2-snapshot-repository</url>
>> </pluginRepository>
>> </pluginRepositories>
>> <dependencies>
>> <dependency>
>> <groupId>org.apache.servicemix</groupId>
>> <artifactId>servicemix-camel</artifactId>
>> <version>${servicemix-version}</version>
>> </dependency>
>> <dependency>
>> <groupId>org.apache.servicemix</groupId>
>> <artifactId>servicemix-core</artifactId>
>> <version>${servicemix-version}</version>
>> </dependency>
>> </dependencies>
>> <properties>
>> <servicemix-version>3.3-SNAPSHOT</servicemix-version>
>> <camel-version>1.4-SNAPSHOT</camel-version>
>> <componentName>servicemix-camel</componentName>
>> </properties>
>> </project>
>>
>>
>>
>> Gert Vanthienen wrote:
>>
>>> L.S.,
>>>
>>> I have just committed a fix for this problem to Camel -- if you have
>>> trouble finding the offending Camel 1.3 jar file, you can just rebuild
>>> Camel yourself locally and the 1.4-SNAPSHOT you'll end up with in your
>>> local repo will solve the issue for you.
>>>
>>> Regards,
>>>
>>> Gert
>>>
>>> Gert Vanthienen wrote:
>>>
>>>> L.S.,
>>>>
>>>> With recent refactorings on Apache Camel, a method on the Endpoint
>>>> interface was renamed from getCamelContext() to getContext(). Looking
>>>> at the exception, it looks like you have some code that was compiled
>>>> with Camel 1.3 and you're now running it on Camel 1.4. Make sure you
>>>> have changed every single reference to Camel 1.3 with Camel 1.4
>>>> SNAPSHOT -- just use mvn -X clean install jbi:servicemix to check out
>>>> classpaths and dependencies used. I was actually just creating a JIRA
>>>> issue to re-add the missing methods and mark them deprecated instead,
>>>> just to avoid this particular problem...
>>>>
>>>> Gert
>>>>
>>>> John MIPIH wrote:
>>>>
>>>>> Thanks a lot for your quick answer, I am going nut with this issue.
>>>>>
>>>>> I changed my camel-context (logs are now before to:jbi...) and enabled
>>>>> logging on my CXF web service. The log shows that camel sends an
>>>>> empty soap
>>>>> enveloppe to my web service when content-based routing is activated.
>>>>>
>>>>> As you recommended I tried to use servicemix 3.3-SNAPSHOT and Camel
>>>>> 1.4-SNAPSHOT. I changed all my pom's to have
>>>>> <servicemix-version>3.3-SNAPSHOT</servicemix-version>
>>>>> <camel-version>1.4-SNAPSHOT</camel-version>
>>>>>
>>>>> I launch my SA using "mvn clean install jbi:servicemix", deploying is
>>>>> fine
>>>>> but when I send a message to camel I have :
>>>>>
>>>>> java.lang.NoSuchMethodError:
>>>>> org.apache.camel.Endpoint.getCamelContext()Lorg/apache/camel/CamelContext;
>>>>>
>>>>> at
>>>>> org.apache.servicemix.camel.CamelJbiEndpoint.handleActiveProviderExchange(CamelJbiEndpoint.java:100)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.camel.CamelJbiEndpoint.process(CamelJbiEndpoint.java:74)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:582)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:533)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:487)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>>>
>>>>> 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)
>>>>> 2008-06-23 14:40:30,028 [btpool1-1 ] WARN
>>>>> jetty - /ProcessusAdmissionConsumer/
>>>>> java.lang.IllegalStateException: Exchange not found
>>>>> at
>>>>> org.apache.servicemix.http.processors.ConsumerProcessor.process(ConsumerProcessor.java:190)
>>>>>
>>>>> at
>>>>> org.apache.servicemix.http.HttpBridgeServlet.doPost(HttpBridgeServlet.java:71)
>>>>>
>>>>> at
>>>>> javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
>>>>> at
>>>>> javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>>>>> at
>>>>> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
>>>>> at
>>>>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
>>>>> at
>>>>> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:722)
>>>>> at
>>>>> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206)
>>>>>
>>>>> at
>>>>> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
>>>>>
>>>>> at
>>>>> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
>>>>> at org.mortbay.jetty.Server.handle(Server.java:324)
>>>>> at
>>>>> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
>>>>> at
>>>>> org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:374)
>>>>> at
>>>>> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
>>>>>
>>>>> at
>>>>> org.mortbay.jetty.nio.SelectChannelConnector$RetryContinuation.run(SelectChannelConnector.java:506)
>>>>>
>>>>> at
>>>>> org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)
>>>>>
>>>>>
>>>>>
>>>>> Any idea ?
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Gert Vanthienen wrote:
>>>>>
>>>>>
>>>>>> L.S.,
>>>>>>
>>>>>> If you put the <to uri="log:..."> after the routing step to CXF in
>>>>>> your camel file, you implicitly create a pipeline that first sends
>>>>>> an in-out exchange to CXF and afterwards logs the out message from
>>>>>> the CXF service call, that's why you see the StaxSource at that
>>>>>> point. To see what Camel is sending to the endpoint, you'll need to
>>>>>> add a <to uri="log..."> before the jbi:endpoint.
>>>>>> Could you enable DEBUG logging to see what the MessageExchanges
>>>>>> going to/from your CXF endpoints look like? You probably want to
>>>>>> get the latest SNAPSHOT version of the servicemix-camel component in
>>>>>> ServiceMix as well because it has some fixes with regards to MEP
>>>>>> processing you're going to need for this scenario to work.
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> Gert
>>>>>>
>>>>>> John MIPIH wrote:
>>>>>>
>>>>>>
>>>>>>> Hello,
>>>>>>>
>>>>>>> Here is my camel config file :
>>>>>>>
>>>>>>> <camelContext
>>>>>>> xmlns="http://activemq.apache.org/camel/schema/spring">
>>>>>>> <route>
>>>>>>> <from
>>>>>>> uri="jbi:endpoint:urn:fr:mipih:poc:soa:Routage:RouteVersAdmission"/>
>>>>>>> <to uri="log:Before-routing"/>
>>>>>>> <choice>
>>>>>>> <when>
>>>>>>> <xpath>.//prenom = 'John'</xpath>
>>>>>>> <to
>>>>>>> uri="jbi:endpoint:urn:fr:mipih:poc:soa:ProcessusAdmissionImplService:ProcessusAdmissionImplPort?mep=in-out"/>
>>>>>>>
>>>>>>> <to uri="log:Routage-vers-reference"/>
>>>>>>> </when>
>>>>>>> <otherwise>
>>>>>>> <to
>>>>>>> uri="jbi:endpoint:urn:fr:mipih:poc:soa:ProcessusAdmissionImplBisService:ProcessusAdmissionImplBisPort?mep=in-out"/>
>>>>>>>
>>>>>>> <to uri="log:Routage-vers-convergence"/>
>>>>>>> </otherwise>
>>>>>>> </choice>
>>>>>>> </route>
>>>>>>> </camelContext>
>>>>>>>
>>>>>>>
>>>>>>> When an incoming message comes I get in the console :
>>>>>>> 2008-06-23 11:27:07,892 [-camel-thread-1] INFO Avant-routage -
>>>>>>> Exchange[JbiMessage:
>>>>>>> org.apache.servicemix.jbi.messaging.NormalizedMessageImpl@2f1622{properties:
>>>>>>>
>>>>>>> {}}]
>>>>>>> 2008-06-23 11:27:08,282 [-camel-thread-1] INFO
>>>>>>> Routage-vers-convergence
>>>>>>> -
>>>>>>> Exchange[Message: org.apache.servicemix.jbi.jaxp.StaxSource@1db8f3a]
>>>>>>>
>>>>>>> or
>>>>>>>
>>>>>>> 2008-06-23 11:27:16,048 [-camel-thread-4] INFO Avant-routage -
>>>>>>> Exchange[JbiMessage:
>>>>>>> org.apache.servicemix.jbi.messaging.NormalizedMessageImpl@193229{properties:
>>>>>>>
>>>>>>> {}}]
>>>>>>> 2008-06-23 11:27:16,079 [-camel-thread-4] INFO
>>>>>>> Routage-vers-reference -
>>>>>>> Exchange[Message: org.apache.servicemix.jbi.jaxp.StaxSource@1ace672]
>>>>>>>
>>>>>>> according to the message content (so the routing works fine !)
>>>>>>>
>>>>>>> This is good but the target service (cxf webservice) receives a bad
>>>>>>> message
>>>>>>> (nullpointer exception). Why do the message change between my first
>>>>>>> log
>>>>>>> and
>>>>>>> the second from NormalizedMessage to StaxSource ? The problem is
>>>>>>> this
>>>>>>> change
>>>>>>> because when I change my camel context to :
>>>>>>>
>>>>>>> <camelContext
>>>>>>> xmlns="http://activemq.apache.org/camel/schema/spring">
>>>>>>> <route>
>>>>>>> <from
>>>>>>> uri="jbi:endpoint:urn:fr:mipih:poc:soa:Routage:RouteVersAdmission"/>
>>>>>>> <to
>>>>>>> uri="jbi:endpoint:urn:fr:mipih:poc:soa:ProcessusAdmissionImplBisService:ProcessusAdmissionImplBisPort?mep=in-out"/>
>>>>>>>
>>>>>>> </route>
>>>>>>> </camelContext>
>>>>>>>
>>>>>>> everything works fine (but no routing...)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> -----
>>>>>> ---
>>>>>> Gert Vanthienen
>>>>>> http://www.anova.be
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>> -----
>>> ---
>>> Gert Vanthienen
>>> http://www.anova.be
>>>
>>>
>>
>>
>
>
>
> -----
> ---
> Gert Vanthienen
> http://www.anova.be
>
Quoted from:
http://www.nabble.com/Content-Based-Routing-with-Camel-tp18065614p18180644.html
--
View this message in context: http://www.nabble.com/Content-Based-Routing-with-Camel-tp18065614p18191333.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: Content Based Routing with Camel
Posted by Gert Vanthienen <ge...@skynet.be>.
L.S.,
Did you manage to get this working? If you rebuild you local project
now with ServiceMix 3.2.2-SNAPSHOT and Camel 1.4-SNAPSHOT as the
dependencies, the problem should go away -- all of these are now
available in the snapshot repos. You will also have to upgrade your
ServiceMix container's Camel component with the new 3.2.2-SNAPSHOT
version as well -- be sure to remove the old one before copying the new
version in the deploy folder.
Regards,
Gert
John MIPIH wrote:
> Thanks a lot Gert. How can I get the patch and build new camel jars ? I
> wanted to add the deprecated method by mysel but i can't download the camel
> source distribution from the official website... (The requested URL
> /dist/activemq/apache-camel/1.4.0/apache-camel-1.4.0-src.zip was not found
> on this server. for every mirror)
>
> I tried mvn -X clean install but "camel-core:jar:1.3.0" appear 10 times, I
> don't know how to change it. Here's my pom and i enclosed the log of mvn -X
> ( http://www.nabble.com/file/p18086666/log.txt log.txt ) :
>
> <?xml version="1.0" encoding="UTF-8"?><project>
> <parent>
> <artifactId>parent</artifactId>
> <groupId>fr.mm.pocsoa.esb</groupId>
> <version>1.0</version>
> </parent>
> <modelVersion>4.0.0</modelVersion>
> <groupId>fr.mm.pocsoa.esb</groupId>
> <artifactId>camel-routage</artifactId>
> <packaging>jbi-service-unit</packaging>
> <name>SE : Camel</name>
> <version>1.0</version>
> <url>http://www.mipih.fr</url>
> <build>
> <defaultGoal>install</defaultGoal>
> <plugins>
> <plugin>
> <artifactId>maven-compiler-plugin</artifactId>
> <configuration>
> <source>1.5</source>
> <target>1.5</target>
> </configuration>
> </plugin>
> <plugin>
> <groupId>org.apache.servicemix.tooling</groupId>
> <artifactId>jbi-maven-plugin</artifactId>
> <version>${servicemix-version}</version>
> <extensions>true</extensions>
> </plugin>
> <plugin>
> <groupId>org.apache.camel</groupId>
> <artifactId>camel-maven-plugin</artifactId>
> <version>${camel-version}</version>
> </plugin>
> </plugins>
> </build>
> <repositories>
> <repository>
> <releases />
> <snapshots>
> <enabled>false</enabled>
> </snapshots>
> <id>apache</id>
> <name>Apache Repository</name>
> <url>http://people.apache.org/repo/m2-ibiblio-rsync-repository</url>
> </repository>
> <repository>
> <releases>
> <enabled>false</enabled>
> </releases>
> <snapshots />
> <id>apache.snapshots</id>
> <name>Apache Snapshots Repository</name>
> <url>http://people.apache.org/repo/m2-snapshot-repository</url>
> </repository>
> </repositories>
> <pluginRepositories>
> <pluginRepository>
> <releases />
> <snapshots>
> <enabled>false</enabled>
> </snapshots>
> <id>apache</id>
> <name>Apache Repository</name>
> <url>http://people.apache.org/repo/m2-ibiblio-rsync-repository</url>
> </pluginRepository>
> <pluginRepository>
> <releases>
> <enabled>false</enabled>
> </releases>
> <snapshots />
> <id>apache.snapshots</id>
> <name>Apache Snapshots Repository</name>
> <url>http://people.apache.org/repo/m2-snapshot-repository</url>
> </pluginRepository>
> </pluginRepositories>
> <dependencies>
> <dependency>
> <groupId>org.apache.servicemix</groupId>
> <artifactId>servicemix-camel</artifactId>
> <version>${servicemix-version}</version>
> </dependency>
> <dependency>
> <groupId>org.apache.servicemix</groupId>
> <artifactId>servicemix-core</artifactId>
> <version>${servicemix-version}</version>
> </dependency>
> </dependencies>
> <properties>
> <servicemix-version>3.3-SNAPSHOT</servicemix-version>
> <camel-version>1.4-SNAPSHOT</camel-version>
> <componentName>servicemix-camel</componentName>
> </properties>
> </project>
>
>
>
> Gert Vanthienen wrote:
>
>> L.S.,
>>
>> I have just committed a fix for this problem to Camel -- if you have
>> trouble finding the offending Camel 1.3 jar file, you can just rebuild
>> Camel yourself locally and the 1.4-SNAPSHOT you'll end up with in your
>> local repo will solve the issue for you.
>>
>> Regards,
>>
>> Gert
>>
>> Gert Vanthienen wrote:
>>
>>> L.S.,
>>>
>>> With recent refactorings on Apache Camel, a method on the Endpoint
>>> interface was renamed from getCamelContext() to getContext(). Looking
>>> at the exception, it looks like you have some code that was compiled
>>> with Camel 1.3 and you're now running it on Camel 1.4. Make sure you
>>> have changed every single reference to Camel 1.3 with Camel 1.4
>>> SNAPSHOT -- just use mvn -X clean install jbi:servicemix to check out
>>> classpaths and dependencies used. I was actually just creating a JIRA
>>> issue to re-add the missing methods and mark them deprecated instead,
>>> just to avoid this particular problem...
>>>
>>> Gert
>>>
>>> John MIPIH wrote:
>>>
>>>> Thanks a lot for your quick answer, I am going nut with this issue.
>>>>
>>>> I changed my camel-context (logs are now before to:jbi...) and enabled
>>>> logging on my CXF web service. The log shows that camel sends an
>>>> empty soap
>>>> enveloppe to my web service when content-based routing is activated.
>>>>
>>>> As you recommended I tried to use servicemix 3.3-SNAPSHOT and Camel
>>>> 1.4-SNAPSHOT. I changed all my pom's to have
>>>> <servicemix-version>3.3-SNAPSHOT</servicemix-version>
>>>> <camel-version>1.4-SNAPSHOT</camel-version>
>>>>
>>>> I launch my SA using "mvn clean install jbi:servicemix", deploying is
>>>> fine
>>>> but when I send a message to camel I have :
>>>>
>>>> java.lang.NoSuchMethodError:
>>>> org.apache.camel.Endpoint.getCamelContext()Lorg/apache/camel/CamelContext;
>>>>
>>>> at
>>>> org.apache.servicemix.camel.CamelJbiEndpoint.handleActiveProviderExchange(CamelJbiEndpoint.java:100)
>>>>
>>>> at
>>>> org.apache.servicemix.camel.CamelJbiEndpoint.process(CamelJbiEndpoint.java:74)
>>>>
>>>> at
>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:582)
>>>>
>>>> at
>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:533)
>>>>
>>>> at
>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:487)
>>>>
>>>> at
>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>>
>>>> at
>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>>>>
>>>> at
>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>>
>>>> at
>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>>
>>>> at
>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>>
>>>> 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)
>>>> 2008-06-23 14:40:30,028 [btpool1-1 ] WARN
>>>> jetty - /ProcessusAdmissionConsumer/
>>>> java.lang.IllegalStateException: Exchange not found
>>>> at
>>>> org.apache.servicemix.http.processors.ConsumerProcessor.process(ConsumerProcessor.java:190)
>>>>
>>>> at
>>>> org.apache.servicemix.http.HttpBridgeServlet.doPost(HttpBridgeServlet.java:71)
>>>>
>>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
>>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>>>> at
>>>> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
>>>> at
>>>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
>>>> at
>>>> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:722)
>>>> at
>>>> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206)
>>>>
>>>> at
>>>> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
>>>>
>>>> at
>>>> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
>>>> at org.mortbay.jetty.Server.handle(Server.java:324)
>>>> at
>>>> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
>>>> at
>>>> org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:374)
>>>> at
>>>> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
>>>>
>>>> at
>>>> org.mortbay.jetty.nio.SelectChannelConnector$RetryContinuation.run(SelectChannelConnector.java:506)
>>>>
>>>> at
>>>> org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)
>>>>
>>>>
>>>>
>>>> Any idea ?
>>>>
>>>>
>>>>
>>>>
>>>> Gert Vanthienen wrote:
>>>>
>>>>
>>>>> L.S.,
>>>>>
>>>>> If you put the <to uri="log:..."> after the routing step to CXF in
>>>>> your camel file, you implicitly create a pipeline that first sends
>>>>> an in-out exchange to CXF and afterwards logs the out message from
>>>>> the CXF service call, that's why you see the StaxSource at that
>>>>> point. To see what Camel is sending to the endpoint, you'll need to
>>>>> add a <to uri="log..."> before the jbi:endpoint.
>>>>> Could you enable DEBUG logging to see what the MessageExchanges
>>>>> going to/from your CXF endpoints look like? You probably want to
>>>>> get the latest SNAPSHOT version of the servicemix-camel component in
>>>>> ServiceMix as well because it has some fixes with regards to MEP
>>>>> processing you're going to need for this scenario to work.
>>>>>
>>>>> Regards,
>>>>>
>>>>> Gert
>>>>>
>>>>> John MIPIH wrote:
>>>>>
>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> Here is my camel config file :
>>>>>>
>>>>>> <camelContext
>>>>>> xmlns="http://activemq.apache.org/camel/schema/spring">
>>>>>> <route>
>>>>>> <from
>>>>>> uri="jbi:endpoint:urn:fr:mipih:poc:soa:Routage:RouteVersAdmission"/>
>>>>>> <to uri="log:Before-routing"/>
>>>>>> <choice>
>>>>>> <when>
>>>>>> <xpath>.//prenom = 'John'</xpath>
>>>>>> <to
>>>>>> uri="jbi:endpoint:urn:fr:mipih:poc:soa:ProcessusAdmissionImplService:ProcessusAdmissionImplPort?mep=in-out"/>
>>>>>>
>>>>>> <to uri="log:Routage-vers-reference"/>
>>>>>> </when>
>>>>>> <otherwise>
>>>>>> <to
>>>>>> uri="jbi:endpoint:urn:fr:mipih:poc:soa:ProcessusAdmissionImplBisService:ProcessusAdmissionImplBisPort?mep=in-out"/>
>>>>>>
>>>>>> <to uri="log:Routage-vers-convergence"/>
>>>>>> </otherwise>
>>>>>> </choice>
>>>>>> </route>
>>>>>> </camelContext>
>>>>>>
>>>>>>
>>>>>> When an incoming message comes I get in the console :
>>>>>> 2008-06-23 11:27:07,892 [-camel-thread-1] INFO Avant-routage -
>>>>>> Exchange[JbiMessage:
>>>>>> org.apache.servicemix.jbi.messaging.NormalizedMessageImpl@2f1622{properties:
>>>>>>
>>>>>> {}}]
>>>>>> 2008-06-23 11:27:08,282 [-camel-thread-1] INFO
>>>>>> Routage-vers-convergence
>>>>>> -
>>>>>> Exchange[Message: org.apache.servicemix.jbi.jaxp.StaxSource@1db8f3a]
>>>>>>
>>>>>> or
>>>>>>
>>>>>> 2008-06-23 11:27:16,048 [-camel-thread-4] INFO Avant-routage -
>>>>>> Exchange[JbiMessage:
>>>>>> org.apache.servicemix.jbi.messaging.NormalizedMessageImpl@193229{properties:
>>>>>>
>>>>>> {}}]
>>>>>> 2008-06-23 11:27:16,079 [-camel-thread-4] INFO
>>>>>> Routage-vers-reference -
>>>>>> Exchange[Message: org.apache.servicemix.jbi.jaxp.StaxSource@1ace672]
>>>>>>
>>>>>> according to the message content (so the routing works fine !)
>>>>>>
>>>>>> This is good but the target service (cxf webservice) receives a bad
>>>>>> message
>>>>>> (nullpointer exception). Why do the message change between my first
>>>>>> log
>>>>>> and
>>>>>> the second from NormalizedMessage to StaxSource ? The problem is this
>>>>>> change
>>>>>> because when I change my camel context to :
>>>>>>
>>>>>> <camelContext xmlns="http://activemq.apache.org/camel/schema/spring">
>>>>>> <route>
>>>>>> <from
>>>>>> uri="jbi:endpoint:urn:fr:mipih:poc:soa:Routage:RouteVersAdmission"/>
>>>>>> <to
>>>>>> uri="jbi:endpoint:urn:fr:mipih:poc:soa:ProcessusAdmissionImplBisService:ProcessusAdmissionImplBisPort?mep=in-out"/>
>>>>>>
>>>>>> </route>
>>>>>> </camelContext>
>>>>>>
>>>>>> everything works fine (but no routing...)
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>> -----
>>>>> ---
>>>>> Gert Vanthienen
>>>>> http://www.anova.be
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>
>> -----
>> ---
>> Gert Vanthienen
>> http://www.anova.be
>>
>>
>
>
Re: Content Based Routing with Camel
Posted by John MIPIH <wo...@free.fr>.
After some investigations I checked out camel 1.4-SNAPSHOT from the trunk of
your svn and build it . Then I replaced the .jar in my local repo but the
error still remains...
John MIPIH wrote:
>
> Thanks a lot Gert. How can I get the patch and build new camel jars ? I
> wanted to add the deprecated method by mysel but i can't download the
> camel source distribution from the official website... (The requested URL
> /dist/activemq/apache-camel/1.4.0/apache-camel-1.4.0-src.zip was not found
> on this server. for every mirror)
>
> I tried mvn -X clean install but "camel-core:jar:1.3.0" appear 10 times, I
> don't know how to change it. Here's my pom and i enclosed the log of mvn
> -X ( http://www.nabble.com/file/p18086666/log.txt log.txt ) :
>
> <?xml version="1.0" encoding="UTF-8"?><project>
> <parent>
> <artifactId>parent</artifactId>
> <groupId>fr.mm.pocsoa.esb</groupId>
> <version>1.0</version>
> </parent>
> <modelVersion>4.0.0</modelVersion>
> <groupId>fr.mm.pocsoa.esb</groupId>
> <artifactId>camel-routage</artifactId>
> <packaging>jbi-service-unit</packaging>
> <name>SE : Camel</name>
> <version>1.0</version>
> <url>http://www.mipih.fr</url>
> <build>
> <defaultGoal>install</defaultGoal>
> <plugins>
> <plugin>
> <artifactId>maven-compiler-plugin</artifactId>
> <configuration>
> <source>1.5</source>
> <target>1.5</target>
> </configuration>
> </plugin>
> <plugin>
> <groupId>org.apache.servicemix.tooling</groupId>
> <artifactId>jbi-maven-plugin</artifactId>
> <version>${servicemix-version}</version>
> <extensions>true</extensions>
> </plugin>
> <plugin>
> <groupId>org.apache.camel</groupId>
> <artifactId>camel-maven-plugin</artifactId>
> <version>${camel-version}</version>
> </plugin>
> </plugins>
> </build>
> <repositories>
> <repository>
> <releases />
> <snapshots>
> <enabled>false</enabled>
> </snapshots>
> <id>apache</id>
> <name>Apache Repository</name>
> <url>http://people.apache.org/repo/m2-ibiblio-rsync-repository</url>
> </repository>
> <repository>
> <releases>
> <enabled>false</enabled>
> </releases>
> <snapshots />
> <id>apache.snapshots</id>
> <name>Apache Snapshots Repository</name>
> <url>http://people.apache.org/repo/m2-snapshot-repository</url>
> </repository>
> </repositories>
> <pluginRepositories>
> <pluginRepository>
> <releases />
> <snapshots>
> <enabled>false</enabled>
> </snapshots>
> <id>apache</id>
> <name>Apache Repository</name>
> <url>http://people.apache.org/repo/m2-ibiblio-rsync-repository</url>
> </pluginRepository>
> <pluginRepository>
> <releases>
> <enabled>false</enabled>
> </releases>
> <snapshots />
> <id>apache.snapshots</id>
> <name>Apache Snapshots Repository</name>
> <url>http://people.apache.org/repo/m2-snapshot-repository</url>
> </pluginRepository>
> </pluginRepositories>
> <dependencies>
> <dependency>
> <groupId>org.apache.servicemix</groupId>
> <artifactId>servicemix-camel</artifactId>
> <version>${servicemix-version}</version>
> </dependency>
> <dependency>
> <groupId>org.apache.servicemix</groupId>
> <artifactId>servicemix-core</artifactId>
> <version>${servicemix-version}</version>
> </dependency>
> </dependencies>
> <properties>
> <servicemix-version>3.3-SNAPSHOT</servicemix-version>
> <camel-version>1.4-SNAPSHOT</camel-version>
> <componentName>servicemix-camel</componentName>
> </properties>
> </project>
>
>
>
> Gert Vanthienen wrote:
>>
>> L.S.,
>>
>> I have just committed a fix for this problem to Camel -- if you have
>> trouble finding the offending Camel 1.3 jar file, you can just rebuild
>> Camel yourself locally and the 1.4-SNAPSHOT you'll end up with in your
>> local repo will solve the issue for you.
>>
>> Regards,
>>
>> Gert
>>
>> Gert Vanthienen wrote:
>>> L.S.,
>>>
>>> With recent refactorings on Apache Camel, a method on the Endpoint
>>> interface was renamed from getCamelContext() to getContext(). Looking
>>> at the exception, it looks like you have some code that was compiled
>>> with Camel 1.3 and you're now running it on Camel 1.4. Make sure you
>>> have changed every single reference to Camel 1.3 with Camel 1.4
>>> SNAPSHOT -- just use mvn -X clean install jbi:servicemix to check out
>>> classpaths and dependencies used. I was actually just creating a JIRA
>>> issue to re-add the missing methods and mark them deprecated instead,
>>> just to avoid this particular problem...
>>>
>>> Gert
>>>
>>> John MIPIH wrote:
>>>> Thanks a lot for your quick answer, I am going nut with this issue.
>>>>
>>>> I changed my camel-context (logs are now before to:jbi...) and enabled
>>>> logging on my CXF web service. The log shows that camel sends an
>>>> empty soap
>>>> enveloppe to my web service when content-based routing is activated.
>>>>
>>>> As you recommended I tried to use servicemix 3.3-SNAPSHOT and Camel
>>>> 1.4-SNAPSHOT. I changed all my pom's to have
>>>> <servicemix-version>3.3-SNAPSHOT</servicemix-version>
>>>> <camel-version>1.4-SNAPSHOT</camel-version>
>>>>
>>>> I launch my SA using "mvn clean install jbi:servicemix", deploying is
>>>> fine
>>>> but when I send a message to camel I have :
>>>>
>>>> java.lang.NoSuchMethodError:
>>>> org.apache.camel.Endpoint.getCamelContext()Lorg/apache/camel/CamelContext;
>>>>
>>>> at
>>>> org.apache.servicemix.camel.CamelJbiEndpoint.handleActiveProviderExchange(CamelJbiEndpoint.java:100)
>>>>
>>>> at
>>>> org.apache.servicemix.camel.CamelJbiEndpoint.process(CamelJbiEndpoint.java:74)
>>>>
>>>> at
>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:582)
>>>>
>>>> at
>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:533)
>>>>
>>>> at
>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:487)
>>>>
>>>> at
>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>>
>>>> at
>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>>>>
>>>> at
>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>>
>>>> at
>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>>
>>>> at
>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>>
>>>> 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)
>>>> 2008-06-23 14:40:30,028 [btpool1-1 ] WARN
>>>> jetty - /ProcessusAdmissionConsumer/
>>>> java.lang.IllegalStateException: Exchange not found
>>>> at
>>>> org.apache.servicemix.http.processors.ConsumerProcessor.process(ConsumerProcessor.java:190)
>>>>
>>>> at
>>>> org.apache.servicemix.http.HttpBridgeServlet.doPost(HttpBridgeServlet.java:71)
>>>>
>>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
>>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>>>> at
>>>> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
>>>> at
>>>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
>>>> at
>>>> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:722)
>>>> at
>>>> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206)
>>>>
>>>> at
>>>> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
>>>>
>>>> at
>>>> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
>>>> at org.mortbay.jetty.Server.handle(Server.java:324)
>>>> at
>>>> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
>>>> at
>>>> org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:374)
>>>> at
>>>> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
>>>>
>>>> at
>>>> org.mortbay.jetty.nio.SelectChannelConnector$RetryContinuation.run(SelectChannelConnector.java:506)
>>>>
>>>> at
>>>> org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)
>>>>
>>>>
>>>>
>>>> Any idea ?
>>>>
>>>>
>>>>
>>>>
>>>> Gert Vanthienen wrote:
>>>>
>>>>> L.S.,
>>>>>
>>>>> If you put the <to uri="log:..."> after the routing step to CXF in
>>>>> your camel file, you implicitly create a pipeline that first sends
>>>>> an in-out exchange to CXF and afterwards logs the out message from
>>>>> the CXF service call, that's why you see the StaxSource at that
>>>>> point. To see what Camel is sending to the endpoint, you'll need to
>>>>> add a <to uri="log..."> before the jbi:endpoint.
>>>>> Could you enable DEBUG logging to see what the MessageExchanges
>>>>> going to/from your CXF endpoints look like? You probably want to
>>>>> get the latest SNAPSHOT version of the servicemix-camel component in
>>>>> ServiceMix as well because it has some fixes with regards to MEP
>>>>> processing you're going to need for this scenario to work.
>>>>>
>>>>> Regards,
>>>>>
>>>>> Gert
>>>>>
>>>>> John MIPIH wrote:
>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> Here is my camel config file :
>>>>>>
>>>>>> <camelContext
>>>>>> xmlns="http://activemq.apache.org/camel/schema/spring">
>>>>>> <route>
>>>>>> <from
>>>>>> uri="jbi:endpoint:urn:fr:mipih:poc:soa:Routage:RouteVersAdmission"/>
>>>>>> <to uri="log:Before-routing"/>
>>>>>> <choice>
>>>>>> <when>
>>>>>> <xpath>.//prenom = 'John'</xpath>
>>>>>> <to
>>>>>> uri="jbi:endpoint:urn:fr:mipih:poc:soa:ProcessusAdmissionImplService:ProcessusAdmissionImplPort?mep=in-out"/>
>>>>>>
>>>>>> <to uri="log:Routage-vers-reference"/>
>>>>>> </when>
>>>>>> <otherwise>
>>>>>> <to
>>>>>> uri="jbi:endpoint:urn:fr:mipih:poc:soa:ProcessusAdmissionImplBisService:ProcessusAdmissionImplBisPort?mep=in-out"/>
>>>>>>
>>>>>> <to uri="log:Routage-vers-convergence"/>
>>>>>> </otherwise>
>>>>>> </choice>
>>>>>> </route>
>>>>>> </camelContext>
>>>>>>
>>>>>>
>>>>>> When an incoming message comes I get in the console :
>>>>>> 2008-06-23 11:27:07,892 [-camel-thread-1] INFO Avant-routage -
>>>>>> Exchange[JbiMessage:
>>>>>> org.apache.servicemix.jbi.messaging.NormalizedMessageImpl@2f1622{properties:
>>>>>>
>>>>>> {}}]
>>>>>> 2008-06-23 11:27:08,282 [-camel-thread-1] INFO
>>>>>> Routage-vers-convergence
>>>>>> -
>>>>>> Exchange[Message: org.apache.servicemix.jbi.jaxp.StaxSource@1db8f3a]
>>>>>>
>>>>>> or
>>>>>>
>>>>>> 2008-06-23 11:27:16,048 [-camel-thread-4] INFO Avant-routage -
>>>>>> Exchange[JbiMessage:
>>>>>> org.apache.servicemix.jbi.messaging.NormalizedMessageImpl@193229{properties:
>>>>>>
>>>>>> {}}]
>>>>>> 2008-06-23 11:27:16,079 [-camel-thread-4] INFO
>>>>>> Routage-vers-reference -
>>>>>> Exchange[Message: org.apache.servicemix.jbi.jaxp.StaxSource@1ace672]
>>>>>>
>>>>>> according to the message content (so the routing works fine !)
>>>>>>
>>>>>> This is good but the target service (cxf webservice) receives a bad
>>>>>> message
>>>>>> (nullpointer exception). Why do the message change between my first
>>>>>> log
>>>>>> and
>>>>>> the second from NormalizedMessage to StaxSource ? The problem is this
>>>>>> change
>>>>>> because when I change my camel context to :
>>>>>>
>>>>>> <camelContext xmlns="http://activemq.apache.org/camel/schema/spring">
>>>>>> <route>
>>>>>> <from
>>>>>> uri="jbi:endpoint:urn:fr:mipih:poc:soa:Routage:RouteVersAdmission"/>
>>>>>> <to
>>>>>> uri="jbi:endpoint:urn:fr:mipih:poc:soa:ProcessusAdmissionImplBisService:ProcessusAdmissionImplBisPort?mep=in-out"/>
>>>>>>
>>>>>> </route>
>>>>>> </camelContext>
>>>>>>
>>>>>> everything works fine (but no routing...)
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>> -----
>>>>> ---
>>>>> Gert Vanthienen
>>>>> http://www.anova.be
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>>
>> -----
>> ---
>> Gert Vanthienen
>> http://www.anova.be
>>
>
>
--
View this message in context: http://www.nabble.com/Content-Based-Routing-with-Camel-tp18065614p18093405.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: Content Based Routing with Camel
Posted by John MIPIH <wo...@free.fr>.
Thanks a lot Gert. How can I get the patch and build new camel jars ? I
wanted to add the deprecated method by mysel but i can't download the camel
source distribution from the official website... (The requested URL
/dist/activemq/apache-camel/1.4.0/apache-camel-1.4.0-src.zip was not found
on this server. for every mirror)
I tried mvn -X clean install but "camel-core:jar:1.3.0" appear 10 times, I
don't know how to change it. Here's my pom and i enclosed the log of mvn -X
( http://www.nabble.com/file/p18086666/log.txt log.txt ) :
<?xml version="1.0" encoding="UTF-8"?><project>
<parent>
<artifactId>parent</artifactId>
<groupId>fr.mm.pocsoa.esb</groupId>
<version>1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>fr.mm.pocsoa.esb</groupId>
<artifactId>camel-routage</artifactId>
<packaging>jbi-service-unit</packaging>
<name>SE : Camel</name>
<version>1.0</version>
<url>http://www.mipih.fr</url>
<build>
<defaultGoal>install</defaultGoal>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.servicemix.tooling</groupId>
<artifactId>jbi-maven-plugin</artifactId>
<version>${servicemix-version}</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.apache.camel</groupId>
<artifactId>camel-maven-plugin</artifactId>
<version>${camel-version}</version>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<releases />
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>apache</id>
<name>Apache Repository</name>
<url>http://people.apache.org/repo/m2-ibiblio-rsync-repository</url>
</repository>
<repository>
<releases>
<enabled>false</enabled>
</releases>
<snapshots />
<id>apache.snapshots</id>
<name>Apache Snapshots Repository</name>
<url>http://people.apache.org/repo/m2-snapshot-repository</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<releases />
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>apache</id>
<name>Apache Repository</name>
<url>http://people.apache.org/repo/m2-ibiblio-rsync-repository</url>
</pluginRepository>
<pluginRepository>
<releases>
<enabled>false</enabled>
</releases>
<snapshots />
<id>apache.snapshots</id>
<name>Apache Snapshots Repository</name>
<url>http://people.apache.org/repo/m2-snapshot-repository</url>
</pluginRepository>
</pluginRepositories>
<dependencies>
<dependency>
<groupId>org.apache.servicemix</groupId>
<artifactId>servicemix-camel</artifactId>
<version>${servicemix-version}</version>
</dependency>
<dependency>
<groupId>org.apache.servicemix</groupId>
<artifactId>servicemix-core</artifactId>
<version>${servicemix-version}</version>
</dependency>
</dependencies>
<properties>
<servicemix-version>3.3-SNAPSHOT</servicemix-version>
<camel-version>1.4-SNAPSHOT</camel-version>
<componentName>servicemix-camel</componentName>
</properties>
</project>
Gert Vanthienen wrote:
>
> L.S.,
>
> I have just committed a fix for this problem to Camel -- if you have
> trouble finding the offending Camel 1.3 jar file, you can just rebuild
> Camel yourself locally and the 1.4-SNAPSHOT you'll end up with in your
> local repo will solve the issue for you.
>
> Regards,
>
> Gert
>
> Gert Vanthienen wrote:
>> L.S.,
>>
>> With recent refactorings on Apache Camel, a method on the Endpoint
>> interface was renamed from getCamelContext() to getContext(). Looking
>> at the exception, it looks like you have some code that was compiled
>> with Camel 1.3 and you're now running it on Camel 1.4. Make sure you
>> have changed every single reference to Camel 1.3 with Camel 1.4
>> SNAPSHOT -- just use mvn -X clean install jbi:servicemix to check out
>> classpaths and dependencies used. I was actually just creating a JIRA
>> issue to re-add the missing methods and mark them deprecated instead,
>> just to avoid this particular problem...
>>
>> Gert
>>
>> John MIPIH wrote:
>>> Thanks a lot for your quick answer, I am going nut with this issue.
>>>
>>> I changed my camel-context (logs are now before to:jbi...) and enabled
>>> logging on my CXF web service. The log shows that camel sends an
>>> empty soap
>>> enveloppe to my web service when content-based routing is activated.
>>>
>>> As you recommended I tried to use servicemix 3.3-SNAPSHOT and Camel
>>> 1.4-SNAPSHOT. I changed all my pom's to have
>>> <servicemix-version>3.3-SNAPSHOT</servicemix-version>
>>> <camel-version>1.4-SNAPSHOT</camel-version>
>>>
>>> I launch my SA using "mvn clean install jbi:servicemix", deploying is
>>> fine
>>> but when I send a message to camel I have :
>>>
>>> java.lang.NoSuchMethodError:
>>> org.apache.camel.Endpoint.getCamelContext()Lorg/apache/camel/CamelContext;
>>>
>>> at
>>> org.apache.servicemix.camel.CamelJbiEndpoint.handleActiveProviderExchange(CamelJbiEndpoint.java:100)
>>>
>>> at
>>> org.apache.servicemix.camel.CamelJbiEndpoint.process(CamelJbiEndpoint.java:74)
>>>
>>> at
>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:582)
>>>
>>> at
>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:533)
>>>
>>> at
>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:487)
>>>
>>> at
>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>
>>> at
>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>>>
>>> at
>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>
>>> at
>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>
>>> at
>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>
>>> 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)
>>> 2008-06-23 14:40:30,028 [btpool1-1 ] WARN
>>> jetty - /ProcessusAdmissionConsumer/
>>> java.lang.IllegalStateException: Exchange not found
>>> at
>>> org.apache.servicemix.http.processors.ConsumerProcessor.process(ConsumerProcessor.java:190)
>>>
>>> at
>>> org.apache.servicemix.http.HttpBridgeServlet.doPost(HttpBridgeServlet.java:71)
>>>
>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>>> at
>>> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
>>> at
>>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
>>> at
>>> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:722)
>>> at
>>> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206)
>>>
>>> at
>>> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
>>>
>>> at
>>> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
>>> at org.mortbay.jetty.Server.handle(Server.java:324)
>>> at
>>> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
>>> at
>>> org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:374)
>>> at
>>> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
>>>
>>> at
>>> org.mortbay.jetty.nio.SelectChannelConnector$RetryContinuation.run(SelectChannelConnector.java:506)
>>>
>>> at
>>> org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)
>>>
>>>
>>>
>>> Any idea ?
>>>
>>>
>>>
>>>
>>> Gert Vanthienen wrote:
>>>
>>>> L.S.,
>>>>
>>>> If you put the <to uri="log:..."> after the routing step to CXF in
>>>> your camel file, you implicitly create a pipeline that first sends
>>>> an in-out exchange to CXF and afterwards logs the out message from
>>>> the CXF service call, that's why you see the StaxSource at that
>>>> point. To see what Camel is sending to the endpoint, you'll need to
>>>> add a <to uri="log..."> before the jbi:endpoint.
>>>> Could you enable DEBUG logging to see what the MessageExchanges
>>>> going to/from your CXF endpoints look like? You probably want to
>>>> get the latest SNAPSHOT version of the servicemix-camel component in
>>>> ServiceMix as well because it has some fixes with regards to MEP
>>>> processing you're going to need for this scenario to work.
>>>>
>>>> Regards,
>>>>
>>>> Gert
>>>>
>>>> John MIPIH wrote:
>>>>
>>>>> Hello,
>>>>>
>>>>> Here is my camel config file :
>>>>>
>>>>> <camelContext
>>>>> xmlns="http://activemq.apache.org/camel/schema/spring">
>>>>> <route>
>>>>> <from
>>>>> uri="jbi:endpoint:urn:fr:mipih:poc:soa:Routage:RouteVersAdmission"/>
>>>>> <to uri="log:Before-routing"/>
>>>>> <choice>
>>>>> <when>
>>>>> <xpath>.//prenom = 'John'</xpath>
>>>>> <to
>>>>> uri="jbi:endpoint:urn:fr:mipih:poc:soa:ProcessusAdmissionImplService:ProcessusAdmissionImplPort?mep=in-out"/>
>>>>>
>>>>> <to uri="log:Routage-vers-reference"/>
>>>>> </when>
>>>>> <otherwise>
>>>>> <to
>>>>> uri="jbi:endpoint:urn:fr:mipih:poc:soa:ProcessusAdmissionImplBisService:ProcessusAdmissionImplBisPort?mep=in-out"/>
>>>>>
>>>>> <to uri="log:Routage-vers-convergence"/>
>>>>> </otherwise>
>>>>> </choice>
>>>>> </route>
>>>>> </camelContext>
>>>>>
>>>>>
>>>>> When an incoming message comes I get in the console :
>>>>> 2008-06-23 11:27:07,892 [-camel-thread-1] INFO Avant-routage -
>>>>> Exchange[JbiMessage:
>>>>> org.apache.servicemix.jbi.messaging.NormalizedMessageImpl@2f1622{properties:
>>>>>
>>>>> {}}]
>>>>> 2008-06-23 11:27:08,282 [-camel-thread-1] INFO
>>>>> Routage-vers-convergence
>>>>> -
>>>>> Exchange[Message: org.apache.servicemix.jbi.jaxp.StaxSource@1db8f3a]
>>>>>
>>>>> or
>>>>>
>>>>> 2008-06-23 11:27:16,048 [-camel-thread-4] INFO Avant-routage -
>>>>> Exchange[JbiMessage:
>>>>> org.apache.servicemix.jbi.messaging.NormalizedMessageImpl@193229{properties:
>>>>>
>>>>> {}}]
>>>>> 2008-06-23 11:27:16,079 [-camel-thread-4] INFO
>>>>> Routage-vers-reference -
>>>>> Exchange[Message: org.apache.servicemix.jbi.jaxp.StaxSource@1ace672]
>>>>>
>>>>> according to the message content (so the routing works fine !)
>>>>>
>>>>> This is good but the target service (cxf webservice) receives a bad
>>>>> message
>>>>> (nullpointer exception). Why do the message change between my first
>>>>> log
>>>>> and
>>>>> the second from NormalizedMessage to StaxSource ? The problem is this
>>>>> change
>>>>> because when I change my camel context to :
>>>>>
>>>>> <camelContext xmlns="http://activemq.apache.org/camel/schema/spring">
>>>>> <route>
>>>>> <from
>>>>> uri="jbi:endpoint:urn:fr:mipih:poc:soa:Routage:RouteVersAdmission"/>
>>>>> <to
>>>>> uri="jbi:endpoint:urn:fr:mipih:poc:soa:ProcessusAdmissionImplBisService:ProcessusAdmissionImplBisPort?mep=in-out"/>
>>>>>
>>>>> </route>
>>>>> </camelContext>
>>>>>
>>>>> everything works fine (but no routing...)
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>> -----
>>>> ---
>>>> Gert Vanthienen
>>>> http://www.anova.be
>>>>
>>>>
>>>
>>>
>>
>>
>
>
>
> -----
> ---
> Gert Vanthienen
> http://www.anova.be
>
--
View this message in context: http://www.nabble.com/Content-Based-Routing-with-Camel-tp18065614p18086666.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: Content Based Routing with Camel
Posted by Gert Vanthienen <ge...@skynet.be>.
L.S.,
I have just committed a fix for this problem to Camel -- if you have
trouble finding the offending Camel 1.3 jar file, you can just rebuild
Camel yourself locally and the 1.4-SNAPSHOT you'll end up with in your
local repo will solve the issue for you.
Regards,
Gert
Gert Vanthienen wrote:
> L.S.,
>
> With recent refactorings on Apache Camel, a method on the Endpoint
> interface was renamed from getCamelContext() to getContext(). Looking
> at the exception, it looks like you have some code that was compiled
> with Camel 1.3 and you're now running it on Camel 1.4. Make sure you
> have changed every single reference to Camel 1.3 with Camel 1.4
> SNAPSHOT -- just use mvn -X clean install jbi:servicemix to check out
> classpaths and dependencies used. I was actually just creating a JIRA
> issue to re-add the missing methods and mark them deprecated instead,
> just to avoid this particular problem...
>
> Gert
>
> John MIPIH wrote:
>> Thanks a lot for your quick answer, I am going nut with this issue.
>>
>> I changed my camel-context (logs are now before to:jbi...) and enabled
>> logging on my CXF web service. The log shows that camel sends an
>> empty soap
>> enveloppe to my web service when content-based routing is activated.
>>
>> As you recommended I tried to use servicemix 3.3-SNAPSHOT and Camel
>> 1.4-SNAPSHOT. I changed all my pom's to have
>> <servicemix-version>3.3-SNAPSHOT</servicemix-version>
>> <camel-version>1.4-SNAPSHOT</camel-version>
>>
>> I launch my SA using "mvn clean install jbi:servicemix", deploying is
>> fine
>> but when I send a message to camel I have :
>>
>> java.lang.NoSuchMethodError:
>> org.apache.camel.Endpoint.getCamelContext()Lorg/apache/camel/CamelContext;
>>
>> at
>> org.apache.servicemix.camel.CamelJbiEndpoint.handleActiveProviderExchange(CamelJbiEndpoint.java:100)
>>
>> at
>> org.apache.servicemix.camel.CamelJbiEndpoint.process(CamelJbiEndpoint.java:74)
>>
>> at
>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:582)
>>
>> at
>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:533)
>>
>> at
>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:487)
>>
>> at
>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>
>> at
>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>>
>> at
>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>
>> at
>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>
>> at
>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>
>> 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)
>> 2008-06-23 14:40:30,028 [btpool1-1 ] WARN
>> jetty - /ProcessusAdmissionConsumer/
>> java.lang.IllegalStateException: Exchange not found
>> at
>> org.apache.servicemix.http.processors.ConsumerProcessor.process(ConsumerProcessor.java:190)
>>
>> at
>> org.apache.servicemix.http.HttpBridgeServlet.doPost(HttpBridgeServlet.java:71)
>>
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>> at
>> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
>> at
>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
>> at
>> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:722)
>> at
>> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206)
>>
>> at
>> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
>>
>> at
>> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
>> at org.mortbay.jetty.Server.handle(Server.java:324)
>> at
>> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
>> at
>> org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:374)
>> at
>> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
>>
>> at
>> org.mortbay.jetty.nio.SelectChannelConnector$RetryContinuation.run(SelectChannelConnector.java:506)
>>
>> at
>> org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)
>>
>>
>>
>> Any idea ?
>>
>>
>>
>>
>> Gert Vanthienen wrote:
>>
>>> L.S.,
>>>
>>> If you put the <to uri="log:..."> after the routing step to CXF in
>>> your camel file, you implicitly create a pipeline that first sends
>>> an in-out exchange to CXF and afterwards logs the out message from
>>> the CXF service call, that's why you see the StaxSource at that
>>> point. To see what Camel is sending to the endpoint, you'll need to
>>> add a <to uri="log..."> before the jbi:endpoint.
>>> Could you enable DEBUG logging to see what the MessageExchanges
>>> going to/from your CXF endpoints look like? You probably want to
>>> get the latest SNAPSHOT version of the servicemix-camel component in
>>> ServiceMix as well because it has some fixes with regards to MEP
>>> processing you're going to need for this scenario to work.
>>>
>>> Regards,
>>>
>>> Gert
>>>
>>> John MIPIH wrote:
>>>
>>>> Hello,
>>>>
>>>> Here is my camel config file :
>>>>
>>>> <camelContext
>>>> xmlns="http://activemq.apache.org/camel/schema/spring">
>>>> <route>
>>>> <from
>>>> uri="jbi:endpoint:urn:fr:mipih:poc:soa:Routage:RouteVersAdmission"/>
>>>> <to uri="log:Before-routing"/>
>>>> <choice>
>>>> <when>
>>>> <xpath>.//prenom = 'John'</xpath>
>>>> <to
>>>> uri="jbi:endpoint:urn:fr:mipih:poc:soa:ProcessusAdmissionImplService:ProcessusAdmissionImplPort?mep=in-out"/>
>>>>
>>>> <to uri="log:Routage-vers-reference"/>
>>>> </when>
>>>> <otherwise>
>>>> <to
>>>> uri="jbi:endpoint:urn:fr:mipih:poc:soa:ProcessusAdmissionImplBisService:ProcessusAdmissionImplBisPort?mep=in-out"/>
>>>>
>>>> <to uri="log:Routage-vers-convergence"/>
>>>> </otherwise>
>>>> </choice>
>>>> </route>
>>>> </camelContext>
>>>>
>>>>
>>>> When an incoming message comes I get in the console :
>>>> 2008-06-23 11:27:07,892 [-camel-thread-1] INFO Avant-routage -
>>>> Exchange[JbiMessage:
>>>> org.apache.servicemix.jbi.messaging.NormalizedMessageImpl@2f1622{properties:
>>>>
>>>> {}}]
>>>> 2008-06-23 11:27:08,282 [-camel-thread-1] INFO
>>>> Routage-vers-convergence
>>>> -
>>>> Exchange[Message: org.apache.servicemix.jbi.jaxp.StaxSource@1db8f3a]
>>>>
>>>> or
>>>>
>>>> 2008-06-23 11:27:16,048 [-camel-thread-4] INFO Avant-routage -
>>>> Exchange[JbiMessage:
>>>> org.apache.servicemix.jbi.messaging.NormalizedMessageImpl@193229{properties:
>>>>
>>>> {}}]
>>>> 2008-06-23 11:27:16,079 [-camel-thread-4] INFO
>>>> Routage-vers-reference -
>>>> Exchange[Message: org.apache.servicemix.jbi.jaxp.StaxSource@1ace672]
>>>>
>>>> according to the message content (so the routing works fine !)
>>>>
>>>> This is good but the target service (cxf webservice) receives a bad
>>>> message
>>>> (nullpointer exception). Why do the message change between my first
>>>> log
>>>> and
>>>> the second from NormalizedMessage to StaxSource ? The problem is this
>>>> change
>>>> because when I change my camel context to :
>>>>
>>>> <camelContext xmlns="http://activemq.apache.org/camel/schema/spring">
>>>> <route>
>>>> <from
>>>> uri="jbi:endpoint:urn:fr:mipih:poc:soa:Routage:RouteVersAdmission"/>
>>>> <to
>>>> uri="jbi:endpoint:urn:fr:mipih:poc:soa:ProcessusAdmissionImplBisService:ProcessusAdmissionImplBisPort?mep=in-out"/>
>>>>
>>>> </route>
>>>> </camelContext>
>>>>
>>>> everything works fine (but no routing...)
>>>>
>>>>
>>>>
>>>>
>>>
>>> -----
>>> ---
>>> Gert Vanthienen
>>> http://www.anova.be
>>>
>>>
>>
>>
>
>
Re: Content Based Routing with Camel
Posted by Gert Vanthienen <ge...@skynet.be>.
L.S.,
With recent refactorings on Apache Camel, a method on the Endpoint
interface was renamed from getCamelContext() to getContext(). Looking
at the exception, it looks like you have some code that was compiled
with Camel 1.3 and you're now running it on Camel 1.4. Make sure you
have changed every single reference to Camel 1.3 with Camel 1.4 SNAPSHOT
-- just use mvn -X clean install jbi:servicemix to check out classpaths
and dependencies used. I was actually just creating a JIRA issue to
re-add the missing methods and mark them deprecated instead, just to
avoid this particular problem...
Gert
John MIPIH wrote:
> Thanks a lot for your quick answer, I am going nut with this issue.
>
> I changed my camel-context (logs are now before to:jbi...) and enabled
> logging on my CXF web service. The log shows that camel sends an empty soap
> enveloppe to my web service when content-based routing is activated.
>
> As you recommended I tried to use servicemix 3.3-SNAPSHOT and Camel
> 1.4-SNAPSHOT. I changed all my pom's to have
>
> <servicemix-version>3.3-SNAPSHOT</servicemix-version>
> <camel-version>1.4-SNAPSHOT</camel-version>
>
> I launch my SA using "mvn clean install jbi:servicemix", deploying is fine
> but when I send a message to camel I have :
>
> java.lang.NoSuchMethodError:
> org.apache.camel.Endpoint.getCamelContext()Lorg/apache/camel/CamelContext;
> at
> org.apache.servicemix.camel.CamelJbiEndpoint.handleActiveProviderExchange(CamelJbiEndpoint.java:100)
> at
> org.apache.servicemix.camel.CamelJbiEndpoint.process(CamelJbiEndpoint.java:74)
> at
> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:582)
> at
> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:533)
> at
> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:487)
> at
> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
> at
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
> at
> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
> at
> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
> at
> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
> 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)
> 2008-06-23 14:40:30,028 [btpool1-1 ] WARN jetty
> - /ProcessusAdmissionConsumer/
> java.lang.IllegalStateException: Exchange not found
> at
> org.apache.servicemix.http.processors.ConsumerProcessor.process(ConsumerProcessor.java:190)
> at
> org.apache.servicemix.http.HttpBridgeServlet.doPost(HttpBridgeServlet.java:71)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
> at
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
> at
> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:722)
> at
> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206)
> at
> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
> at
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
> at org.mortbay.jetty.Server.handle(Server.java:324)
> at
> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
> at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:374)
> at
> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
> at
> org.mortbay.jetty.nio.SelectChannelConnector$RetryContinuation.run(SelectChannelConnector.java:506)
> at
> org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)
>
>
> Any idea ?
>
>
>
>
> Gert Vanthienen wrote:
>
>> L.S.,
>>
>> If you put the <to uri="log:..."> after the routing step to CXF in your
>> camel file, you implicitly create a pipeline that first sends an in-out
>> exchange to CXF and afterwards logs the out message from the CXF service
>> call, that's why you see the StaxSource at that point. To see what
>> Camel is sending to the endpoint, you'll need to add a <to uri="log...">
>> before the jbi:endpoint.
>>
>> Could you enable DEBUG logging to see what the MessageExchanges going
>> to/from your CXF endpoints look like? You probably want to get the
>> latest SNAPSHOT version of the servicemix-camel component in ServiceMix
>> as well because it has some fixes with regards to MEP processing you're
>> going to need for this scenario to work.
>>
>> Regards,
>>
>> Gert
>>
>> John MIPIH wrote:
>>
>>> Hello,
>>>
>>> Here is my camel config file :
>>>
>>> <camelContext xmlns="http://activemq.apache.org/camel/schema/spring">
>>> <route>
>>> <from
>>> uri="jbi:endpoint:urn:fr:mipih:poc:soa:Routage:RouteVersAdmission"/>
>>> <to uri="log:Before-routing"/>
>>> <choice>
>>> <when>
>>> <xpath>.//prenom = 'John'</xpath>
>>> <to
>>> uri="jbi:endpoint:urn:fr:mipih:poc:soa:ProcessusAdmissionImplService:ProcessusAdmissionImplPort?mep=in-out"/>
>>> <to uri="log:Routage-vers-reference"/>
>>> </when>
>>> <otherwise>
>>> <to
>>> uri="jbi:endpoint:urn:fr:mipih:poc:soa:ProcessusAdmissionImplBisService:ProcessusAdmissionImplBisPort?mep=in-out"/>
>>> <to uri="log:Routage-vers-convergence"/>
>>> </otherwise>
>>> </choice>
>>> </route>
>>> </camelContext>
>>>
>>>
>>> When an incoming message comes I get in the console :
>>>
>>> 2008-06-23 11:27:07,892 [-camel-thread-1] INFO Avant-routage -
>>> Exchange[JbiMessage:
>>> org.apache.servicemix.jbi.messaging.NormalizedMessageImpl@2f1622{properties:
>>> {}}]
>>> 2008-06-23 11:27:08,282 [-camel-thread-1] INFO Routage-vers-convergence
>>> -
>>> Exchange[Message: org.apache.servicemix.jbi.jaxp.StaxSource@1db8f3a]
>>>
>>> or
>>>
>>> 2008-06-23 11:27:16,048 [-camel-thread-4] INFO Avant-routage -
>>> Exchange[JbiMessage:
>>> org.apache.servicemix.jbi.messaging.NormalizedMessageImpl@193229{properties:
>>> {}}]
>>> 2008-06-23 11:27:16,079 [-camel-thread-4] INFO Routage-vers-reference -
>>> Exchange[Message: org.apache.servicemix.jbi.jaxp.StaxSource@1ace672]
>>>
>>> according to the message content (so the routing works fine !)
>>>
>>> This is good but the target service (cxf webservice) receives a bad
>>> message
>>> (nullpointer exception). Why do the message change between my first log
>>> and
>>> the second from NormalizedMessage to StaxSource ? The problem is this
>>> change
>>> because when I change my camel context to :
>>>
>>> <camelContext xmlns="http://activemq.apache.org/camel/schema/spring">
>>> <route>
>>> <from
>>> uri="jbi:endpoint:urn:fr:mipih:poc:soa:Routage:RouteVersAdmission"/>
>>> <to
>>> uri="jbi:endpoint:urn:fr:mipih:poc:soa:ProcessusAdmissionImplBisService:ProcessusAdmissionImplBisPort?mep=in-out"/>
>>> </route>
>>> </camelContext>
>>>
>>> everything works fine (but no routing...)
>>>
>>>
>>>
>>>
>>>
>>
>> -----
>> ---
>> Gert Vanthienen
>> http://www.anova.be
>>
>>
>
>
Re: Content Based Routing with Camel
Posted by John MIPIH <wo...@free.fr>.
Thanks a lot for your quick answer, I am going nut with this issue.
I changed my camel-context (logs are now before to:jbi...) and enabled
logging on my CXF web service. The log shows that camel sends an empty soap
enveloppe to my web service when content-based routing is activated.
As you recommended I tried to use servicemix 3.3-SNAPSHOT and Camel
1.4-SNAPSHOT. I changed all my pom's to have
<servicemix-version>3.3-SNAPSHOT</servicemix-version>
<camel-version>1.4-SNAPSHOT</camel-version>
I launch my SA using "mvn clean install jbi:servicemix", deploying is fine
but when I send a message to camel I have :
java.lang.NoSuchMethodError:
org.apache.camel.Endpoint.getCamelContext()Lorg/apache/camel/CamelContext;
at
org.apache.servicemix.camel.CamelJbiEndpoint.handleActiveProviderExchange(CamelJbiEndpoint.java:100)
at
org.apache.servicemix.camel.CamelJbiEndpoint.process(CamelJbiEndpoint.java:74)
at
org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:582)
at
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:533)
at
org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:487)
at
org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
at
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
at
org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
at
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
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)
2008-06-23 14:40:30,028 [btpool1-1 ] WARN jetty
- /ProcessusAdmissionConsumer/
java.lang.IllegalStateException: Exchange not found
at
org.apache.servicemix.http.processors.ConsumerProcessor.process(ConsumerProcessor.java:190)
at
org.apache.servicemix.http.HttpBridgeServlet.doPost(HttpBridgeServlet.java:71)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:722)
at
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206)
at
org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
at org.mortbay.jetty.Server.handle(Server.java:324)
at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:374)
at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
at
org.mortbay.jetty.nio.SelectChannelConnector$RetryContinuation.run(SelectChannelConnector.java:506)
at
org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)
Any idea ?
Gert Vanthienen wrote:
>
> L.S.,
>
> If you put the <to uri="log:..."> after the routing step to CXF in your
> camel file, you implicitly create a pipeline that first sends an in-out
> exchange to CXF and afterwards logs the out message from the CXF service
> call, that's why you see the StaxSource at that point. To see what
> Camel is sending to the endpoint, you'll need to add a <to uri="log...">
> before the jbi:endpoint.
>
> Could you enable DEBUG logging to see what the MessageExchanges going
> to/from your CXF endpoints look like? You probably want to get the
> latest SNAPSHOT version of the servicemix-camel component in ServiceMix
> as well because it has some fixes with regards to MEP processing you're
> going to need for this scenario to work.
>
> Regards,
>
> Gert
>
> John MIPIH wrote:
>> Hello,
>>
>> Here is my camel config file :
>>
>> <camelContext xmlns="http://activemq.apache.org/camel/schema/spring">
>> <route>
>> <from
>> uri="jbi:endpoint:urn:fr:mipih:poc:soa:Routage:RouteVersAdmission"/>
>> <to uri="log:Before-routing"/>
>> <choice>
>> <when>
>> <xpath>.//prenom = 'John'</xpath>
>> <to
>> uri="jbi:endpoint:urn:fr:mipih:poc:soa:ProcessusAdmissionImplService:ProcessusAdmissionImplPort?mep=in-out"/>
>> <to uri="log:Routage-vers-reference"/>
>> </when>
>> <otherwise>
>> <to
>> uri="jbi:endpoint:urn:fr:mipih:poc:soa:ProcessusAdmissionImplBisService:ProcessusAdmissionImplBisPort?mep=in-out"/>
>> <to uri="log:Routage-vers-convergence"/>
>> </otherwise>
>> </choice>
>> </route>
>> </camelContext>
>>
>>
>> When an incoming message comes I get in the console :
>>
>> 2008-06-23 11:27:07,892 [-camel-thread-1] INFO Avant-routage -
>> Exchange[JbiMessage:
>> org.apache.servicemix.jbi.messaging.NormalizedMessageImpl@2f1622{properties:
>> {}}]
>> 2008-06-23 11:27:08,282 [-camel-thread-1] INFO Routage-vers-convergence
>> -
>> Exchange[Message: org.apache.servicemix.jbi.jaxp.StaxSource@1db8f3a]
>>
>> or
>>
>> 2008-06-23 11:27:16,048 [-camel-thread-4] INFO Avant-routage -
>> Exchange[JbiMessage:
>> org.apache.servicemix.jbi.messaging.NormalizedMessageImpl@193229{properties:
>> {}}]
>> 2008-06-23 11:27:16,079 [-camel-thread-4] INFO Routage-vers-reference -
>> Exchange[Message: org.apache.servicemix.jbi.jaxp.StaxSource@1ace672]
>>
>> according to the message content (so the routing works fine !)
>>
>> This is good but the target service (cxf webservice) receives a bad
>> message
>> (nullpointer exception). Why do the message change between my first log
>> and
>> the second from NormalizedMessage to StaxSource ? The problem is this
>> change
>> because when I change my camel context to :
>>
>> <camelContext xmlns="http://activemq.apache.org/camel/schema/spring">
>> <route>
>> <from
>> uri="jbi:endpoint:urn:fr:mipih:poc:soa:Routage:RouteVersAdmission"/>
>> <to
>> uri="jbi:endpoint:urn:fr:mipih:poc:soa:ProcessusAdmissionImplBisService:ProcessusAdmissionImplBisPort?mep=in-out"/>
>> </route>
>> </camelContext>
>>
>> everything works fine (but no routing...)
>>
>>
>>
>>
>
>
>
> -----
> ---
> Gert Vanthienen
> http://www.anova.be
>
--
View this message in context: http://www.nabble.com/Content-Based-Routing-with-Camel-tp18065614p18067096.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: Content Based Routing with Camel
Posted by Gert Vanthienen <ge...@skynet.be>.
L.S.,
If you put the <to uri="log:..."> after the routing step to CXF in your
camel file, you implicitly create a pipeline that first sends an in-out
exchange to CXF and afterwards logs the out message from the CXF service
call, that's why you see the StaxSource at that point. To see what
Camel is sending to the endpoint, you'll need to add a <to uri="log...">
before the jbi:endpoint.
Could you enable DEBUG logging to see what the MessageExchanges going
to/from your CXF endpoints look like? You probably want to get the
latest SNAPSHOT version of the servicemix-camel component in ServiceMix
as well because it has some fixes with regards to MEP processing you're
going to need for this scenario to work.
Regards,
Gert
John MIPIH wrote:
> Hello,
>
> Here is my camel config file :
>
> <camelContext xmlns="http://activemq.apache.org/camel/schema/spring">
> <route>
> <from
> uri="jbi:endpoint:urn:fr:mipih:poc:soa:Routage:RouteVersAdmission"/>
> <to uri="log:Before-routing"/>
> <choice>
> <when>
> <xpath>.//prenom = 'John'</xpath>
> <to
> uri="jbi:endpoint:urn:fr:mipih:poc:soa:ProcessusAdmissionImplService:ProcessusAdmissionImplPort?mep=in-out"/>
> <to uri="log:Routage-vers-reference"/>
> </when>
> <otherwise>
> <to
> uri="jbi:endpoint:urn:fr:mipih:poc:soa:ProcessusAdmissionImplBisService:ProcessusAdmissionImplBisPort?mep=in-out"/>
> <to uri="log:Routage-vers-convergence"/>
> </otherwise>
> </choice>
> </route>
> </camelContext>
>
>
> When an incoming message comes I get in the console :
>
> 2008-06-23 11:27:07,892 [-camel-thread-1] INFO Avant-routage -
> Exchange[JbiMessage:
> org.apache.servicemix.jbi.messaging.NormalizedMessageImpl@2f1622{properties:
> {}}]
> 2008-06-23 11:27:08,282 [-camel-thread-1] INFO Routage-vers-convergence -
> Exchange[Message: org.apache.servicemix.jbi.jaxp.StaxSource@1db8f3a]
>
> or
>
> 2008-06-23 11:27:16,048 [-camel-thread-4] INFO Avant-routage -
> Exchange[JbiMessage:
> org.apache.servicemix.jbi.messaging.NormalizedMessageImpl@193229{properties:
> {}}]
> 2008-06-23 11:27:16,079 [-camel-thread-4] INFO Routage-vers-reference -
> Exchange[Message: org.apache.servicemix.jbi.jaxp.StaxSource@1ace672]
>
> according to the message content (so the routing works fine !)
>
> This is good but the target service (cxf webservice) receives a bad message
> (nullpointer exception). Why do the message change between my first log and
> the second from NormalizedMessage to StaxSource ? The problem is this change
> because when I change my camel context to :
>
> <camelContext xmlns="http://activemq.apache.org/camel/schema/spring">
> <route>
> <from uri="jbi:endpoint:urn:fr:mipih:poc:soa:Routage:RouteVersAdmission"/>
> <to
> uri="jbi:endpoint:urn:fr:mipih:poc:soa:ProcessusAdmissionImplBisService:ProcessusAdmissionImplBisPort?mep=in-out"/>
> </route>
> </camelContext>
>
> everything works fine (but no routing...)
>
>
>
>