Could not find acceptable representation
引起的原因:
由于设置了@ResponseBody,要把对象转换成json格式,缺少转换依赖的jar包,故此错。
解决办法:
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
</dependency>
加入依赖的jar,jackson-core-asl-1.9.12.jar,jackson-mapper-asl-1.9.12.jar问题解决。
参考博客:http://jadethao.iteye.com/blog/1926525
Could not find acceptable representation的更多相关文章
- spring使用jackson返回object报错:Handler execution resulted in exception: Could not find acceptable representation
问题:在springmvc中添加Jackson jar包返回Object类型,处理器方法的produces属性不写,默认根据类型,但如果指定了(错误原因)produces = "text/h ...
- 使用@ResponseBody 出现错误Could not find acceptable representation
org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representatio ...
- org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation
异常信息 org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable represen ...
- 关于"Could not find acceptable representation"错误
在项目中调用一个第三方服务,第三方服务是用Spring Boot写成的.结果调用时返回"Could not find acceptable representation"错误. 经 ...
- Springboot实体类转JSON报错Could not find acceptable representation & 设置访问项目根路径的默认欢迎页面
=================实体类转JSON报错的解决办法============= 之前在springmvc的时候也报过这个错,原因以及springmvc中解决办法参考:https://www ...
- 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 ...
- SpringMVC异常报406 (Not Acceptable)的解决办法
使用SpsringMVC,使用restEasy调试,controller请求设置如下: @RequestMapping(value="/list",method=RequestMe ...
随机推荐
- paip java.net.SocketException No buffer space available的解决办法及总结
java.net.SocketException No buffer space available的解决办法及总结 作者Attilax 艾龙, EMAIL:1466519819@qq.com 来 ...
- TF Boys (TensorFlow Boys ) 养成记(五)
有了数据,有了网络结构,下面我们就来写 cifar10 的代码. 首先处理输入,在 /home/your_name/TensorFlow/cifar10/ 下建立 cifar10_input.py,输 ...
- iOS开发之静态库(五)—— 图片、界面xib等资源文件封装到静态框架framework
编译环境:Macbook Air + OS X 10.9.2 + XCode5.1 + iPhone5s(iOS7.0.3) 一.首先将资源文件打包成bundle 由于bundle是静态的,所以可以将 ...
- static成员函数
1.static成员函数不能定义为const的,这是因为static成员函数只是全局函数的一个形式上的封装,而且static成员函数不能访问类的非静态成员(没有this)指针,修改非静态数据成员又从何 ...
- 为什么Android的图片质量会比iPhone的差?
经常看到有人问:“安卓版微信发出去的图片怎么那么渣!比iPhone的差远了!”.不只是微信,很多应用安卓版的图片质量就是要比iPhone版逊色很多,这到底是怎么回事? 我们团队最初也纠结 ...
- mysql 优化配置参数详解
在 my.cnf 文件中 各设置参数的含义如下: innodb_data_home_dir 这是InnoDB表的目录共用设置.如果没有在 my.cnf 进行设置,InnoDB 将使用MySQL的 da ...
- Lotus Domino中使用Xpage技术打造通讯录
我们来完成一个类似通讯录的功能,我们可以添加人员,查看和修改,删除人员,我们假设我们的通讯录中只记录人员的名字和年龄字段.先看看完成后的效果吧 点击New可以到新增人员页面,如下图: 编辑按钮后进入编 ...
- nginx+php部署
(1) 下载并安装nginx mkdir nginx-src && cd nginx-src wget http://nginx.org/download/nginx-1.7.3.ta ...
- ld: library not found for -lPods-AFNetworking
工程新添加了 AFNetworking 使用pod ,pod install 完成后,编译报错 ld: library not found for -lPods-AFNetworkingclang: ...
- Codeforces Round #292 (Div. 1) B. Drazil and Tiles 拓扑排序
B. Drazil and Tiles 题目连接: http://codeforces.com/contest/516/problem/B Description Drazil created a f ...