Provides can only takes a list as the parameter, if you just have one provider you can use provider option instead of providers option.
I also find something wrong in your spring configuration file. Please don’t set the bean id with the string which starts with “#”. Camel treats the string which starts with “#” as a object instance reference, it uses the rest part of the string to look up the instance from camel registry. -- Willem Jiang Red Hat, Inc. Web: http://www.redhat.com Blog: http://willemjiang.blogspot.com (English) http://jnn.iteye.com (Chinese) Twitter: willemjiang Weibo: 姜宁willem On July 24, 2014 at 8:01:27 AM, cdryst ([email protected]) wrote: > Hello I'm trying to set the providers property for the endpoint of my rest > service: > > > > uri="cxfrs:///restEp?resourceClasses=com.services.RestServiceInt&bindingStyle=SimpleConsumer&providers=#corsProvider"/> > > > . > . > . > > > I've defined a bean to enable Cors on the service: > > > class="org.apache.cxf.rs.security.cors.CrossOriginResourceSharingFilter" > /> > > When I run the application it gives me the error: > > Caused By: java.lang.IllegalArgumentException: Could not find a suitable > 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 #corsProvider > at > org.apache.camel.util.IntrospectionSupport.setProperty(IntrospectionSupport.java:560) > > at > org.apache.camel.util.IntrospectionSupport.setProperty(IntrospectionSupport.java:570) > > at > org.apache.camel.util.IntrospectionSupport.setProperties(IntrospectionSupport.java:454) > > at > org.apache.camel.util.EndpointHelper.setProperties(EndpointHelper.java:249) > at > org.apache.camel.impl.DefaultComponent.setProperties(DefaultComponent.java:272) > > Truncated. see log file for complete stacktrace > > > > I already notice that I must put a List instead a Cors bean but it always > read it as a String so it has the same effect, > > How do I inject it then? will it fix my Cors problem anyway? > > Thanks > > > > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Set-providers-property-on-uri-for-cxfrs-endpoint-tp5754319.html > > Sent from the Camel - Users mailing list archive at Nabble.com. >
