Hi

Can you check the trunk as I have committed a fix
https://issues.apache.org/activemq/browse/CAMEL-1811



On Wed, Jul 8, 2009 at 3:52 PM, Claus Ibsen<claus.ib...@gmail.com> wrote:
> On Wed, Jul 8, 2009 at 2:48 PM, Claus Ibsen<claus.ib...@gmail.com> wrote:
>> Hi
>>
>> I actually wonder how Spring would manage if you have 2 camel context
>> in spring application context and use this constructor wiring.
>> It would not be able to tell which camel context to wire? There are now 2.
> I have tested this and Spring will thrown an exception if there are
> more than 1 type.
>
> I am reverting the SpringInjector so it can do the constructor IoC.
> However you can get the CamelContext by implementing the interface
> then it also works if you have 2..n camel context in your application
> context.
>
> And if your route builder extends one of the camel classes then Camel
> will also IoC the context itself, so you can obtain it using
> getContext().
> No need to have it IoC in the constructor for the CamelContext.
>
>
>
>>
>> Using CamelContextAware will be able to provide you the correct
>> CamelContext as its the CamelContext itself that IoC this.
>>
>>
>>
>>
>> On Wed, Jul 8, 2009 at 7:46 AM, Claus Ibsen<claus.ib...@gmail.com> wrote:
>>> On Tue, Jul 7, 2009 at 11:58 PM, tfredrich<tfredr...@yahoo.com> wrote:
>>>>
>>>> Hi Claus,
>>>>
>>>> Thanks for your reply.  I downloaded and tried with the snapshot dated Tue
>>>> Jul 07 17:52:26 GMT+00:00 2009.  I got no love... :-(
>>>>
>>>> The SpringInjector is still attempting to instantiate the route builders
>>>> using the default constructor instead of auto-wiring using the constructor
>>>> that takes a CamelContext as a parameter.  If I use the previous revision 
>>>> of
>>>> SpringInjector (revision #752893) things appear OK as that revision calls
>>>> the createBean(type, autowireMode, dependencyCheck) API vs. simply
>>>> createBean(type).
>>>
>>> implement CamelContextAware and you should get the context injected
>>> with the setter.
>>>
>>> Can you post your route builder code?
>>>
>>>
>>>>
>>>> Perhaps there is another way to get the CamelContextFactoryBean to
>>>> (subsequently) auto-wire the route builders that I'm not seeing?
>>>>
>>>> Thanks,
>>>> --Todd
>>>>
>>>> Claus Ibsen-2 wrote:
>>>>>
>>>>> ...
>>>>>
>>>>> Can you try SNAPSHOT as we have fixed an issue with RouteBuilders not
>>>>> being fully post processed by Spring.
>>>>> See CAMEL-1663.
>>>>>
>>>>> ...
>>>>>
>>>>
>>>> --
>>>> View this message in context: 
>>>> http://www.nabble.com/CamelContext-No-Longer-Auto-Wires-Via-Package-Element--tp24363086p24382091.html
>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Claus Ibsen
>>> Apache Camel Committer
>>>
>>> Open Source Integration: http://fusesource.com
>>> Blog: http://davsclaus.blogspot.com/
>>> Twitter: http://twitter.com/davsclaus
>>>
>>
>>
>>
>> --
>> Claus Ibsen
>> Apache Camel Committer
>>
>> Open Source Integration: http://fusesource.com
>> Blog: http://davsclaus.blogspot.com/
>> Twitter: http://twitter.com/davsclaus
>>
>
>
>
> --
> Claus Ibsen
> Apache Camel Committer
>
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Reply via email to