org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/json;charset=UTF-8' not supported

Stack Overflow | ray | 3 months ago
tip
Do you find the tips below useful? Click on the to mark them and say thanks to rafael . Or join the community to write better ones.
  1. 0
    samebug tip
    Check if your DTO has a default constructor with getters and setters. Check as well if you have more than one @JsonBackReference in the same class and if there's a @JsonManagedReference that matches it!
  2. 0

    Jaxb2CollectionHttpMessageConverter:explaination+usage?

    Coderanch | 4 years ago | H Paul
    org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/xml;charset=UTF-8' not supported
  3. 0
    samebug tip
    You cannot modify the headers of HttpEntity once it has been instantiated. You need to pass the headers to the constructor. If you need an example, look at this page: https://goo.gl/ZOxuRY
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    @RequestMapping Content-Type error when a @RequestBody is used but Content-Type header is not given

    GitHub | 2 years ago | lewisdavidcole
    org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/octet-stream' not supported
  6. 0
    samebug tip
    FileUpload is hard coded to only accept POST, not PUT. You can either override the isMultipartContent to work how you like or you can use a POST.

  1. qavid 2 times, last 9 months ago
13 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.HttpMediaTypeNotSupportedException

    Content type 'application/json;charset=UTF-8' not supported

    at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodArgumentResolver.readWithMessageConverters()
  2. Spring MVC
    RequestResponseBodyMethodProcessor.resolveArgument
    1. org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodArgumentResolver.readWithMessageConverters(AbstractMessageConverterMethodArgumentResolver.java:237)
    2. org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.readWithMessageConverters(RequestResponseBodyMethodProcessor.java:150)
    3. org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.resolveArgument(RequestResponseBodyMethodProcessor.java:128)
    3 frames
  3. Spring
    InvocableHandlerMethod.invokeForRequest
    1. org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:121)
    2. org.springframework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:160)
    3. org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:129)
    3 frames
  4. Spring MVC
    FrameworkServlet.doPost
    1. org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:116)
    2. org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
    3. org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
    4. org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
    5. org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)
    6. org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)
    7. org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
    8. org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
    8 frames
  5. JavaServlet
    HttpServlet.service
    1. javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
    1 frame
  6. Spring MVC
    FrameworkServlet.service
    1. org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
    1 frame
  7. JavaServlet
    HttpServlet.service
    1. javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    1 frame
  8. Glassfish Core
    ApplicationFilterChain.doFilter
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    2 frames
  9. Tomcat WS
    WsFilter.doFilter
    1. org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    1 frame
  10. Glassfish Core
    CoyoteAdapter.service
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    3. org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
    4. org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:108)
    5. org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    6. org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
    7. org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
    8. org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
    9. org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
    10. org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
    10 frames
  11. Grizzly HTTP
    SocketProcessorBase.run
    1. org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:784)
    2. org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    3. org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:802)
    4. org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1410)
    5. org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    5 frames
  12. Java RT
    ThreadPoolExecutor$Worker.run
    1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    2 frames
  13. Tomcat Util
    TaskThread$WrappingRunnable.run
    1. org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    1 frame
  14. Java RT
    Thread.run
    1. java.lang.Thread.run(Thread.java:745)
    1 frame