With camel-ahc-ws component exception received is java.lang.IllegalStateException: Unknown protocol: wss

Solution Verified - Updated -

Issue

  • The application establishes a connection to websocket server receive RealTimeAlarms from the South Bound system.
  • Camel Components used: Async Http Client (AHC) Websocket Client Component
  • Our team uses the websocket protocol to communicate with a backend third party system that updates information about fault management information to others listening on the websocket. In order to send information as a client, we use the ahc-wss: component.
  • I am using the ahc-wss component within Fuse 6.2.1 and Fuse complaints that the wss component is not found. The feature file that I created installs the following:
        camel-core
        camel-ahc
        camel-ahc-ws
  • On Jboss Developer studio ahc-wss is using NettyAsyncHttpProvider, which works. The same application when deployed in Fuse was still referring to JDKAsyncHttpProvider and errors out saying unknown protocol wss. The Hawtio console does show both Netty and Grizzly providers being exported.
  • The error is as follows
13:50:53,386 | ERROR | endpoint-connect | WsEndpoint                       | 267 - org.apache.camel.camel-ahc-ws - 2.15.1.redhat-621084 | websocket on error
java.net.MalformedURLException: Unknown protocol: wss
    at java.net.URL.(URL.java:620)[:1.8.0_65]
    at java.net.URL.(URL.java:483)[:1.8.0_65]
    at java.net.URL.(URL.java:432)[:1.8.0_65]
    at java.net.URI.toURL(URI.java:1089)[:1.8.0_65]
    at com.ning.http.client.providers.jdk.JDKAsyncHttpProvider.createUrlConnection(JDKAsyncHttpProvider.java:180)[265:com.ning.async-http-client:1.9.17]
    at com.ning.http.client.providers.jdk.JDKAsyncHttpProvider.execute(JDKAsyncHttpProvider.java:147)[265:com.ning.async-http-client:1.9.17]
    at com.ning.http.client.providers.jdk.JDKAsyncHttpProvider.execute(JDKAsyncHttpProvider.java:118)[265:com.ning.async-http-client:1.9.17]
    at com.ning.http.client.AsyncHttpClient.executeRequest(AsyncHttpClient.java:486)[265:com.ning.async-http-client:1.9.17]
    at com.ning.http.client.AsyncHttpClient$BoundRequestBuilder.execute(AsyncHttpClient.java:225)[265:com.ning.async-http-client:1.9.17]
    at org.apache.camel.component.ahc.ws.WsEndpoint.connect(WsEndpoint.java:127)[267:org.apache.camel.camel-ahc-ws:2.15.1.redhat-621084]
    at org.apache.camel.component.ahc.ws.WsEndpoint.getWebSocket(WsEndpoint.java:87)[267:org.apache.camel.camel-ahc-ws:2.15.1.redhat-621084]
    at org.apache.camel.component.ahc.ws.WsProducer.getWebSocket(WsProducer.java:136)[267:org.apache.camel.camel-ahc-ws:2.15.1.redhat-621084]
    at org.apache.camel.component.ahc.ws.WsProducer.process(WsProducer.java:52)[267:org.apache.camel.camel-ahc-ws:2.15.1.redhat-621084]
    at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)[198:org.apache.camel.camel-core:2.15.1.redhat-621084]
    at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:139)[198:org.apache.camel.camel-core:2.15.1.redhat-621084]
    at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)[198:org.apache.camel.camel-core:2.15.1.redhat-621084]
    at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:448)[198:org.apache.camel.camel-core:2.15.1.redhat-621084]
    at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[198:org.apache.camel.camel-core:2.15.1.redhat-621084]
    at org.apache.camel.processor.Pipeline.process(Pipeline.java:121)[198:org.apache.camel.camel-core:2.15.1.redhat-621084]
    at org.apache.camel.processor.Pipeline.process(Pipeline.java:83)[198:org.apache.camel.camel-core:2.15.1.redhat-621084]
    at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[198:org.apache.camel.camel-core:2.15.1.redhat-621084]
    at org.apache.camel.component.timer.TimerConsumer.sendTimerExchange(TimerConsumer.java:165)[198:org.apache.camel.camel-core:2.15.1.redhat-621084]
    at org.apache.camel.component.timer.TimerConsumer$1.run(TimerConsumer.java:73)[198:org.apache.camel.camel-core:2.15.1.redhat-621084]
    at java.util.TimerThread.mainLoop(Timer.java:555)[:1.8.0_65]
    at java.util.TimerThread.run(Timer.java:505)[:1.8.0_65]
Caused by: java.lang.IllegalStateException: Unknown protocol: wss
    at org.apache.felix.framework.URLHandlersStreamHandlerProxy.parseURL(URLHandlersStreamHandlerProxy.java:373)[org.apache.felix.framework-4.4.1.jar:]
    at java.net.URL.(URL.java:615)[:1.8.0_65]
    ... 24 more
13:50:53,388 | ERROR | endpoint-connect | WsEndpoint                       | 267 - org.apache.camel.camel-ahc-ws - 2.15.1.redhat-621084 | Failed to connect
java.util.concurrent.ExecutionException: java.net.MalformedURLException: Unknown protocol: wss
    at com.ning.http.client.ListenableFuture$CompletedFailure.(ListenableFuture.java:91)[265:com.ning.async-http-client:1.9.17]
    at com.ning.http.client.providers.jdk.JDKAsyncHttpProvider.execute(JDKAsyncHttpProvider.java:121)[265:com.ning.async-http-client:1.9.17]
    at com.ning.http.client.AsyncHttpClient.executeRequest(AsyncHttpClient.java:486)[265:com.ning.async-http-client:1.9.17]
    at com.ning.http.client.AsyncHttpClient$BoundRequestBuilder.execute(AsyncHttpClient.java:225)[265:com.ning.async-http-client:1.9.17]
    at org.apache.camel.component.ahc.ws.WsEndpoint.connect(WsEndpoint.java:127)[267:org.apache.camel.camel-ahc-ws:2.15.1.redhat-621084]
    at org.apache.camel.component.ahc.ws.WsEndpoint.getWebSocket(WsEndpoint.java:87)[267:org.apache.camel.camel-ahc-ws:2.15.1.redhat-621084]
    at org.apache.camel.component.ahc.ws.WsProducer.getWebSocket(WsProducer.java:136)[267:org.apache.camel.camel-ahc-ws:2.15.1.redhat-621084]
    at org.apache.camel.component.ahc.ws.WsProducer.process(WsProducer.java:52)[267:org.apache.camel.camel-ahc-ws:2.15.1.redhat-621084]
    at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)[198:org.apache.camel.camel-core:2.15.1.redhat-621084]
    at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:139)[198:org.apache.camel.camel-core:2.15.1.redhat-621084]
    at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)[198:org.apache.camel.camel-core:2.15.1.redhat-621084]
    at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:448)[198:org.apache.camel.camel-core:2.15.1.redhat-621084]
    at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[198:org.apache.camel.camel-core:2.15.1.redhat-621084]
    at org.apache.camel.processor.Pipeline.process(Pipeline.java:121)[198:org.apache.camel.camel-core:2.15.1.redhat-621084]
    at org.apache.camel.processor.Pipeline.process(Pipeline.java:83)[198:org.apache.camel.camel-core:2.15.1.redhat-621084]
    at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[198:org.apache.camel.camel-core:2.15.1.redhat-621084]
    at org.apache.camel.component.timer.TimerConsumer.sendTimerExchange(TimerConsumer.java:165)[198:org.apache.camel.camel-core:2.15.1.redhat-621084]
    at org.apache.camel.component.timer.TimerConsumer$1.run(TimerConsumer.java:73)[198:org.apache.camel.camel-core:2.15.1.redhat-621084]
    at java.util.TimerThread.mainLoop(Timer.java:555)[:1.8.0_65]
    at java.util.TimerThread.run(Timer.java:505)[:1.8.0_65]
Caused by: java.net.MalformedURLException: Unknown protocol: wss
    at java.net.URL.(URL.java:620)[:1.8.0_65]
    at java.net.URL.(URL.java:483)[:1.8.0_65]
    at java.net.URL.(URL.java:432)[:1.8.0_65]
    at java.net.URI.toURL(URI.java:1089)[:1.8.0_65]
    at com.ning.http.client.providers.jdk.JDKAsyncHttpProvider.createUrlConnection(JDKAsyncHttpProvider.java:180)[265:com.ning.async-http-client:1.9.17]
    at com.ning.http.client.providers.jdk.JDKAsyncHttpProvider.execute(JDKAsyncHttpProvider.java:147)[265:com.ning.async-http-client:1.9.17]
    at com.ning.http.client.providers.jdk.JDKAsyncHttpProvider.execute(JDKAsyncHttpProvider.java:118)[265:com.ning.async-http-client:1.9.17]
    ... 18 more
Caused by: java.lang.IllegalStateException: Unknown protocol: wss
    at org.apache.felix.framework.URLHandlersStreamHandlerProxy.parseURL(URLHandlersStreamHandlerProxy.java:373)[org.apache.felix.framework-4.4.1.jar:]
    at java.net.URL.(URL.java:615)[:1.8.0_65]
    ... 24 more

Environment

  • Red Hat JBoss Fuse
    • 6.2.1

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content