tim08
tim08

Reputation: 27

configuring cxf-service on a custom port

I use the following stack: karaf 4.2.16, camel 2.24.5(camel-cxf), cxf 3.3.10, I set up a new connector with ssl on jetty.xml, the new port is now available as https://karaf_ip:8189 how to use this port to start the camel-cxf service now?

<camelcxf:rsServer id="myService" 
          address="https://0.0.0.0:8189/myService"
          serviceClass="my.Service"/>
...
 <camelContext xmlns="http://camel.apache.org/schema/blueprint" >
        <route>
          <from uri="cxfrs:bean:myService" />
...

I'm getting an error

Caused by: org.apache.cxf.service.factory.ServiceConstructionException
        at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:221) ~[?:?]
        at org.apache.camel.component.cxf.jaxrs.CxfRsConsumer.createServer(CxfRsConsumer.java:63) ~[?:?]
        at org.apache.camel.component.cxf.jaxrs.CxfRsConsumer.<init>(CxfRsConsumer.java:41) ~[?:?]
        at org.apache.camel.component.cxf.jaxrs.CxfRsEndpoint.createConsumer(CxfRsEndpoint.java:194) ~[?:?]
        at org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:69) ~[!/:2.25.4]
        at org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:107) ~[!/:2.25.4]
        at org.apache.camel.impl.RouteService.doWarmUp(RouteService.java:172) ~[!/:2.25.4]
        at org.apache.camel.impl.RouteService.warmUp(RouteService.java:145) ~[!/:2.25.4]
        ... 25 more
Caused by: java.lang.RuntimeException: Protocol mismatch for port 8189: engine's protocol is http, the url protocol is https
        at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.finalizeConfig(JettyHTTPDestination.java:168) ~[?:?]
        at org.apache.cxf.transport.http.HTTPTransportFactory.getDestination(HTTPTransportFactory.java:288) ~[?:?]
        at org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:85) ~[?:?]
        at org.apache.cxf.endpoint.ServerImpl.<init>(ServerImpl.java:64) ~[?:?]
        at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:170) ~[?:?]
        at org.apache.camel.component.cxf.jaxrs.CxfRsConsumer.createServer(CxfRsConsumer.java:63) ~[?:?]
        at org.apache.camel.component.cxf.jaxrs.CxfRsConsumer.<init>(CxfRsConsumer.java:41) ~[?:?]
        at org.apache.camel.component.cxf.jaxrs.CxfRsEndpoint.createConsumer(CxfRsEndpoint.java:194) ~[?:?]
        at org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:69) ~[!/:2.25.4]
        at org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:107) ~[!/:2.25.4]
        at org.apache.camel.impl.RouteService.doWarmUp(RouteService.java:172) ~[!/:2.25.4]
        at org.apache.camel.impl.RouteService.warmUp(RouteService.java:145) ~[!/:2.25.4]
        ... 25 more
Caused by: java.io.IOException: Protocol mismatch for port 8189: engine's protocol is http, the url protocol is https

if you specify in address: /myService - the service starts on default port from config karaf_folder/etc/org.ops4j.pax.web.cfg (I know that you can set ssl-port in this config, but I need one more port). I've also seen this https://docs.redhat.com/en/documentation/red_hat_fuse/7.4/html-single/apache_karaf_security_guide/index#CamelCXF-SecureProxy , but I'm interested in configuring it via jetty to keep camel-blueprint clean

Upvotes: 0

Views: 44

Answers (0)

Related Questions