Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 35078 invoked from network); 21 Jan 2009 07:36:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Jan 2009 07:36:24 -0000 Received: (qmail 17605 invoked by uid 500); 21 Jan 2009 07:36:23 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 17585 invoked by uid 500); 21 Jan 2009 07:36:23 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 17574 invoked by uid 500); 21 Jan 2009 07:36:23 -0000 Delivered-To: apmail-activemq-camel-user@activemq.apache.org Received: (qmail 17571 invoked by uid 99); 21 Jan 2009 07:36:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Jan 2009 23:36:23 -0800 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Jan 2009 07:36:15 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1LPXcx-0007kQ-03 for camel-user@activemq.apache.org; Tue, 20 Jan 2009 23:35:55 -0800 Message-ID: <21578333.post@talk.nabble.com> Date: Tue, 20 Jan 2009 23:35:54 -0800 (PST) From: Liav Ezer To: camel-user@activemq.apache.org Subject: Re: Why getContext().addInterceptStrategy is throwing an exception? In-Reply-To: <21577945.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: liav.ezer@gmail.com References: <21551665.post@talk.nabble.com> <21561853.post@talk.nabble.com> <21565641.post@talk.nabble.com> <21577945.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org Hi Ashwin, Well i added the start as follows: public void configure() throws Exception { getContext().start(); getContext().addInterceptStrategy(new MyFromEndpointInterceptor()); from("jbi:service:http://oxp/oXpInternalService") .process(new OXpServicesAuthenticationProcessor()); } & i validated that i added the camel-core jar (1.4.0-fuse) to my classpath. Here is the dependency section in the pom.xml: org.apache.servicemix servicemix-camel ${servicemix-version} provided org.apache.servicemix servicemix-core ${servicemix-version} provided org.apache.camel camel-spring 1.4.0 org.apache.camel camel-core 1.4.0 test-jar test org.apache.camel camel-core 1.4.0 & still i get the same exception. I googled it & found something related: maybe you can check: https://issues.apache.org/activemq/browse/SM-1327 Here is my classpath - Maybe you can spot somehing: Thanks in advance: Ashwin Karpe wrote: > > Hi Liav, > > Have you add the code in the configure() method. The reason for this issue > can be one of two things > - The Camel listener has not been setup. This means the code is called > before context.start() > - The dependencies cannot be resolved (i.e the jar containing > org/apache/camel/spi/InterceptStrategy) is not on your build path. > > FUSE 3.3 has the same codebase as Servicemix and if you maven build the > camel-core and link it in your POM, it should work. > > Cheers, > > Ashwin... > > Liav Ezer 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: >> >> > 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"> >> > xmlns="http://activemq.apache.org/camel/schema/spring"> >> com.liav.oxp.esb.poc >> >> >> >> 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--tp21551665s22882p21578333.html Sent from the Camel - Users mailing list archive at Nabble.com.