The module-info.class of tomcat-embed-websocket.jar is missing the following two uses directives to be able to be used in a project that enables the JPMS. uses javax.websocket.ContainerProvider; uses javax.websocket.server.ServerEndpointConfig.Configurator; The first one is required because javax.websocket.ContainerProvider#getWebSocketContainer() calls ServiceLoader.load(ContainerProvider.class). The second one is required because javax.websocket.server.ServerEndpointConfig.Configurator#loadDefault() calls ServiceLoader.load(ServerEndpointConfig.Configurator.class). Both calls fail with a ServiceConfigurationError if the uses directives are missing. I managed to fix this issue locally by patching the JAR in such a way, that both uses directives are included. This bug is analogous to #64751. I believe (but did not verify) that the same bug occurs in Tomcat 10 as well.
This looks a side-effect of removing the BND annotations from the API classes because they broke the TCK (arguably the TCK should have ignored them but the TCK team disagreed). The fix should - hopefully - be as simple as adding the same manual entries to the embed JARs.
Fixed in: - 10.1.x for 10.1.0-M1 onwards - 10.0.x for 10.0.7 onwards - 9.0.x for 9.0.47 onwards 8.5.x does not include JPMS metadata