Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1D52C11D4F for ; Fri, 25 Jul 2014 03:43:35 +0000 (UTC) Received: (qmail 1252 invoked by uid 500); 25 Jul 2014 03:43:34 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 1201 invoked by uid 500); 25 Jul 2014 03:43:34 -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 1180 invoked by uid 99); 25 Jul 2014 03:43:34 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Jul 2014 03:43:34 +0000 X-ASF-Spam-Status: No, hits=1.6 required=5.0 tests=FREEMAIL_REPLY,RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of willem.jiang@gmail.com designates 209.85.192.182 as permitted sender) Received: from [209.85.192.182] (HELO mail-pd0-f182.google.com) (209.85.192.182) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Jul 2014 03:43:32 +0000 Received: by mail-pd0-f182.google.com with SMTP id fp1so4747297pdb.41 for ; Thu, 24 Jul 2014 20:43:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :content-type:content-transfer-encoding:content-disposition; bh=HctcdcaRMFwxjAT0NtMOjDIOmZ8sM95S+lGefPi8peA=; b=gzly960Vw6hcuvLU+39p8yWEqo/kC5zJXqcX5mEA4GiUjxuuNhSgzizCxMMEVc0XY8 VIp5avWXGpdBMkYkix01hwlkW15cRZkyTs9CYiQabaPXzLeAvj4XCjIa2MBpDnQIYMIU OP+VOhtRzoZU3CXb3hwYOZJ3dfLQYQtJAtoj0oVLhVBgN7OKk4ixhH70zNBQKWF1c8I/ c+lr2d2QsrZZiTojladZrxwQggbfncWZETQOF0YSJgdZC0mzADe8lyv+RmRwvaN+I7gF wwPoIF9NWvabjIP1Sb+UqQM2Hjj3DerKb/WMtUDjbHHJkOIHVwUuRAv0ZWw9qf9MvnIJ wKIg== X-Received: by 10.66.241.39 with SMTP id wf7mr15649102pac.58.1406259786763; Thu, 24 Jul 2014 20:43:06 -0700 (PDT) Received: from localhost ([111.193.234.135]) by mx.google.com with ESMTPSA id pl10sm7197158pbb.56.2014.07.24.20.43.00 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 24 Jul 2014 20:43:01 -0700 (PDT) Date: Fri, 25 Jul 2014 11:42:53 +0800 From: Willem Jiang To: users@camel.apache.org Message-ID: In-Reply-To: <1406160060867-5754319.post@n5.nabble.com> References: <1406160060867-5754319.post@n5.nabble.com> Subject: Re: Set providers property on uri for cxfrs endpoint X-Mailer: Airmail (237) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Virus-Checked: Checked by ClamAV on apache.org Provides can only takes a list as the parameter, if you just have one pro= vider you can use provider option instead of providers option. I also find something wrong in your spring configuration file. Please don= =E2=80=99t set the bean id with the string which starts with =E2=80=9C=23= =E2=80=9D. Camel treats the string which starts with =E2=80=9C=23=E2=80=9D= as a object instance reference, it uses the rest part of the string to l= ook up the instance from camel registry.=C2=A0 =C2=A0 -- =20 Willem Jiang Red Hat, Inc. Web: http://www.redhat.com Blog: http://willemjiang.blogspot.com (English) http://jnn.iteye.com (Chinese) Twitter: willemjiang =20 Weibo: =E5=A7=9C=E5=AE=81willem On July 24, 2014 at 8:01:27 AM, cdryst (cdryst=40gmail.com) wrote: > Hello I'm trying to set the providers property for the endpoint of my r= est > service: > =20 > =20 > > uri=3D=22cxfrs:///restEp=3FresourceClasses=3Dcom.services.RestService= Int&bindingStyle=3DSimpleConsumer&providers=3D=23corsProvider=22/> =20 > . > . > . > =20 > =20 > I've defined a bean to enable Cors on the service: > =20 > > class=3D=22org.apache.cxf.rs.security.cors.CrossOriginResourceSharing= =46ilter=22 =20 > /> > =20 > When I run the application it gives me the error: > =20 > Caused By: java.lang.IllegalArgumentException: Could not find a suitabl= e > setter for property: providers as there isn't a setter method with same= > type: java.lang.String nor type conversion possible: No type converter > available to convert from type: java.lang.String to the required type: > java.util.List with value =23corsProvider > at > org.apache.camel.util.IntrospectionSupport.setProperty(IntrospectionSup= port.java:560) =20 > at > org.apache.camel.util.IntrospectionSupport.setProperty(IntrospectionSup= port.java:570) =20 > at > org.apache.camel.util.IntrospectionSupport.setProperties(IntrospectionS= upport.java:454) =20 > at > org.apache.camel.util.EndpointHelper.setProperties(EndpointHelper.java:= 249) =20 > at > org.apache.camel.impl.DefaultComponent.setProperties(DefaultComponent.j= ava:272) =20 > Truncated. see log file for complete stacktrace > > > =20 > I already notice that I must put a List instead a Cors bean but it alwa= ys > read it as a String so it has the same effect, > =20 > How do I inject it then=3F will it fix my Cors problem anyway=3F > =20 > Thanks > =20 > =20 > =20 > =20 > =20 > =20 > -- > View this message in context: http://camel.465427.n5.nabble.com/Set-pro= viders-property-on-uri-for-cxfrs-endpoint-tp5754319.html =20 > Sent from the Camel - Users mailing list archive at Nabble.com. > =20