Return-Path: Delivered-To: apmail-activemq-camel-user-archive@locus.apache.org Received: (qmail 72723 invoked from network); 30 May 2008 13:52:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 May 2008 13:52:07 -0000 Received: (qmail 6448 invoked by uid 500); 30 May 2008 13:52:09 -0000 Delivered-To: apmail-activemq-camel-user-archive@activemq.apache.org Received: (qmail 6430 invoked by uid 500); 30 May 2008 13:52:09 -0000 Mailing-List: contact camel-user-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: camel-user@activemq.apache.org Delivered-To: mailing list camel-user@activemq.apache.org Received: (qmail 6419 invoked by uid 99); 30 May 2008 13:52:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 May 2008 06:52:09 -0700 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of freeman.fang@gmail.com designates 209.85.198.248 as permitted sender) Received: from [209.85.198.248] (HELO rv-out-0708.google.com) (209.85.198.248) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 May 2008 13:51:19 +0000 Received: by rv-out-0708.google.com with SMTP id f25so4703023rvb.26 for ; Fri, 30 May 2008 06:51:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; bh=43GbmXZFEpPwpPVpv8jF7OYUy8MB1l/P5CV8d7JGru0=; b=WvGXiZr511FfI/a3cLVMVV0/H3B1qPVYEuC43U34JhO7HWvlWZoZdhyBvaDNNobKSDKgu2ZxTQChTSYthhS4JsKFyj/rCG4CIEWTlU97E3zaApTtp973MjNOg9uiUYGZyV4JF+1tnv65M5G82nyIRA/VQe1vQFGEMy+l/JVX0ok= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; b=cWfkhdmVqMwXgFcnEMk2tiG2727aoravDvvEvDw+fOTpIgO/IaEc2LOresVVdKxeEcTL2X9TaEdDQ0ZIzrSXQ6AuUnnexyayxEn2MMmM9VPdmmXOmqOkO8JJA/cIPOJ4cvwHPKE/qPlN9475bHZyp8gnUtyBic3Po+b/pg+JBJg= Received: by 10.140.127.13 with SMTP id z13mr404548rvc.194.1212155495002; Fri, 30 May 2008 06:51:35 -0700 (PDT) Received: from ?192.168.2.110? ( [221.218.199.184]) by mx.google.com with ESMTPS id c20sm2922120rvf.1.2008.05.30.06.51.32 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 30 May 2008 06:51:34 -0700 (PDT) Message-ID: <484005D7.1020107@gmail.com> Date: Fri, 30 May 2008 21:49:11 +0800 From: Freeman Fang User-Agent: Thunderbird 1.5.0.2 (X11/20060524) MIME-Version: 1.0 To: camel-user@activemq.apache.org Subject: Re: "cxf" name conflict in the spring context References: <47B12CB0.50903@gmail.com> <47B18BB1.60902@gmail.com> <483FCB64.8070107@gmail.com> <483FEF44.1070804@gmail.com> In-Reply-To: <483FEF44.1070804@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi Willem, Thanks for the quick fix. I will check it and let you know Cheers Freeman Willem Jiang wrote: > Hi Freeman , > > Thanks for point it out.I just checked the code. The fixing just > works for DefaultComponentResolver, we are missing the same thing on > the OsgiComponentResolver. > I just did a quick fix for it. Could you check it out ;) > > Willem > > Freeman Fang wrote: >> Hi Willem, >> >> Is this issue get resolved? >> >> When I try to use camel-cxf component in smx4, I still get exceptions >> like >> Exception in thread "SpringOsgiExtenderThread-9" >> org.apache.camel.ResolveEndpointFailedException: Failed to resolve >> endpoint: cxf:bean:routerEndpoint due to: >> org.apache.camel.RuntimeCamelException: Could not auto create >> component: cxf >> at >> org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:262) >> >> at >> org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:52) >> >> at >> org.apache.camel.model.RouteType.resolveEndpoint(RouteType.java:90) >> at >> org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:98) >> >> at >> org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:104) >> >> at >> org.apache.camel.model.FromType.resolveEndpoint(FromType.java:67) >> at >> org.apache.camel.impl.DefaultRouteContext.getEndpoint(DefaultRouteContext.java:73) >> >> at org.apache.camel.model.RouteType.addRoutes(RouteType.java:204) >> at org.apache.camel.model.RouteType.addRoutes(RouteType.java:81) >> at >> org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:451) >> >> at >> org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:443) >> >> at >> org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:149) >> >> at >> org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:47) >> at >> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103) >> >> at >> org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78) >> >> at >> org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49) >> >> at >> org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:76) >> >> at >> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:275) >> >> at >> org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:737) >> >> at >> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.finishRefresh(AbstractDelegatedExecutionApplicationContext.java:271) >> >> at >> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:254) >> >> at >> org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:136) >> >> at java.lang.Thread.run(Thread.java:595) >> Caused by: org.apache.camel.RuntimeCamelException: Could not auto >> create component: cxf >> at >> org.apache.camel.impl.DefaultCamelContext.getComponent(DefaultCamelContext.java:149) >> >> at >> org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:233) >> >> ... 22 more >> Caused by: java.lang.IllegalArgumentException: Bean with name: cxf in >> registry is not a Component: org.apache.cxf.bus.CXFBusImpl@3ca56f >> at >> org.apache.camel.osgi.OsgiComponentResolver.resolveComponent(OsgiComponentResolver.java:167) >> >> at >> org.apache.camel.impl.DefaultCamelContext.getComponent(DefaultCamelContext.java:138) >> >> ... 23 more >> >> I guess it's same problem with this thread. I create jira [1] to >> track it. >> Btw, I'm using camel 1.4-SNAPSHOT >> [1]https://issues.apache.org/activemq/browse/CAMEL-563 >> >> Thanks >> >> Freeman >> >> Willem Jiang wrote: >>> Hi James, >>> >>> I agree to look up the component with URI schema and component type >>> to avoid getting the wrong bean instance from the Spring Application >>> context. >>> I went through the code and stack trace in the "Camel CXF Spring >>> Tomcat configuration" again, the exception is thrown from checking >>> the bean's type is not the instance of the Component. >>> >>> So the fixing could be more easier, if the bean's type is not match >>> with the component that we want , we just keep on searching the >>> component factory with the URI schema and do not throw the >>> IllegalArgumentException. >>> >>> In this way , we could still give a chance to user to override the >>> component schema definition in spring context. >>> >>> Willem >>> >>> James Strachan wrote: >>>> On 12/02/2008, Willem Jiang wrote: >>>> >>>>> Hi , >>>>> >>>>> In the thread "Camel CXF Spring Tomcat configuration" , Aswin told >>>>> us a >>>>> conflict of "cxf" between the camel-cxf component and CXF default >>>>> bus in >>>>> the same spring context. It will cause CXF internal component >>>>> injection >>>>> error. >>>>> >>>>> I think it is a common scenario when the user configure cxf >>>>> default bus >>>>> and setup the camel context in the same spring configuration file. To >>>>> avoid this conflict we need to rename the camel-cxf components >>>>> name or >>>>> rename the cxf default bus name. >>>>> >>>>> Since the CXF default bus use the "cxf" name for a long time, >>>>> lots of >>>>> internal components in CXF will search for the "cxf " bus for >>>>> dependency >>>>> injection, I suggest we rename the camel-cxf component name form >>>>> "cxf" >>>>> to "cxf_component" and we support to get the component with a >>>>> short name >>>>> "cxf" in the ComponentResolver implementor. >>>>> >>>>> In this way, we could still support user to use the URI like >>>>> "cxf://*" >>>>> to create the cxf endpoint. >>>>> >>>>> Any thoughts? >>>>> >>>> >>>> Its unfortunate :(. >>>> >>>> How about we fix the ComponentResolver so that if there's a bean >>>> called 'cxf' and its not a Component we just ignore it - writing some >>>> DEBUG logging that we ignore it; then look for scheme + "Component" >>>> instead. >>>> >>>> i.e. we look for "cxf" first, then if thats not a Component we look >>>> for "cxfComponent"? >>>> >>>> I was wondering BTW if we should change the ComponentResolver so that >>>> if it knew that the type of Component for "cxf" was >>>> "org.apache.camel.component.cxf.CxfComponent" we'd look to see if >>>> there was one single CxfComponent configured in the Spring context - >>>> and if there was just one then use that. >>>> >>>> i.e. so it wouldn't actually matter what the component was registered >>>> as. This would help fix issues like the recent thread on JMS >>>> transaction issues... >>>> http://www.nabble.com/Bug--to15351379s22882.html >>>> >>>> >>> >>> >> >> > >