use of jakarta.websocket.DeploymentException in project tomcat by apache.
the class TesterEndpointConfig method contextInitialized.
@Override
public void contextInitialized(ServletContextEvent sce) {
super.contextInitialized(sce);
ServerContainer sc = (ServerContainer) sce.getServletContext().getAttribute(Constants.SERVER_CONTAINER_SERVLET_CONTEXT_ATTRIBUTE);
try {
ServerEndpointConfig sec = getServerEndpointConfig();
if (sec == null) {
sc.addEndpoint(getEndpointClass());
} else {
sc.addEndpoint(sec);
}
} catch (DeploymentException e) {
throw new RuntimeException(e);
}
}
use of jakarta.websocket.DeploymentException in project spring-framework by spring-projects.
the class ServerEndpointExporter method registerEndpoint.
private void registerEndpoint(ServerEndpointConfig endpointConfig) {
ServerContainer serverContainer = getServerContainer();
Assert.state(serverContainer != null, "No ServerContainer set");
try {
if (logger.isDebugEnabled()) {
logger.debug("Registering ServerEndpointConfig: " + endpointConfig);
}
serverContainer.addEndpoint(endpointConfig);
} catch (DeploymentException ex) {
throw new IllegalStateException("Failed to register ServerEndpointConfig: " + endpointConfig, ex);
}
}
Aggregations