org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation

Stack Overflow | Nick Div | 5 months ago
  1. 0

    Spring @ExceptionHandler test gets invoked but instead of error body it re-throws the Exception using Mockito

    Stack Overflow | 5 months ago | Nick Div
    org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation
  2. 0

    Spring @ExceptionHandler and HttpMediaTypeNotAcceptableException

    Stack Overflow | 1 year ago | Lia
    org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation
  3. 0

    Spring MVC with Jackson 2.2: "HttpMediaTypeNotAcceptableException: Could not find acceptable representation"

    Stack Overflow | 3 years ago | Michael De Keyser
    org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Spring Rest and Jsonp

    Stack Overflow | 2 years ago | Damien Gallagher
    org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation
  6. 0

    Spring 3.2 @ExceptionHandler @ResponseBody JSON Response Via Jackson

    Stack Overflow | 2 years ago | Alind Billore
    org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation

  1. qavid 1 times, last 6 months ago
8 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. org.springframework.web.HttpMediaTypeNotAcceptableException

    Could not find acceptable representation

    at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters()
  2. Spring MVC
    RequestResponseBodyMethodProcessor.handleReturnValue
    1. org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor.java:251)
    2. org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor.java:153)
    3. org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.handleReturnValue(RequestResponseBodyMethodProcessor.java:165)
    3 frames
  3. Spring
    HandlerMethodReturnValueHandlerComposite.handleReturnValue
    1. org.springframework.web.method.support.HandlerMethodReturnValueHandlerComposite.handleReturnValue(HandlerMethodReturnValueHandlerComposite.java:81)
    1 frame
  4. Spring MVC
    DispatcherServlet.processHandlerException
    1. org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:126)
    2. org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver.doResolveHandlerMethodException(ExceptionHandlerExceptionResolver.java:363)
    3. org.springframework.web.servlet.handler.AbstractHandlerMethodExceptionResolver.doResolveException(AbstractHandlerMethodExceptionResolver.java:60)
    4. org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver.resolveException(AbstractHandlerExceptionResolver.java:137)
    5. org.springframework.web.servlet.handler.HandlerExceptionResolverComposite.resolveException(HandlerExceptionResolverComposite.java:74)
    6. org.springframework.web.servlet.DispatcherServlet.processHandlerException(DispatcherServlet.java:1185)
    6 frames
  5. Spring TestContext
    TestDispatcherServlet.processHandlerException
    1. org.springframework.test.web.servlet.TestDispatcherServlet.processHandlerException(TestDispatcherServlet.java:109)
    1 frame
  6. Spring MVC
    FrameworkServlet.doGet
    1. org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1022)
    2. org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:973)
    3. org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:895)
    4. org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967)
    5. org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:858)
    5 frames
  7. JavaServlet
    HttpServlet.service
    1. javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
    1 frame
  8. Spring MVC
    FrameworkServlet.service
    1. org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843)
    1 frame
  9. Spring TestContext
    TestDispatcherServlet.service
    1. org.springframework.test.web.servlet.TestDispatcherServlet.service(TestDispatcherServlet.java:62)
    1 frame
  10. JavaServlet
    HttpServlet.service
    1. javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
    1 frame
  11. Spring TestContext
    MockMvc.perform
    1. org.springframework.mock.web.MockFilterChain$ServletFilterProxy.doFilter(MockFilterChain.java:170)
    2. org.springframework.mock.web.MockFilterChain.doFilter(MockFilterChain.java:137)
    3. org.springframework.test.web.servlet.MockMvc.perform(MockMvc.java:141)
    3 frames
  12. Unknown
    RestControllerTest.thatExceptionHappens
    1. RestControllerTest.thatExceptionHappens(RestControllerTest.java:90)
    1 frame
  13. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    4. java.lang.reflect.Method.invoke(Method.java:606)
    4 frames
  14. JUnit
    ParentRunner.run
    1. org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
    2. org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    3. org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
    4. org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    5. org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
    6. org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
    7. org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
    8. org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
    9. org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
    10. org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
    11. org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
    12. org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
    13. org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
    14. org.junit.runners.ParentRunner.run(ParentRunner.java:309)
    14 frames
  15. Mockito
    MockitoJUnitRunner.run
    1. org.mockito.internal.runners.JUnit45AndHigherRunnerImpl.run(JUnit45AndHigherRunnerImpl.java:37)
    2. org.mockito.runners.MockitoJUnitRunner.run(MockitoJUnitRunner.java:62)
    2 frames
  16. JUnit
    JUnitCore.run
    1. org.junit.runner.JUnitCore.run(JUnitCore.java:160)
    1 frame
  17. IntelliJ junit4 module
    JUnit4IdeaTestRunner.startRunnerWithArgs
    1. com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:119)
    2. com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42)
    2 frames
  18. IDEA
    JUnitStarter.main
    1. com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:234)
    2. com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:74)
    2 frames