WebSocket not working with Whiteboard-registration

Description

Currently registering a WebSocket via Whiteboard fails due to different reasons:

  1. The annotation-scan in the tracker fails due to different identities of the class used to check for the annotation.

  2. Jetty - If 1. is fixed the HttpServiceStarted times out

  3. Undertow - If passed 2. a javax.websocket.DeploymentException occurs claiming the class is not annotated correctly (probably same reason as for 1)

Jetty

HttpServerStarted

1 javax.websocket.server.ServerContainer serverContainer = (javax.websocket.server.ServerContainer) ctx.getAttribute(javax.websocket.server.ServerContainer.class.getName());

this fails because the Jetty adapter never handles the availability of WebSockets. Jetty must be telled to enabled a (Websocket)ServerContainer and provide the attribute in the ServletContext.

Undertow
Using Undertow with Whiteboard websockets gets (literally) one step further

HttpServerStarted

1 serverContainer.addEndpoint(webSocket.getClass());

this call will end up ServerWebSocketContainer (Undertow) which is not able to compare the existing Annotations with each other because they both live in different classloaders (the bundle with the websocket-class and the undertow-lib).

Furthermore HttpContextStarted is missing an implementation for unregisterWebsocket.

Environment

None

Status

Assignee

Marc Schlegel

Reporter

Marc Schlegel

Labels

None

Fix versions

Affects versions

6.0.0

Priority

Major
Configure