tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 61372] New: error 500 NullPointerException when no user agent is specified
Date Wed, 02 Aug 2017 14:05:34 GMT
https://bz.apache.org/bugzilla/show_bug.cgi?id=61372

            Bug ID: 61372
           Summary: error 500  NullPointerException when no user agent is
                    specified
           Product: Tomcat 7
           Version: 7.0.75
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Integration
          Assignee: dev@tomcat.apache.org
          Reporter: j2017870@mvrht.net
  Target Milestone: ---

An apache tomcat 7.0.75 server is failing to respond to a GET request, I found
out that the root cause is that the client I am using (node.js request module)
does not set a 'User-agent' header by default.

## Stack trace of the error

java.lang.NullPointerException
        java.util.regex.Matcher.getTextLength(Matcher.java:1234)
        java.util.regex.Matcher.reset(Matcher.java:308)
        java.util.regex.Matcher.<init>(Matcher.java:228)
        java.util.regex.Pattern.matcher(Pattern.java:1088)
       
org.geonetwork.http.SessionTimeoutCookieFilter.doFilter(SessionTimeoutCookieFilter.java:47)
       
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
       
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
       
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
       
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
       
org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
       
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
       
org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
       
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
       
org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
       
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
       
org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
       
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
       
org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:183)
       
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
       
org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
       
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
       
jeeves.config.springutil.PassthroughFilter.doFilter(PassthroughFilter.java:26)
       
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
       
jeeves.config.springutil.MultiNodeAuthenticationFilter.doFilter(MultiNodeAuthenticationFilter.java:98)
       
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
       
org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
       
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
       
org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
       
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
       
org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
       
org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
       
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343)
       
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260)
       
jeeves.config.springutil.JeevesDelegatingFilterProxy.doFilter(JeevesDelegatingFilterProxy.java:64)
       
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
       
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106)


## Workaround

This can be easily worked around - when you found out the cause of the problem
by specifying a user agent header (even with an empty value)

## Steps to reproduce

send a curl request to an Apache Tomcat server, including the following option
to remove the User-Agent header:

    -H "User-Agent:"

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


Mime
View raw message