Hello I'm trying to set the providers property for the endpoint of my rest
service:
<route id="restEndpoint">
<from
uri="cxfrs:///restEp?resourceClasses=com.services.RestServiceInt橪;bindingStyle=SimpleConsumer橪;providers=#corsProvider"/>
</route>
I've defined a bean to enable Cors on the service:
<bean id="#corsProvider"
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
service:
<route id="restEndpoint">
<from
uri="cxfrs:///restEp?resourceClasses=com.services.RestServiceInt橪;bindingStyle=SimpleConsumer橪;providers=#corsProvider"/>
</route>
I've defined a bean to enable Cors on the service:
<bean id="#corsProvider"
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