最后找到我的问题,springmvc配置文件中没加 <mvc:annotation-driven/>

java代码:

@RequestMapping(value="/requestJsonResposeJson",method=RequestMethod.POST,produces={"application/json;charset=UTF-8"})
  public @ResponseBody TestSupervisorCustomer  requestJsonResposeJson(@RequestBody TestJson testJson) throws Exception

restclient测试的:

错误信息:

org.springframework.web.servlet.DispatcherServlet]DispatcherServlet with name 'springMvc' processing POST request for [/NongyeInfo/userContoller/requestJsonResposeJson.do]
[org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping]Matching patterns for request [/userContoller/requestJsonResposeJson.do] are [/userContoller/requestJsonResposeJson.*]
[org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping]URI Template variables for request [/userContoller/requestJsonResposeJson.do] are {}
[org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping]Mapping [/userContoller/requestJsonResposeJson.do] to HandlerExecutionChain with handler [slc.controller.UserContoller@3c655b15] and 1 interceptor
[org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver]Resolving exception from handler [slc.controller.UserContoller@3c655b15]: org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/json;charset=UTF-8' not supported
[org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver]Resolving exception from handler [slc.controller.UserContoller@3c655b15]: org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/json;charset=UTF-8' not supported
[org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver]Resolving exception from handler [slc.controller.UserContoller@3c655b15]: org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/json;charset=UTF-8' not supported
[org.springframework.web.servlet.DispatcherServlet]Null ModelAndView returned to DispatcherServlet with name 'springMvc': assuming HandlerAdapter completed request handling
[org.springframework.web.servlet.DispatcherServlet]Successfully completed request
[org.springframework.beans.factory.support.DefaultListableBeanFactory]Returning cached instance of singleton bean 'sqlSessionFactory'

org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/json;charset=UTF-8' not supported的更多相关文章

  1. org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/json;charset=UTF-8' not supported或其他Content type不支持处理

    很久没从头到尾搭框架,今天搭的过程中,springmvc controller方法入参用@RequestBody自动绑定参数时一直提示各种 not supported 排查问题有两个解决路径: 1)使 ...

  2. ajax使用向Spring MVC发送JSON数据出现 org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported错误

    ajax使用向Spring MVC发送JSON数据时,后端Controller在接受JSON数据时报org.springframework.web.HttpMediaTypeNotSupportedE ...

  3. Content type 'application/json;charset=UTF-8' not supported异常的解决过程

    首先说一下当时的场景,其实就是一个很简单的添加操作,后台传递的值是json格式的,如下图 ,后台对应的实体类, @Data @EqualsAndHashCode(callSuper = false) ...

  4. org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'multipart/form-data;boundary=----WebKitFormBoundaryRAYPKeHKTYSNdzc1;charset=UTF-8' not supported

    原文:https://www.cnblogs.com/yueli/p/7552888.html 最近同事在做一个图片上传功能.在入参 body 中同时传入文件和其它基本信息结果出现如题异常.在此记录下 ...

  5. SpringMVC在使用JSON时报错信息为:Content type 'application/json;charset=UTF-8' not supported

    直接原因是:我的(maven)项目parent父工程pom.xml缺少必要的三个jar包依赖坐标. 解决方法是:在web子模块的pom.xml里面添加springMVC使用JSON实现AJAX请求. ...

  6. jmeter报"msg":"Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported"的解决方法

    1.报"msg":"Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supporte ...

  7. Jmeter发送post请求报错Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported

    常识普及: Content-type,在Request Headers里面,告诉服务器,我们发送的请求信息格式,在JMeter中,信息头存储在信息头管理器中,所以在做接口测试的时候,我们维护Conte ...

  8. Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported

    Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported告诉你,你的请求头是application/x- ...

  9. 接入WxPusher微信推送服务出现错误:Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported

    背景 使用WxPusher微信推送服务 ,可以及时的将服务的一些运行异常信息,发送到自己的微信上,方便了解服务的运行状态(PS:这个服务是免费的). 你可以在这里看到WxPusher微信推送服务的接入 ...

随机推荐

  1. Centos,tomcat

    1.下载tomcat9.0,解压,配置 wget https://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-9/v9.0.21/bin/apa ...

  2. 转载:对比Angular/jQueryUI/Extjs:没有一个框架是万能的

    Angular不能做什么?对比Angular/jQueryUI/Extjs 框架就好比兵器,你得明白你手里拿的是屠龙刀还是倚天剑,刀法主要是砍,剑法主要是刺.对于那些职业喷子和脑残粉,小僧送你们两个字 ...

  3. 【Java 其他】Java opencv配置及测试

    毕竟研究生做cv,所以这里还是测试一下java上使用opencv,参考 这里 import org.opencv.core.Core; import org.opencv.core.CvType; i ...

  4. 【Java学习笔记】2015.1.5

    1.classpath中的“.”表示当前的路径,所以配置classpath时要注意不能忘了“.”.如果不注意,会出现cmd下运行程序时,.java文件可以编译但是不能运行: 一般的classpath配 ...

  5. 总结web开发的四大域

    一.HttpSession域: 1.作用域范围: 一次会话. 数据产生后,使用后,如果还需要继续使用的情况下,HttpSession域 2.HttpSession作用: 在第一次调用request.g ...

  6. js 对象属性和使用方法学习笔记

    对象的引用 在ECMAScriipt中,不能访问对象的物理表示,只能访问对象的引用.每次创建对象,存储在变量中的都是对象的引用,而不是对象本身. 对象的废除 ECMASript拥有无用存储单元收集程序 ...

  7. Ubuntu如何安装谷歌Chrome浏览器

    这里提供一个Ubuntu安装谷歌浏览器的简单方法. 1. 下载谷歌浏览器安装包 wget https://dl.google.com/linux/direct/google-chrome-stable ...

  8. python读取配置文件(ini、yaml、xml)

    python读取配置文件(ini.yaml.xml)  

  9. UNP学习 Unix域协议

    Unix域协议并不是一个实际的协议族,它只是在同一台主机上进行客户-服务器通信时,使用与在不同主机上的客户和服务器间通信时相同的API的一种方法. 当客户和服务器在同一台主机上时,Unix域协议是这套 ...

  10. Maven进行自动构建

    一个很常见的错误就是路径问题,要把jdk放到java工程的路径里,之前一直默认是jre https://blog.csdn.net/lslk9898/article/details/73836745  ...