Root Cause Exception Filter

Issue #2211 resolved
Stephan Doerfel created an issue

We often have an Exception A caused by Exception B. While we do not want to filter A in general we might want to filter those that are caused by B. Write a RootCauseExceptionFilter and add it to bibsonomy-util. there is already the BibSonomy Util / src / main / java / org / bibsonomy / util / log4j / filter / ExceptionFilter.java that can serve as an example. Write a second Filter that only allows Exceptions that have that root cause and filters everything else.

Notify a senior to update bibsonomy-util on all machines. We need this because this exception very often occurs in our log and should be put elsewhere

An Example for the case described above is: [2014-10-04 21:30:10,683] [ERROR] [org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/bibsonomy-webapp].[bibsonomy2]] - Servlet.service() for servlet bibsonomy2 threw exception java.lang.RuntimeException: org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.web.multipart.MultipartException: Could not parse multipart servlet request; nested exception is org.apache.commons.fileupload.FileUploadException: Stream ended unexpectedly at ... Caused by: org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.web.multipart.MultipartException: Could not parse multipart servlet request; nested exception is org.apache.commons.fileupload.FileUploadException: Stream ended unexpectedly at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.bibsonomy.webapp.filters.ContextPathFilter.doFilter(ContextPathFilter.java:162) ... 19 more Caused by: org.springframework.web.multipart.MultipartException: Could not parse multipart servlet request; nested exception is org.apache.commons.fileupload.FileUploadException: Stream ended unexpectedly at org.springframework.web.multipart.commons.CommonsMultipartResolver.parseRequest(CommonsMultipartResolver.java:163) at org.springframework.web.multipart.commons.CommonsMultipartResolver.resolveMultipart(CommonsMultipartResolver.java:139) at org.springframework.web.servlet.DispatcherServlet.checkMultipart(DispatcherServlet.java:1020) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:883) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882) ... 86 more Caused by: org.apache.commons.fileupload.FileUploadException: Stream ended unexpectedly at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:369)

Comments (3)

  1. Stephan Doerfel reporter

    added the filter as CausedByExceptionFilter to bibsonomy-util TODO: deploy on bibsonomy

  2. Log in to comment