tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [Bug 54805] New: [jsr 356] javax.websocket.server.ServerContainer is null when Servlet.init(ServletContext)
Date Fri, 05 Apr 2013 13:35:16 GMT

            Bug ID: 54805
           Summary: [jsr 356] javax.websocket.server.ServerContainer is
                    null when Servlet.init(ServletContext)
           Product: Tomcat 8
           Version: trunk
          Hardware: PC
                OS: Mac OS X 10.4
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
    Classification: Unclassified

Using the following code:

public class JSR356AsyncSupport extends Servlet30CometSupport {
    public JSR356AsyncSupport(AtmosphereConfig config) {
        Object serverContainer =
        if (serverContainer != null) {
            try {
            } catch (DeploymentException e) {

The attribute is always null when calling ServletContext during the
Servlet.init() operation. From the javadoc:
The ServerContainer is the specialized view of the WebSocketContainer available
in server-side deployments. There is one ServerContainer instance per websocket
application. The ServerContainer holds the methods to be able to register
server endpoints during the initialization phase of the application.
For websocket enabled web containers, developers may obtain a reference to the
ServerContainer instance by retrieving it as an attribute named
javax.websocket.server.ServerContainer on the ServletContext. This way, the
registration methods held on this interface may be called to register server
endpoints from a ServletContextListener during the deployment of the WAR file
containing the endpoint.

You are receiving this mail because:
You are the assignee for the bug.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message