glassfish
  1. glassfish
  2. GLASSFISH-20747

SessionCookieConfig#getName should return null if SessionCookieConfig#getName has not been invoked

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.0_b90
    • Component/s: None
    • Labels:
      None

      Description

      In javadoc of SessionCookieConfig#getName of Servlet 3.0 and Servlet 3.1, we have the following:

      Returns:
      the cookie name set via setName(java.lang.String), or null if setName(java.lang.String) was never called
      

      So, if SessionCookieConfig#setName has not been invoked, then SessionCookieConfig#getName should be null rather than "JSESSIONID".

        Activity

        Hide
        Shing Wai Chan added a comment -

        Sending appserver/web/web-core/src/main/java/org/apache/catalina/core/SessionCookieConfigImpl.java
        Transmitting file data .
        Committed revision 62457.

        Show
        Shing Wai Chan added a comment - Sending appserver/web/web-core/src/main/java/org/apache/catalina/core/SessionCookieConfigImpl.java Transmitting file data . Committed revision 62457.
        Hide
        Shing Wai Chan added a comment -

        fix in 4.0 branch
        Sending src/main/java/org/apache/catalina/core/SessionCookieConfigImpl.java
        Transmitting file data .
        Committed revision 62458.

        Show
        Shing Wai Chan added a comment - fix in 4.0 branch Sending src/main/java/org/apache/catalina/core/SessionCookieConfigImpl.java Transmitting file data . Committed revision 62458.
        Hide
        Amy Roh added a comment -

        This fix is causing a deployment failure for Servlet TCK sessioncookieconfig.war.

        [2013-08-13T02:17:44.565-0700] [glassfish 4.0] [SEVERE] [AS-WEB-CORE-00174] [javax.enterprise.web.core] [tid: _ThreadID=64 _ThreadName=AutoDeployer] [timeMillis: 1376385464565] [levelValue: 1000] [[
        Startup of context /servlet_pluh_sessioncookieconfig_web failed due to previous errors]]

        Caused by: java.lang.NullPointerException
        at com.sun.ts.tests.servlet.api.javax_servlet_http.sessioncookieconfig.TestListener.contextInitialized(TestListener.java:74)
        at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:5394)
        at com.sun.enterprise.web.WebModule.contextListenerStart(WebModule.java:743)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:5932)

        The failing code is looking up SessionCookieConfig#getName and is returning NULL.

        SessionCookieConfig scf =
        sce.getServletContext().getSessionCookieConfig();

        if (!scf.getName().equals("JSESSIONID")) {

        Show
        Amy Roh added a comment - This fix is causing a deployment failure for Servlet TCK sessioncookieconfig.war. [2013-08-13T02:17:44.565-0700] [glassfish 4.0] [SEVERE] [AS-WEB-CORE-00174] [javax.enterprise.web.core] [tid: _ThreadID=64 _ThreadName=AutoDeployer] [timeMillis: 1376385464565] [levelValue: 1000] [[ Startup of context /servlet_pluh_sessioncookieconfig_web failed due to previous errors]] Caused by: java.lang.NullPointerException at com.sun.ts.tests.servlet.api.javax_servlet_http.sessioncookieconfig.TestListener.contextInitialized(TestListener.java:74) at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:5394) at com.sun.enterprise.web.WebModule.contextListenerStart(WebModule.java:743) at org.apache.catalina.core.StandardContext.start(StandardContext.java:5932) The failing code is looking up SessionCookieConfig#getName and is returning NULL. SessionCookieConfig scf = sce.getServletContext().getSessionCookieConfig(); if (!scf.getName().equals("JSESSIONID")) {
        Hide
        Shing Wai Chan added a comment -

        This is a bug in CTS. I have talked to CTS team before checkin the fix. Per discussion, they are working on the fix.

        Show
        Shing Wai Chan added a comment - This is a bug in CTS. I have talked to CTS team before checkin the fix. Per discussion, they are working on the fix.

          People

          • Assignee:
            Shing Wai Chan
            Reporter:
            Shing Wai Chan
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: