Project

General

Profile

Actions

bug #9185

closed

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

Added by Andreas Kohlbecker almost 4 years ago. Updated about 3 years ago.

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

100%

Estimated time:
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

Actions #1

Updated by Andreas Kohlbecker almost 4 years 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));        
    }
Actions #2

Updated by Andreas Kohlbecker about 3 years 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.

Actions #3

Updated by Andreas Kohlbecker about 3 years ago

  • Description updated (diff)
Actions #4

Updated by Andreas Kohlbecker about 3 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 50
Actions #5

Updated by Andreas Kohlbecker about 3 years ago

review: scan logs

Actions #6

Updated by Andreas Kohlbecker about 3 years ago

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

no longer such NPEs in the logs

Actions #7

Updated by Andreas Müller about 3 years ago

  • Target version changed from Release 5.25 to Release 5.23
Actions

Also available in: Atom PDF