Hi

Ah how does the code in your interceptor looks like. It could be its
constructor failing.

You can try with a empty implementation or try using the Tracer

getContext().addInterceptStrategy(new Tracer());

Tracer is shipped with Camel and it should work


On Tue, Jan 20, 2009 at 4:43 PM, Liav Ezer <[email protected]> wrote:
>
> Hi Ashwin,
>
> My processor works great - if i remove the
> getContext().addInterceptStrategy(new MyFromEndpointInterceptor()); line
> everything is smooth.
>
> Can you think of a reason why i get this exception?
>
> framework.beans.factory.BeanCreationException: Error creating bean with name
> 'camelContext': Invocation of init method failed;
> apache.camel.CamelContext.addInterceptStrategy(Lorg/apache/camel/spi/InterceptStrategy;)
>
> Every other Camel component (such as processor or producerTemplate) was fine
> untill i added the addInterceptStrategy API.
> (By the way, getContext() alone isn't crushing..)
>
> Maybe it's related to the fact i use esb-fuse-3.3.1.3 & not pure servicemix?
> (in regards to camel-core jar?!)
>
> This is my camel-context file:
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="http://www.springframework.org/schema/beans";
>       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>       xsi:schemaLocation="http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>       http://activemq.apache.org/camel/schema/spring
> http://activemq.apache.org/camel/schema/spring/camel-spring.xsd";>
>          <camelContext useJmx="true"
> xmlns="http://activemq.apache.org/camel/schema/spring";>
>            <package>com.liav.oxp.esb.poc</package>
>          </camelContext>
> </beans>
>
> Thanks.
>
> Ashwin Karpe wrote:
>>
>> Hi Liav,
>>
>> Have you checked the packages in the camel context block of the
>> camel-context.xml in the resources directory to see if the Camel processor
>> have been correctly defined.
>>
>> Cheers,
>>
>> Ashwin...
>>
>>
>> Liav Ezer wrote:
>>>
>>> Hi,
>>>
>>> I use servicemix-fuse 3.3.1.3 with Camel 1.4.
>>> In my Camel Builder i try to add interceptor & it's causing me an
>>> NoSuchMethodError.
>>>
>>> My configure method is:
>>>
>>> public void configure() throws Exception {
>>>
>>>       getContext().addInterceptStrategy(new MyFromEndpointInterceptor());
>>>       from("jbi:service:http://oxp/oXpInternalService";)
>>>       .process(new OXpServicesAuthenticationProcessor());
>>> }
>>>
>>> This is the context i use (i println it)
>>> org.apache.camel.spring.SpringCamelContext
>>>
>>> My exception is at deploy time:
>>>
>>> org.springframework.beans.factory.BeanCreationException: Error creating
>>> bean with name 'camel:beanPostProcessor': Cannot resolve reference to
>>> bean 'camel' while setting bean property 'camelContext'; nested exception
>>> is org.springframework.beans.factory.BeanCreationException: Error
>>> creating bean with name '
>>> camel': Invocation of init method failed; nested exception is
>>> java.lang.NoSuchMethodError:
>>> org.apache.camel.CamelContext.addInterceptStrategy(Lorg/apache/camel/spi/InterceptStrategy;)
>>>
>>> Thanks in advance,
>>> Liav.
>>>
>>>
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/Why-getContext%28%29.addInterceptStrategy-is-throwing-an-exception--tp21551665s22882p21565641.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/

Reply via email to