camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roman Kalukiewicz" <roman.kalukiew...@gmail.com>
Subject Re: Mix camel endpoint with jbi endpoint in camel routes ?
Date Fri, 30 May 2008 09:25:15 GMT
It looks (to me) that we miss one thing here.

To be ale to use JBI endpoints you need JBI servicemix-camel
component, don't you? Then you need to have Service Unit deployed to
this JBI component. Moreover you need camel jbi component (on a
classpath) so camel can resolve jbi prefix properly.

All those things have to be satisfied somehow in servicemix embedded
XML notation (in one big XML). I don't know how to do it, but it is
not so obvious as it looks from the very beginning.

Anyway your exception suggests that you don't have jbi component on
the classpath or there is no such endpoint (notice, that your service
namespace doesn't end with slash here, as the present one is a
separator between namespace and service name)
so you reference service {http://my.namespace.com}tracker - not
{http://my.namespace.com/}tracker.

Roman

2008/5/30 Sebastian Gomez <sage.es@gmail.com>:
> I get a NoSuchEndpointException. I've debugged it and I've seen that
> the CamelContext doesn't have my jbi endpoints (that, without
> declaring the camel context, work perfectly), only the camel ones, so
> when it looks through its endpoints it obviously doesn't find the one
> I need. The thing is, that when I use as the output uri a
> "log:org.apache.servicemix.samples.camel.ExampleCamelRoute" it works,
> so it must have something to do with camel and jbi I guess.
>
> I have this camel context defined:
>
> <sm:container id="jbi"
>          embedded="true">
> ...
> </sm:container>
>
> <camelContext autowireRouteBuilders="false" useJmx="true"
> xmlns="http://activemq.apache.org/camel/schema/spring">
>             <route>
>                <from uri="timer:myTimerEvent?fixedRate=true" />
>                <to uri="jbi:service:http://my.namespace.com/tracker"/>
>        </route>
> </camelContext>
>
> And this is the stack trace:
>
> 2008-05-30 09:36:56,359 ERROR
> [org.springframework.web.context.ContextLoader] - Context
> initialization failed
> org.apache.camel.NoSuchEndpointException: No endpoint could be found
> for: jbi:service:http://my.namespace.com/tracker
>        at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:54)
>        at org.apache.camel.model.RouteType.resolveEndpoint(RouteType.java:92)
>        at org.apache.camel.impl.RouteContext.resolveEndpoint(RouteContext.java:95)
>        at org.apache.camel.impl.RouteContext.resolveEndpoint(RouteContext.java:104)
>        at org.apache.camel.model.ToType.resolveEndpoint(ToType.java:78)
>        at org.apache.camel.model.ToType.createProcessor(ToType.java:72)
>        at org.apache.camel.model.ProcessorType.makeProcessor(ProcessorType.java:1387)
>        at org.apache.camel.model.ProcessorType.addRoutes(ProcessorType.java:95)
>        at org.apache.camel.model.RouteType.addRoutes(RouteType.java:189)
>        at org.apache.camel.model.RouteType.addRoutes(RouteType.java:83)
>        at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:438)
>        at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:430)
>        at org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:148)
>        at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:47)
>        at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:102)
>        at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:77)
>        at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
>        at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:75)
>        at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:246)
>        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:355)
>        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:244)
>        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187)
>        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
>        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
>        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4350)
>        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
>        at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
>        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
>        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
>        at org.apache.catalina.core.StandardService.start(StandardService.java:516)
>        at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
>        at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:585)
>        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
>        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
>
>
> On Thu, May 29, 2008 at 8:15 PM, Guillaume Nodet <gnodet@gmail.com> wrote:
>> I don't think this has anything to do with the problem.
>> Camel can be used with an embedded configuration without problems.
>> What did you try and what errors did you get ?
>>
>> On Thu, May 29, 2008 at 7:13 PM, Sebastian Gomez <sage.es@gmail.com> wrote:
>>> Does this mean that it is impossible to call jbi endpoints in an
>>> embedded servicemix configuration? Because I can't find how to declare
>>> the camel context inside the jbi container. If it is possible, could
>>> you show me how it would be done please?
>>>
>>> Thanks in advance.
>>>
>>> On Fri, Apr 11, 2008 at 5:33 PM, James Strachan
>>> <james.strachan@gmail.com> wrote:
>>>> Agreed. The only real requirement when mixing JBI and camel endpoints
>>>> is that the Camel route must be deployed inside a JBI container at the
>>>> time - i.e. running inside a servicemix-camel Service Unit to be able
>>>> to invoke JBI endpoints.
>>>>
>>>> Also its worth understanding that every invoke of a JBI endpoint
>>>> involves message normalization (conversion to/from XML etc)
>>>>
>>>> On 11/04/2008, Jonathan Anstey <janstey@gmail.com> wrote:
>>>>> You *must* be able to do this... :) you may have to use ServiceMix though
as
>>>>> the JBI provider.
>>>>>
>>>>>  This is a good example of such a case:
>>>>> http://servicemix.apache.org/34-exchanging-messages-with-other-jbi-services.html
>>>>>
>>>>>  Cheers,
>>>>>  Jon
>>>>>
>>>>>
>>>>>  cmoulliard wrote:
>>>>>
>>>>> > Hi,
>>>>> >
>>>>> > I have made a test without success but to be sure I prefer to ask
the
>>>>> > question. Can I mix in camel routes camel endpoint with jbi endpoint
?
>>>>> >
>>>>> > ex:
>>>>> >
>>>>> > from(file:///c:/temp/test)
>>>>> > .to("log:Message received")
>>>>> > .to("jbi:endpoint:urn:jms-queue");
>>>>> >
>>>>> > Remark : the jbi endpoint is a jms-queue.
>>>>> >
>>>>> > Additional : Does it make sense to mix endpoints of Camel with JBI
?
>>>>> >
>>>>> > Regards,
>>>>> >
>>>>> > Charles
>>>>> >
>>>>> >
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> James
>>>> -------
>>>> http://macstrac.blogspot.com/
>>>>
>>>> Open Source Integration
>>>> http://open.iona.com
>>>>
>>>
>>
>>
>>
>> --
>> Cheers,
>> Guillaume Nodet
>> ------------------------
>> Blog: http://gnodet.blogspot.com/
>>
>

Mime
View raw message