Hi, I'm a new to Camel, and i have encountered an error when configure the endpoint in camel-config.xml. Appreciate is anyone can help me, thank.
Details as below: I am using RouteBuilder to build the routes in Java code previously, the routes start from a cxf service which defined by cxf:/service?serviceClass=..., this way can work well, but now i would like to move this endpoint to camel-config.xml, i have read the reference from https://camel.apache.org/cxf.html for the configuration and configure as below: /<bean id="loggingOutInterceptor" class="org.apache.cxf.interceptor.LoggingOutInterceptor"> <constructor-arg value="target/write"/> </bean> <cxf:cxfEndpoint id="myServiceEndpoint" address="http://localhost:9080/MyService/service" serviceClass="mytest.service.MyService"> <cxf:outInterceptors> <ref bean="loggingOutInterceptor"/> </cxf:outInterceptors> <cxf:properties> <entry key="dataFormat" value="MESSAGE"/> </cxf:properties> </cxf:cxfEndpoint> <bean id="myRoutes" class="mytest.builder.MyRouteBuilder"/> <camelContext xmlns="http://camel.apache.org/schema/spring"> <routeBuilder ref="myRoutes"/> </camelContext>/ The Camel is deployed in Websphere application server, when i access the service 'http://localhost:9080/MyService/service', the following exception is thrown in Websphere server log: [23/09/15 15:54:00:520 CST] 0000007f webapp E com.ibm.ws.webcontainer.webapp.WebApp logServletError SRVE0293E: [Servlet Error]-[CXFServlet]: org.apache.camel.RuntimeCamelException: org.apache.cxf.service.factory.ServiceConstructionException at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1619) at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:123) at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:332) at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:151) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:128) at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:331) at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:773) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:483) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106) at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:1678) at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:414) at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:88) at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:169) at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:746) at com.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:634) at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:426) at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:718) at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1175) at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1370) at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:639) at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:968) at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:774) at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplicationDynamically(ApplicationMgrImpl.java:1374) at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2179) at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:445) at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123) at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:388) at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$500(CompositionUnitMgrImpl.java:116) at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$1.run(CompositionUnitMgrImpl.java:663) at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:5474) at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:5600) at com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:255) at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:677) at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:621) at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:1266) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:88) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55) at java.lang.reflect.Method.invoke(Method.java:613) at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:68) at sun.reflect.GeneratedMethodAccessor42.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55) at java.lang.reflect.Method.invoke(Method.java:613) at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:287) at javax.management.modelmbean.RequiredModelMBean$4.run(RequiredModelMBean.java:1256) at java.security.AccessController.doPrivileged(AccessController.java:252) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87) at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1250) at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:1088) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:831) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:804) at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1335) at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118) at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:1228) at com.ibm.ws.management.commands.AdminServiceCommands$InvokeCmd.execute(AdminServiceCommands.java:251) at com.ibm.ws.console.core.mbean.MBeanHelper.invoke(MBeanHelper.java:241) at com.ibm.ws.console.appdeployment.ApplicationDeploymentCollectionAction.execute(ApplicationDeploymentCollectionAction.java:578) at org.apache.struts.action.RequestProcessor.processActionPerform(Unknown Source) at org.apache.struts.action.RequestProcessor.process(Unknown Source) at org.apache.struts.action.ActionServlet.process(Unknown Source) at org.apache.struts.action.ActionServlet.doPost(Unknown Source) at javax.servlet.http.HttpServlet.service(HttpServlet.java:595) at javax.servlet.http.HttpServlet.service(HttpServlet.java:668) at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1227) at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:776) at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:458) at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178) at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:136) at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:79) at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:928) at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1025) at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:1385) at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:194) at org.apache.struts.action.RequestProcessor.doForward(Unknown Source) at org.apache.struts.tiles.TilesRequestProcessor.doForward(Unknown Source) at org.apache.struts.action.RequestProcessor.processForwardConfig(Unknown Source) at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(Unknown Source) at org.apache.struts.action.RequestProcessor.process(Unknown Source) at org.apache.struts.action.ActionServlet.process(Unknown Source) at org.apache.struts.action.ActionServlet.doPost(Unknown Source) at javax.servlet.http.HttpServlet.service(HttpServlet.java:595) at javax.servlet.http.HttpServlet.service(HttpServlet.java:668) at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1227) at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:776) at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:458) at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178) at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:136) at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:97) at com.ibm.ws.console.core.servlet.WSCUrlFilter.setUpCommandAssistance(WSCUrlFilter.java:955) at com.ibm.ws.console.core.servlet.WSCUrlFilter.continueStoringTaskState(WSCUrlFilter.java:504) at com.ibm.ws.console.core.servlet.WSCUrlFilter.doFilter(WSCUrlFilter.java:325) at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195) at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91) at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:928) at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1025) at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:87) at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:909) at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662) at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:459) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:526) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:312) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:283) at com.ibm.ws.ssl.channel.impl.SSLConnectionLink.determineNextChannel(SSLConnectionLink.java:1048) at com.ibm.ws.ssl.channel.impl.SSLConnectionLink.readyInboundPostHandshake(SSLConnectionLink.java:716) at com.ibm.ws.ssl.channel.impl.SSLConnectionLink$MyHandshakeCompletedCallback.complete(SSLConnectionLink.java:412) at com.ibm.ws.ssl.channel.impl.SSLUtils.handleHandshake(SSLUtils.java:1066) at com.ibm.ws.ssl.channel.impl.SSLHandshakeIOCallback.complete(SSLHandshakeIOCallback.java:87) at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175) at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217) at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161) at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138) at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204) at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775) at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1862) Caused by: org.apache.cxf.service.factory.ServiceConstructionException at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:188) at org.apache.camel.component.cxf.CxfConsumer.<init>(CxfConsumer.java:266) at org.apache.camel.component.cxf.CxfEndpoint.createConsumer(CxfEndpoint.java:245) at org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:65) at org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:85) at org.apache.camel.impl.RouteService.warmUp(RouteService.java:158) at org.apache.camel.impl.DefaultCamelContext.doWarmUpRoutes(DefaultCamelContext.java:3090) at org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:3020) at org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:2797) at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:2653) at org.apache.camel.impl.DefaultCamelContext.access$000(DefaultCamelContext.java:167) at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2467) at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2463) at org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:2486) at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:2463) at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61) at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:2432) at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:255) at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:121) ... 116 more Caused by: java.io.IOException: Cannot find any registered HttpDestinationFactory from the Bus. at org.apache.cxf.transport.http.HTTPTransportFactory.getDestination(HTTPTransportFactory.java:269) at org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:131) at org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:84) at org.apache.cxf.endpoint.ServerImpl.<init>(ServerImpl.java:63) at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:170) ... 134 more -- View this message in context: http://camel.465427.n5.nabble.com/Failed-to-configure-Endpoint-in-camel-config-xml-tp5771834.html Sent from the Camel - Users mailing list archive at Nabble.com.
