[
https://issues.apache.org/jira/browse/CAMEL-9422?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Claus Ibsen resolved CAMEL-9422.
--------------------------------
Resolution: Not A Problem
> ServiceFactory of Cxf Endpoint is not working
> ---------------------------------------------
>
> Key: CAMEL-9422
> URL: https://issues.apache.org/jira/browse/CAMEL-9422
> Project: Camel
> Issue Type: Bug
> Components: camel-cxf
> Environment: karaf 3.0.2
> Reporter: Joseph Kampf
>
> I attempted to explicitly set the Service Factory as per the documentation
> found at: http://cxf.apache.org/docs/jax-ws-configuration.html.
> {code:xml}
> <cxf:cxfEndpoint id="cxfBeanFromEndpoint"
> address="${esbservices.proxy.baseurl}/path"
> serviceClass="MyPortClass"
> endpointName="s:completePort" serviceName="s:aria_complete_api"
> wsdlURL="MyWsdl.wsdl"
> xmlns:s="myNamespace">
> <cxf:inInterceptors>
> <bean
> class="org.apache.cxf.interceptor.LoggingInInterceptor" />
> </cxf:inInterceptors>
> <cxf:outInterceptors>
> <bean
> class="org.apache.cxf.interceptor.LoggingOutInterceptor" />
> </cxf:outInterceptors>
> <cxf:serviceFactory>
> <bean
> class="org.apache.cxf.jaxws.JaxWsServerFactoryBean" />
> </cxf:serviceFactory>
> </cxf:cxfEndpoint>
> {code}
> When I deploy the bundle I get:
> {code}
> karaf@root()> Exception in thread "SpringOsgiExtenderThread-50"
> org.apache.camel.RuntimeCamelException:
> org.apache.camel.FailedToCreateRouteException: Failed to create route
> aria.esbservices.complete.soap.proxy:
> Route(aria.esbservices.complete.soap.proxy)[[From[cxf:bean:a... because of
> Failed to resolve endpoint: cxf://bean:cxfBeanFromEndpoint due to: Cannot
> lookup: cxfBeanFromEndpoint from registry:
> org.apache.camel.spring.spi.ApplicationContextRegistry@51cb33dc with expected
> type: class org.apache.camel.component.cxf.CxfEndpoint due: Error creating
> bean with name 'cxfBeanFromEndpoint': Error setting property values; nested
> exception is org.springframework.beans.NotWritablePropertyException: Invalid
> property 'serviceFactory' of bean class
> [org.apache.camel.component.cxf.CxfSpringEndpoint]: Bean property
> 'serviceFactory' is not writable or has an invalid setter method. Does the
> parameter type of the setter match the return type of the getter?
> at
> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1363)
> at
> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:122)
> at
> org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:318)
> at
> org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:96)
> at
> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334)
> at
> org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:950)
> at
> org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.finishRefresh(AbstractOsgiBundleApplicationContext.java:235)
> at
> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:358)
> at
> org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
> at
> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)
> at
> org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132)
> at java.lang.Thread.run(Thread.java:745)
> Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create
> route aria.esbservices.complete.soap.proxy:
> Route(aria.esbservices.complete.soap.proxy)[[From[cxf:bean:a... because of
> Failed to resolve endpoint: cxf://bean:cxfBeanFromEndpoint due to: Cannot
> lookup: cxfBeanFromEndpoint from registry:
> org.apache.camel.spring.spi.ApplicationContextRegistry@51cb33dc with expected
> type: class org.apache.camel.component.cxf.CxfEndpoint due: Error creating
> bean with name 'cxfBeanFromEndpoint': Error setting property values; nested
> exception is org.springframework.beans.NotWritablePropertyException: Invalid
> property 'serviceFactory' of bean class
> [org.apache.camel.component.cxf.CxfSpringEndpoint]: Bean property
> 'serviceFactory' is not writable or has an invalid setter method. Does the
> parameter type of the setter match the return type of the getter?
> at
> org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:180)
> at
> org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:780)
> at
> org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:2068)
> at
> org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1816)
> at
> org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1683)
> at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
> at
> org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1651)
> at
> org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:254)
> at
> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:120)
> ... 10 more
> Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve
> endpoint: cxf://bean:cxfBeanFromEndpoint due to: Cannot lookup:
> cxfBeanFromEndpoint from registry:
> org.apache.camel.spring.spi.ApplicationContextRegistry@51cb33dc with expected
> type: class org.apache.camel.component.cxf.CxfEndpoint due: Error creating
> bean with name 'cxfBeanFromEndpoint': Error setting property values; nested
> exception is org.springframework.beans.NotWritablePropertyException: Invalid
> property 'serviceFactory' of bean class
> [org.apache.camel.component.cxf.CxfSpringEndpoint]: Bean property
> 'serviceFactory' is not writable or has an invalid setter method. Does the
> parameter type of the setter match the return type of the getter?
> at
> org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:534)
> at
> org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:71)
> at
> org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:190)
> at
> org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:106)
> at
> org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:112)
> at
> org.apache.camel.model.FromDefinition.resolveEndpoint(FromDefinition.java:72)
> at
> org.apache.camel.impl.DefaultRouteContext.getEndpoint(DefaultRouteContext.java:88)
> at
> org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:888)
> at
> org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:175)
> ... 18 more
> Caused by: org.apache.camel.NoSuchBeanException: Cannot lookup:
> cxfBeanFromEndpoint from registry:
> org.apache.camel.spring.spi.ApplicationContextRegistry@51cb33dc with expected
> type: class org.apache.camel.component.cxf.CxfEndpoint due: Error creating
> bean with name 'cxfBeanFromEndpoint': Error setting property values; nested
> exception is org.springframework.beans.NotWritablePropertyException: Invalid
> property 'serviceFactory' of bean class
> [org.apache.camel.component.cxf.CxfSpringEndpoint]: Bean property
> 'serviceFactory' is not writable or has an invalid setter method. Does the
> parameter type of the setter match the return type of the getter?
> at
> org.apache.camel.impl.CompositeRegistry.lookupByNameAndType(CompositeRegistry.java:62)
> at
> org.apache.camel.impl.PropertyPlaceholderDelegateRegistry.lookupByNameAndType(PropertyPlaceholderDelegateRegistry.java:63)
> at
> org.apache.camel.util.CamelContextHelper.lookup(CamelContextHelper.java:129)
> at
> org.apache.camel.util.CamelContextHelper.mandatoryLookup(CamelContextHelper.java:149)
> at
> org.apache.camel.component.cxf.CxfComponent.createEndpoint(CxfComponent.java:70)
> at
> org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:123)
> at
> org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:514)
> ... 26 more
> Caused by: org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'cxfBeanFromEndpoint': Error setting property values;
> nested exception is org.springframework.beans.NotWritablePropertyException:
> Invalid property 'serviceFactory' of bean class
> [org.apache.camel.component.cxf.CxfSpringEndpoint]: Bean property
> 'serviceFactory' is not writable or has an invalid setter method. Does the
> parameter type of the setter match the return type of the getter?
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1455)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1160)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:312)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
> at
> org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1123)
> at
> org.apache.camel.spring.spi.ApplicationContextRegistry.lookupByNameAndType(ApplicationContextRegistry.java:47)
> at
> org.apache.camel.impl.CompositeRegistry.lookupByNameAndType(CompositeRegistry.java:56)
> ... 32 more
> Caused by: org.springframework.beans.NotWritablePropertyException: Invalid
> property 'serviceFactory' of bean class
> [org.apache.camel.component.cxf.CxfSpringEndpoint]: Bean property
> 'serviceFactory' is not writable or has an invalid setter method. Does the
> parameter type of the setter match the return type of the getter?
> at
> org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:1044)
> at
> org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:904)
> at
> org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:75)
> at
> org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:57)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1452)
> ... 40 more
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)