引起的原因: 
   由于设置了@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的更多相关文章

  1. spring使用jackson返回object报错:Handler execution resulted in exception: Could not find acceptable representation

    问题:在springmvc中添加Jackson jar包返回Object类型,处理器方法的produces属性不写,默认根据类型,但如果指定了(错误原因)produces = "text/h ...

  2. 使用@ResponseBody 出现错误Could not find acceptable representation

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

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

    异常信息 org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable represen ...

  4. 关于"Could not find acceptable representation"错误

    在项目中调用一个第三方服务,第三方服务是用Spring Boot写成的.结果调用时返回"Could not find acceptable representation"错误. 经 ...

  5. Springboot实体类转JSON报错Could not find acceptable representation & 设置访问项目根路径的默认欢迎页面

    =================实体类转JSON报错的解决办法============= 之前在springmvc的时候也报过这个错,原因以及springmvc中解决办法参考:https://www ...

  6. 76. Spring Boot完美解决(406)Could not find acceptable representation原因及解决方法

    [原创文章]        使用Spring Boot的Web项目,处理/login请求的控制器方法(该方法会返回JSON格式的数据).此时如果访问localhost:8080/login.html, ...

  7. SpringBoot导出excel数据报错Could not find acceptable representation

    转自:https://blog.csdn.net/mate_ge/article/details/93518286?utm_source=distribute.pc_relevant.none-tas ...

  8. [排错] SpringBoot 警告 Could not find acceptable representation

    环境 Java 1.8 SpringBoot 2.1.9 Java 接口代码 @ResponseBody @RequestMapping(value = "cloud", meth ...

  9. SpringMVC异常报406 (Not Acceptable)的解决办法

    使用SpsringMVC,使用restEasy调试,controller请求设置如下: @RequestMapping(value="/list",method=RequestMe ...

随机推荐

  1. 在Debian下安装LAMP

    准备工作: 1 sudo apt-get install build-essential 第一步:安装Apache 1 sudo apt-get install apache2 第二步:安装MySQL ...

  2. paip.环境配置整合 ibatis mybatis proxool

    paip.环境配置整合 ibatis mybatis proxool  索引: ///////////1.调用 ///////////////2. ibatis 主设置文件  com/mijie/ho ...

  3. Windows环境下32位汇编语言程序设计(典藏版)

    Windows环境下32位汇编语言程序设计(典藏版)(含CD光盘1张)(年,经典再现!) 罗云彬 著 ISBN 978-7-121-20759-4 2013年7月出版 定价:99.00元 756页 1 ...

  4. 海康威视 NET_DVR_FindNextFile 的错误

    public struct NET_DVR_FIND_DATA { [MarshalAs(UnmanagedType.ByValTStr, SizeConst = )] /// <summary ...

  5. 一个jsonp的简单实例

    <script type="text/javascript"> //添加<script>标签的方法 function addScriptTag(src){ ...

  6. Android 的EditText实现不可编辑

    android:editable is deprecated: Use an <EditText> to make it editable android:editable is depr ...

  7. [转]揭秘webdriver实现原理

    转自:http://www.cnblogs.com/timsheng/archive/2012/06/12/2546957.html 通过研究selenium-webdriver的源码,笔者发现其实w ...

  8. Java 时间和字符换的处理

    /** * * @param timeStr 时间字符串 * @param diff 与起始值差距,单位为毫秒 * @throws ParseException */ public String de ...

  9. Python字符串的修改以及传参

    前两天去面试web developer,面试官提出一个问题,用JavaScript或者Python实现字符串反转,我选择了Python,然后写出了代码(错误的): #!/usr/bin/env pyt ...

  10. 用C++为nodejs 写组件,提高node处理效率

    昨天研究了下如何用C++和node交互,在node的程序中,如果有大数据量的计算,处理起来比较慢,可以用C++来处理,然后通过回调(callback的形式),返回给node. 首先,先来看看node ...