camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: ClassCastException using cxf:bean
Date Thu, 24 May 2012 05:23:54 GMT
On Tue, May 22, 2012 at 9:58 AM, cgiera <> wrote:
> Willem.Jiang wrote
>> What's the problem ?
>> I don't think passing the bean object instance will introduce any
>> further issue into camel-jms and camel-jpa components.
> Perhaps I don't understand you correctly, but if i pass the object instance
> like
> I get problems with our whole implementation because the beans are only
> instantiated once.
> kind regards,
> Christoph
> --
> View this message in context:
> Sent from the Camel - Users mailing list archive at

When using .bean in the DSL, then the bean is looked up / created once
/ etc when the route is being initialized / started.
And thus there is no thread safe issue at runtime, as the beans is
already created.

When using bean with a class type, the bean is created once (eg
singleton scope).
And that is by design.

If you want prototype scope or something like that, then use a beanRef
and refer to a bean in a bean container that supports that such as
spring etc.

Claus Ibsen
CamelOne 2012 Conference, May 15-16, 2012:
Twitter: davsclaus, fusenews
Author of Camel in Action:

View raw message