https://issues.apache.org/bugzilla/show_bug.cgi?id=57527

            Bug ID: 57527
           Summary: java.lang.NullPointerException: null at at
                    org.apache.catalina.connector.Request.getContextPath(R
                    equest.java:1918)
           Product: Tomcat 8
           Version: 8.0.15
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: rayeas...@163.com

occasionally, tomcat will throw this error.

I am not sure whether it is same bug as this one:
https://issues.apache.org/bugzilla/show_bug.cgi?id=56840

although the stack trace originated from apache Shiro framework.but it seems
irrelevant:

17:40:43.804 [http-nio-28443-exec-4] WARN  o.a.shiro.mgt.DefaultSecurityManager
- Delegate RememberMeManager instance of type
[org.apache.shiro.web.mgt.CookieRememberMeManager] threw an exception during
onLogout for subject with principals [andson]
java.lang.NullPointerException: null
        at
org.apache.catalina.connector.Request.getContextPath(Request.java:1918)
~[catalina.jar:8.0.15]
        at
org.apache.catalina.connector.RequestFacade.getContextPath(RequestFacade.java:783)
~[catalina.jar:8.0.15]
        at
javax.servlet.http.HttpServletRequestWrapper.getContextPath(HttpServletRequestWrapper.java:150)
~[servlet-api.jar:na]
        at
javax.servlet.http.HttpServletRequestWrapper.getContextPath(HttpServletRequestWrapper.java:150)
~[servlet-api.jar:na]
        at
org.apache.shiro.web.servlet.SimpleCookie.calculatePath(SimpleCookie.java:192)
~[shiro-web-1.2.2.jar:1.2.2]
        at
org.apache.shiro.web.servlet.SimpleCookie.removeFrom(SimpleCookie.java:349)
~[shiro-web-1.2.2.jar:1.2.2]
        at
org.apache.shiro.web.mgt.CookieRememberMeManager.forgetIdentity(CookieRememberMeManager.java:288)
~[shiro-web-1.2.2.jar:1.2.2]
        at
org.apache.shiro.web.mgt.CookieRememberMeManager.forgetIdentity(CookieRememberMeManager.java:260)
~[shiro-web-1.2.2.jar:1.2.2]
        at
org.apache.shiro.mgt.AbstractRememberMeManager.onLogout(AbstractRememberMeManager.java:537)
~[shiro-core-1.2.2.jar:1.2.2]
        at
org.apache.shiro.mgt.DefaultSecurityManager.rememberMeLogout(DefaultSecurityManager.java:244)
[shiro-core-1.2.2.jar:1.2.2]
        at
org.apache.shiro.mgt.DefaultSecurityManager.beforeLogout(DefaultSecurityManager.java:299)
[shiro-core-1.2.2.jar:1.2.2]
        at
org.apache.shiro.web.mgt.DefaultWebSecurityManager.beforeLogout(DefaultWebSecurityManager.java:240)
[shiro-web-1.2.2.jar:1.2.2]
        at
org.apache.shiro.mgt.DefaultSecurityManager.logout(DefaultSecurityManager.java:545)
[shiro-core-1.2.2.jar:1.2.2]
        at
org.apache.shiro.subject.support.DelegatingSubject.logout(DelegatingSubject.java:363)
[shiro-core-1.2.2.jar:1.2.2]
......

from source :

org.apache.catalina.connector.Request:

   public String More ...getContextPath() {
     String uri = getRequestURI();
     .....
     return uri.substring(0, pos); ---》 NullPointerException
   }

   public String getRequestURI() {
     return coyoteRequest.requestURI().toString();
   }

org.apache.coyote.Request:

   public MessageBytes More ...requestURI() 
     return uriMB;
   }

org.apache.tomcat.util.buf.MessageBytes:

   public String More ...toString() {
156        if( hasStrValue ) {
157            return strValue;
158        }
159
160        switch (type) {
161        case T_CHARS:
162            strValue=charC.toString();
163            hasStrValue=true;
164            return strValue;
165        case T_BYTES:
166            strValue=byteC.toString();
167            hasStrValue=true;
168            return strValue;
169        }
170        return null;
171    }

BUT the uriMB's type is initialized as T_NULL which will cause toString return
null!! anything I miss?

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to