cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "MULLER, Anthony" <>
Subject CXF 3.1 + Tomcat 8 + JAR-RS + Atmosphere + WebSocket
Date Wed, 28 Sep 2016 15:26:23 GMT
Hello CXF Experts, Sergey, Aki,

I have some issues to implement a simple test using WebSocket with CXF 3.1.7, in a Tomcat
8 Servlet container.

To make troubleshooting easier, I shared my demo project (based on the official CXF samples
written by Aki):

The webapp context is "cxf31_websocket" and it contains a simple RESTful service running under
"/services/users" path.

The project also contains a basic index.html webpage to test the websocket.

CXF is bootstrapped using: org.apache.cxf.transport.servlet.CXFServlet

Spring is used to and configured this way with a "beans.xml" file:

 <jaxrs:server id="websocketService" address="/" transportId=""
<context:component-scan base-package=""/>

When I check the websocket using Chrome, the following error is displayed in the Network panel
of the developer tools:

Request headers:
GET ws://localhost:8080/cxf31_websocket/services HTTP/1.1
Host: localhost:8080
Connection: Upgrade
Pragma: no-cache
Cache-Control: no-cache
Upgrade: websocket
Origin: http://localhost:8080
Sec-WebSocket-Version: 13
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko)
Chrome/53.0.2785.116 Safari/537.36
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8,fr;q=0.6
Sec-WebSocket-Key: Uc/E4OEE/BnKx/EvHUgLtQ==
Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits

Response headers:
HTTP/1.1 501 Not Implemented
Server: Apache-Coyote/1.1
X-Atmosphere-first-request: true
X-Atmosphere-tracking-id: aeeb9f45-62e8-45b4-9d37-4657988e20ec
X-Atmosphere-error: Websocket protocol not supported
Transfer-Encoding: chunked
Date: Wed, 28 Sep 2016 15:21:58 GMT
Connection: close

No error is displayed in the Eclipse console... I'm stuck because I didn't really get the
magic behind the scene. It seems that the transportId attribute is enabling the full WebSocket
logic? (transportId="")

Thanks for your help and explanations.

Best regards,
Anthony MÜLLER

View raw message