使用@ResponseBody 出现错误Could not find acceptable representation
org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representatio
|
org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor.java:115) at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor.java:80) at org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.handleReturnValue(RequestResponseBodyMethodProcessor.java:94) at org.springframework.web.method.support.HandlerMethodReturnValueHandlerComposite.handleReturnValue(HandlerMethodReturnValueHandlerComposite.java:74) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:617) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:578) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789) at javax.servlet.http.HttpServlet.service(HttpServlet.java:755) at javax.servlet.http.HttpServlet.service(HttpServl ? ? 解决办法 为 ResponseBody 加上getter方法 |
http://www.rritw.com/a/bianchengyuyan/C__/20130605/322468.html
使用@ResponseBody 出现错误Could not find acceptable representation的更多相关文章
- SpringMVC @ResponseBody 415错误处理
在查看下面部分内容之前,请先检查你的请求蚕食是否正确,如果全部正确,请继续往下看 刚开始用SpringMVC, 页面要使用jQuery的ajax请求Controller. 但总是失败,主要表现为以下两 ...
- 关于"Could not find acceptable representation"错误
在项目中调用一个第三方服务,第三方服务是用Spring Boot写成的.结果调用时返回"Could not find acceptable representation"错误. 经 ...
- Springboot实体类转JSON报错Could not find acceptable representation & 设置访问项目根路径的默认欢迎页面
=================实体类转JSON报错的解决办法============= 之前在springmvc的时候也报过这个错,原因以及springmvc中解决办法参考:https://www ...
- spring使用jackson返回object报错:Handler execution resulted in exception: Could not find acceptable representation
问题:在springmvc中添加Jackson jar包返回Object类型,处理器方法的produces属性不写,默认根据类型,但如果指定了(错误原因)produces = "text/h ...
- 76. Spring Boot完美解决(406)Could not find acceptable representation原因及解决方法
[原创文章] 使用Spring Boot的Web项目,处理/login请求的控制器方法(该方法会返回JSON格式的数据).此时如果访问localhost:8080/login.html, ...
- SpringBoot导出excel数据报错Could not find acceptable representation
转自:https://blog.csdn.net/mate_ge/article/details/93518286?utm_source=distribute.pc_relevant.none-tas ...
- [排错] SpringBoot 警告 Could not find acceptable representation
环境 Java 1.8 SpringBoot 2.1.9 Java 接口代码 @ResponseBody @RequestMapping(value = "cloud", meth ...
- org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation
异常信息 org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable represen ...
- 添加 @ResponseBody出现错误的问题
maven配置: <dependency> <groupId>org.codehaus.jackson</groupId> <artifactId>ja ...
随机推荐
- Unity3D 之UGUI 图片
这里来降价下Unity3Dl的图片 先创建一个图片 图片的属性 Preserve Aspect -->保持图片的原始宽高比例 Set native Size -->图片原始尺寸 Image ...
- C#做的一个加密/解密的类
转自:http://www.16aspx.com/Article/3904 using System; using System.Security.Cryptography; using System ...
- EasyUI兼容IE问题
上网搜了下,发现说明白的解决方案不多,于是记录了一下: 根本原因是JQuery的版本造成IE8及以下兼容的问题,(由于EasyUI是基于JQuery框架的,而JQuery貌似从2013年为了简洁代码, ...
- c语言对于文本的基本操作
字符读写函数 :fgetc和fputc 字符串读写函数:fgets和fputs 数据块读写函数:freed和fwrite 格式化读写函数:fscanf和fprinf 1.字符读写: fgetc函 ...
- ORA-12011+ORA-06512–job执行失败问题
oracle库中的一个job,正常运行了一年多,因某种原因导致无法运行,系统尝试多次均失败之后下次执行时间就变成了 4000/1/1. 现导致job失败的问题已经解决,从新运行job时报 12011和 ...
- [转]SQL语句:Group By总结
1. Group By 语句简介: Group By语句从英文的字面意义上理解就是“根据(by)一定的规则进行分组(Group)”.它的作用是通过一定的规则将一个数据集划分成若干个小的区域,然后针对若 ...
- 04_过滤器Filter_02_Filter解决中文乱码问题
[过滤器解决中文乱码问题实例] [工程截图] [web.xml] <?xml version="1.0" encoding="UTF-8"?> &l ...
- URL重写 UrlRewrite
为什么要URL重写? 1.有利于SEO,带参数的URL权重较低: 2.地址看起来更正规,推广uid 伪静态:看起来像普通页面,而非动态生成的页面. 原理:在Global.asax的Applicatio ...
- wamp5 忘记mysql root密码 重置方法
wamp5比较恶心,忘记mysql root密码了,重新安装都没用,网上找了个文章可以修改root的密码. http://www.kuqin.com/database/20080306/4249.ht ...
- ARM 平台上的Linux系统启动流程
开始学习嵌入式开发就一直在使用Linux系统作为学习的平台,到现在无论是PC机还是ARM开发板都已经能顺利地跑起了Linux系统,但是对Linux 的启动流程还是不甚了解.于是开始各种百度谷歌,当然看 ...