Project

General

Profile

bug #9185

DateHeaderFilter.doFilter(..) causes NPE in FrameworkServlet.processRequest(..) on 404 HTTP response

Added by Andreas Kohlbecker 10 months ago. Updated about 1 month ago.

Status:
Closed
Priority:
Highest
Category:
cdmlib-remote
Target version:
Start date:
08/12/2020
Due date:
% Done:

100%

Severity:
normal
Found in Version:

Description

00:00:05.479 [flora-malesiana] [qtp527446182-27609] INFO  e.e.c.r.controller.BaseController - doGetMethod()[doGetAnnotations] GET: /flora-malesiana/taxon/065068df-055b-4756-bbca-fb0ad0ecaf4f/annotations
00:00:05.482 [flora-malesiana] [qtp527446182-27609] INFO  e.e.c.r.controller.HttpStatusMessage - HTTP 404 : uuid not found
00:00:05.482 [flora-malesiana] [qtp527446182-27609] WARN  e.e.cdm.servlet.DateHeaderFilter - Can not add data header.
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.NullPointerException
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:981)
        at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:860)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
        at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:845)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
        at org.eclipse.jetty.servlet.ServletHolder$NotAsyncServlet.service(ServletHolder.java:1395)
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:755)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1617)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:316)
        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:126)
        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:90)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
        at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
        at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:122)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
        at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
        at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:169)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
        at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:48)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
        at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilterInternal(BasicAuthenticationFilter.java:158)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
        at org.springframework.security.oauth2.provider.authentication.OAuth2AuthenticationProcessingFilter.doFilter(OAuth2AuthenticationProcessingFilter.java:176)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
        at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:120)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
        at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:64)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
        at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:91)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
        at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:53)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
        at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:213)
        at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:176)
        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
        at eu.etaxonomy.cdm.servlet.DateHeaderFilter.doFilter(DateHeaderFilter.java:55)

can be reproduced with requrests like

http://localhost:8080/taxon/6eb85af1-b12b-48ba-8767-a77936261044/specimensOrObservationsCount

Associated revisions

Revision 679982a0 (diff)
Added by Andreas Kohlbecker about 2 months ago

fix #9185 catching and logging NPE and NestedSevletExecptions properly at appropriate levels

History

#1 Updated by Andreas Kohlbecker 10 months ago

can this minor problem be solved by changing the order in DateHeaderFilter.doFilter() like this?

@Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
            throws IOException, ServletException {

        chain.doFilter(request, response);
        // add date header at last 
        OffsetDateTime dateTime = OffsetDateTime.now();
        HttpServletResponse httpServletResponse = (HttpServletResponse) response;
        httpServletResponse.setHeader("Date", dateTime.format(DateTimeFormatter.RFC_1123_DATE_TIME));        
    }

#2 Updated by Andreas Kohlbecker about 2 months ago

  • Priority changed from New to Highest
  • Target version changed from Unassigned CDM tickets to Release 5.25

This error makes cdm-server log hardly readable, hence, it should be solved rather soon.

#3 Updated by Andreas Kohlbecker about 2 months ago

  • Description updated (diff)

#4 Updated by Andreas Kohlbecker about 2 months ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 50

#5 Updated by Andreas Kohlbecker about 2 months ago

review: scan logs

#6 Updated by Andreas Kohlbecker about 1 month ago

  • Status changed from Resolved to Closed
  • % Done changed from 50 to 100

no longer such NPEs in the logs

#7 Updated by Andreas Müller about 1 month ago

  • Target version changed from Release 5.25 to Release 5.23

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)