On upgrade from 9.0.45 to 9.0.46, we see failures in WebSocket integration tests with the following stacktrace: java.lang.IllegalArgumentException: endpointClass cannot be null at javax.websocket.server.ServerEndpointConfig$Builder.<init>(ServerEndpointConfig.java:314) at javax.websocket.server.ServerEndpointConfig$Builder.create(ServerEndpointConfig.java:287) at org.apache.tomcat.websocket.WsSession.<clinit>(WsSession.java:77) at org.apache.tomcat.websocket.WsWebSocketContainer.connectToServerRecursive(WsWebSocketContainer.java:498) at org.apache.tomcat.websocket.WsWebSocketContainer.connectToServer(WsWebSocketContainer.java:185) at org.springframework.web.reactive.socket.client.StandardWebSocketClient.lambda$executeInternal$0(StandardWebSocketClient.java:111) I'm hoping the stacktrace provides enough of a clue. It looks like on line 77 WsSession invokes ServerEndpointConfig.Builder#create with null values which is then rejected by the create method. If not, I'll try and extract an isolated sample.
Thanks, I can see what is going on. The CDI integration needs to know if it can "short-cut" the Endpoint creation process and use the InstanceManager to create the Endpoint instance (which allows non-zero-arg constructors to be used) or whether the Endpoint instance needs to be created via the standard WebSocket mechanism and then passed to the InstanceManager. I used a hack to figure this out that depends on how Tomcat implemented the WebSocket API. It appears you are using a different API implementation that has stricter checking. I should be able to fix this in the next release. In the meantime, a workaround would be to use the WebSocket API JAR from Tomcat 9.
FWIW the relevant dependencies are tomcat-websocket, tomcat-embed-core, tomcat-util, and javax.websocket:javax.websocket-api and it's the ServerEndpointConfig.Builder in javax.websocket:javax.websocket-api where the exception is raised.
Fixed in: - 10.0.x for 10.0.7 onwards - 9.0.x for 9.0.47 onwards - 8.5.x for 8.5.67 onwards