Insprired by this thread I'm trying to do this:
@ServerEndpoint(... configurator = GetHttpSessionConfigurator.class)
without the @ServerEndpoint annotation but with this code:
ServerEndpointConfig endpointConfig = ServerEndpointConfig.Builder.create(MyHandler.class, uri).build();
javax.websocket.server.ServerContainer.addEndpoint(endpointConfig);
Since I couldn't find any "setConfigurator" methods, I checked the sources of ServerEndpointConfig and I found that the Configuration (..tor) is loaded by
ServiceLoader.load(Configurator.class)
so, I created a meta-inf\services\javax.websocket.server.ServerEndpointConfig$Configurator file and added a single line to point to my GetHttpSessionConfigurator (as defined in 1) class. The file is loaded (I checked that with Process Monitor) but Tomcat's DefaultServerEndpointConfig is used.
Does anyone has an idea what's wrong with this setup?