You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by "Ls, Deepthi (Nokia - IN/Bangalore)" <de...@nokia.com> on 2018/08/27 07:13:42 UTC

REST inside servicemix 3.4.0

Hello Team,

Is it possible to have REST services deployed inside service mix version 3.4.0 (CXF 2.4.4 and Camel 2.8.3) using camel's routing mechanism ?

Regards,
Deepthi


RE: REST inside servicemix 3.4.0

Posted by "M, Ramya (Nokia - IN/Bangalore)" <ra...@nokia.com>.
HI team ,

I am trying to create rest service inside servicemix  (version:3.4.0)  by using  camel-cfx (CXF 2.4.4 and Camel 2.8.3)
I tried deploying camel routes  in below 3 ways

1.tried deploying as camel  route as service unit and service assembly
2. tried deploying camel  route as a bundle that is also not working
3.tried deploying camel  route as a blueprint

but none of the one is working

can u please help me how to create camel rest service  inside servicemix 3.4.0

Regards,
Ramya


________________________________
From: Jean-Baptiste Onofré <jb...@nanthrax.net>>
Sent: Monday, August 27, 2018 12:56:25 PM
To: users@cxf.apache.org<ma...@cxf.apache.org>
Subject: Re: REST inside servicemix 3.4.0

Sure using the camel-cxfrs component.

Regards
JB

Le 27 août 2018 à 08:13, à 08:13, "Ls, Deepthi (Nokia - IN/Bangalore)" <de...@nokia.com>> a écrit:
>Hello Team,
>
>Is it possible to have REST services deployed inside service mix
>version 3.4.0 (CXF 2.4.4 and Camel 2.8.3) using camel's routing
>mechanism ?
>
>Regards,
>Deepthi

FW: REST inside servicemix 3.4.0

Posted by "Ls, Deepthi (Nokia - IN/Bangalore)" <de...@nokia.com>.
Hi Team,

Thanks for the confirmation that we can deploy REST services inside servicemix 3.4.0 with camel-cxfrs.
I am trying to create rest services inside servicemix 3.4.0 by using camel-cfxrs
I created  camel serviceunit  and service assembly and  deployed in servicemix 3.4.0

Camel service unit : configure

public void configure() {

                 from("cxfrs://http://localhost:9000?resourceClasses=" + ExampleResource.class.getName())
            .process(new Processor() {
                public void process(Exchange exchange) throws Exception {
                    //custom processing here
                }
            })
            .setBody(constant("SUCESS"))
                     .to("log:org.apache.servicemix.rest.example.MyRouteBuilder");
   }

After deploying getting these error :

</msg-loc-info>
</task-status-msg>
                                                <exception-info>
                                                                <nesting-level>1</nesting-level>
                                                                <msg-loc-info>
                                                                                <loc-token/>
                                                                                <loc-message>org.apache.cxf.service.factory.ServiceConstructionException</loc-message>
                                                                                <stack-trace><![CDATA[org.apache.camel.RuntimeCamelException: org.apache.cxf.service.factory.ServiceConstructionException
                at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1164)
                at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:117)
                at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:240)
                at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:97)
                at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:303)
                at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:911)
                at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:428)
                at org.apache.servicemix.common.xbean.AbstractXBeanDeployer.deploy(AbstractXBeanDeployer.java:86)
                at org.apache.servicemix.camel.CamelSpringDeployer.deploy(CamelSpringDeployer.java:76)
                at org.apache.servicemix.common.BaseServiceUnitManager.doDeploy(BaseServiceUnitManager.java:86)
                at org.apache.servicemix.common.BaseServiceUnitManager.deploy(BaseServiceUnitManager.java:69)
                at org.apache.servicemix.jbi.framework.DeploymentService.deployServiceAssembly(DeploymentService.java:543)
                at org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServiceAssembly(AutoDeploymentService.java:345)
                at org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchive(AutoDeploymentService.java:255)
                at org.apache.servicemix.jbi.framework.AutoDeploymentService.monitorDirectory(AutoDeploymentService.java:648)
                at org.apache.servicemix.jbi.framework.AutoDeploymentService.access$800(AutoDeploymentService.java:63)
                at org.apache.servicemix.jbi.framework.AutoDeploymentService$1.run(AutoDeploymentService.java:612)
                at java.util.TimerThread.mainLoop(Timer.java:555)
                at java.util.TimerThread.run(Timer.java:505)
Caused by: org.apache.cxf.service.factory.ServiceConstructionException
                at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:190)
                at org.apache.camel.component.cxf.jaxrs.CxfRsConsumer.<init>(CxfRsConsumer.java:38)
                at org.apache.camel.component.cxf.jaxrs.CxfRsEndpoint.createConsumer(CxfRsEndpoint.java:106)
                at org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:61)
                at org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:75)
                at org.apache.camel.impl.RouteService.warmUp(RouteService.java:124)
                at org.apache.camel.impl.DefaultCamelContext.doWarmUpRoutes(DefaultCamelContext.java:1857)
                at org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:1785)
                at org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:1570)
                at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1460)
                at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1349)
                at org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:176)
                at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:67)
                at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:54)
                at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1317)
                at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:221)
                at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:115)
                ... 17 more
Caused by: java.io.IOException: Cannot find any registered HttpDestinationFactory from the Bus.
                at org.apache.cxf.transport.http.HTTPTransportFactory.getDestination(HTTPTransportFactory.java:270)
                at org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:93)
                at org.apache.cxf.endpoint.ServerImpl.<init>(ServerImpl.java:72)
                at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:149)
                ... 33 more
]]></stack-trace>
                                                                </msg-loc-info>
                                                </exception-info>
                                </task-result-details>
                </component-task-result-details>

Regards,
Deepthi
________________________________
From: Jean-Baptiste Onofré <jb...@nanthrax.net>>
Sent: Monday, August 27, 2018 12:56:25 PM
To: users@cxf.apache.org<ma...@cxf.apache.org>
Subject: Re: REST inside servicemix 3.4.0

Sure using the camel-cxfrs component.

Regards
JB

Le 27 août 2018 à 08:13, à 08:13, "Ls, Deepthi (Nokia - IN/Bangalore)" <de...@nokia.com>> a écrit:
>Hello Team,
>
>Is it possible to have REST services deployed inside service mix
>version 3.4.0 (CXF 2.4.4 and Camel 2.8.3) using camel's routing
>mechanism ?
>
>Regards,
>Deepthi

Re: REST inside servicemix 3.4.0

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Sure using the camel-cxfrs component.

Regards
JB

Le 27 août 2018 à 08:13, à 08:13, "Ls, Deepthi (Nokia - IN/Bangalore)" <de...@nokia.com> a écrit:
>Hello Team,
>
>Is it possible to have REST services deployed inside service mix
>version 3.4.0 (CXF 2.4.4 and Camel 2.8.3) using camel's routing
>mechanism ?
>
>Regards,
>Deepthi