MockMvc.perform() has thrown a NestedServletException

org.springframework.web.util.NestedServletException
Javadoc
Subclass of {@link ServletException} that properly handles a root cause in terms of message and stacktrace, just like NestedChecked/RuntimeException does.

Note that the plain ServletException doesn't expose its root cause at all, neither in the exception message nor in printed stack traces! While this might be fixed in later Servlet API variants (which even differ per vendor for the same API version), it is not reliably available on Servlet 2.4 (the minimum version required by Spring 3.x), which is why we need to do it ourselves.

The similarity between this class and the NestedChecked/RuntimeException class is unavoidable, as this class needs to derive from ServletException. @author Juergen Hoeller @since 1.2.5 @see #getMessage @see #printStackTrace @see org.springframework.core.NestedCheckedException @see org.springframework.core.NestedRuntimeException

at org.springframework.web.servlet.FrameworkServlet.processRequest
(source)
at org.springframework.web.servlet.FrameworkServlet.doPost
(source)
at javax.servlet.http.HttpServlet.service
(source)
at org.springframework.web.servlet.FrameworkServlet.service
(source)
at org.springframework.test.web.servlet.TestDispatcherServlet.service
(source)
at javax.servlet.http.HttpServlet.service
(source)
at org.springframework.mock.web.MockFilterChain$ServletFilterProxy.doFilter
(source)
at org.springframework.mock.web.MockFilterChain.doFilter
(source)
at org.springframework.test.web.servlet.MockMvc.perform
(source)
8 frames hidden

Typical Exception Messages

  1. Request processing failed; nested exception is org.dozer.MappingException: Source object must not be null
  2. Request processing failed; nested exception is java.lang.NullPointerException
  3. Request processing failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.time.LocalDate]: No default constructor found; nested exception is java.lang.NoSuchMethodException: java.time.LocalDate.<init>()
  4. Request processing failed; nested exception is org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; constraint [duplicate_entry]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement
  5. Request processing failed; nested exception is java.lang.ArrayStoreException: java.lang.Integer
  6. Request processing failed; nested exception is org.thymeleaf.exceptions.TemplateProcessingException: Error during execution of processor 'com.github.dandelion.thymeleaf.processor.BundleAttrProcessor' (layouts/blank:2)
  7. Request processing failed; nested exception is java.lang.StringIndexOutOfBoundsException: String index out of range: -8

Origin

MockFilterChain.doFilter() has thrown a NestedServletException

org.springframework.web.util.NestedServletException
7 frames hidden
org.springframework.mock.web.MockFilterChain.doFilter
7Web pages

Similar

Specific cases

External results for this pattern (6)

  1. Sam Jonesvia Stack Overflow3 months ago
    Request processing failed; nested exception is java.lang.NullPointerException
    Show stack trace
  2. valikvia Stack Overflow5 months ago
    Request processing failed; nested exception is java.lang.StringIndexOutOfBoundsException: String index out of range: -8
    Show stack trace
  3. Unknown authorvia nabble.com5 months ago
    Request processing failed; nested exception is org.thymeleaf.exceptions.TemplateProcessingException: Error during execution of processor 'com.github.dandelion.thymeleaf.processor.BundleAttrProcessor' (layouts/blank:2)
    Show stack trace
  4. LACvia Stack Overflow5 months ago
    Request processing failed; nested exception is org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; constraint [duplicate_entry]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement
    Show stack trace
  5. valikvia Stack Overflow7 months ago
    Request processing failed; nested exception is org.dozer.MappingException: Source object must not be null
    Show stack trace
  6. valikvia Stack Overflow7 months ago
    Request processing failed; nested exception is org.dozer.MappingException: Source object must not be null
    Show stack trace