camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (Resolved) (JIRA)" <>
Subject [jira] [Resolved] (CAMEL-5036) Camel route with bean element sends on startup invalid message to target route that is represented by a proxy who exposes route
Date Fri, 24 Feb 2012 15:44:48 GMT


Claus Ibsen resolved CAMEL-5036.

       Resolution: Fixed
    Fix Version/s: 2.10.0

Changed the toString to avoid calling toString on the bean
> Camel route with bean element sends on startup invalid message to target route that is
represented by a proxy who exposes route
> -------------------------------------------------------------------------------------------------------------------------------
>                 Key: CAMEL-5036
>                 URL:
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.2.0
>            Reporter: Stefan Burkard
>            Assignee: Claus Ibsen
>             Fix For: 2.9.1, 2.10.0
> I expose a Camel route with a direct endpoint defined in an OSGi bundle with the <camel:proxy>
and <osgi:service> tags. The reason for this is to be able to call this direct-route
in other routes (defined in other bundles) as a "sub-route" directly as bean [.bean(routeproxy,
"method")]. This works as expected.
> But on route startup the toString method is called on the route (for a description) which
is propagated to the elements of the route. Therefore my bean-element (which is the direct-route-proxy)
receives the toString call and the CamelInvocationHandler converts this toString call to a
message and sends it to the direct-route. This more or less empty message is of course not
valid for the target route and produces an error on bundle startup.  
> Shouldn't the toString call be suppressed by the proxy, since toString is not part of
the Interface the proxy represents? Or is my approach a not recommended or problematic approach?
> Parts of stacktrace to show the way from route startup to the produced message
> => route receives "empty" message
> [omitted]
> 	at
> 	at org.apache.camel.component.bean.CamelInvocationHandler.invoke(
> 	at $Proxy568.toString(Unknown Source)
> 	at sun.reflect.GeneratedMethodAccessor406.invoke(Unknown Source)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> 	at java.lang.reflect.Method.invoke(
> => toString call is converted to message and sent to route
> [omitted]
> 	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
> 	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(
> 	at $Proxy583.toString(Unknown Source)
> 	at org.apache.camel.component.bean.ConstantBeanHolder.toString(
> => toString called on bean-element in route (bean is a proxy for a route) 
> [omitted]
> 	at java.lang.String.valueOf(
> 	at java.lang.StringBuilder.append(
> 	at org.apache.camel.impl.EventDrivenConsumerRoute.toString(
> 	at<init>(
> 	at
> 	at org.apache.camel.impl.RouteService.doStart(
> => Route startup

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message