引起的原因: 
   由于设置了@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. Linux中ctrl-c, ctrl-z, ctrl-d 区别

    在Linux中: ctrl-c: ( kill foreground process )   发送 SIGINT 信号给前台进程组中的所有进程,强制终止程序的执行: ctrl-z: ( suspend ...

  2. pip 豆瓣镜像使用

    pip install -i https://pypi.douban.com/simple/ flask 要用https的 https://pip.pypa.io/en/latest/user_gui ...

  3. solr课程学习系列-solr的概念与结构(1)

    Solr是基于Lucene的采用Java5开发的一个高性能全文搜索服务器.源于lucene,却更比Lucene更为丰富更为强大的查询语言.同时实现了可配置.可扩展并对查询性能进行了优化,并且提供了一个 ...

  4. MS SQL SERVER索引优化相关查询

        查找缺失索引 -- =============================================   -- Description: 查询当前数据库中缺失的索引,知道你进行优化的 ...

  5. EWM 强大的数据修复功能

    在上了EWM系统后,运行一段时间可能因为不正确的操作,系统意外情况数据不一致的问题,交货单行项目状态不致,等等报不一致的情况,EWM的自检功能比较强. 下面介绍一种数据不致的修复工具之一,tx: /S ...

  6. C# 汉字转拼音 使用微软的Visual Studio International Pack 类库提取汉字拼音首字母

    代码参考该文http://www.cnblogs.com/yazdao/archive/2011/06/04/2072488.html VS2015版本 1.使用Nuget 安装 "Simp ...

  7. linux中ssh可以登录sftp不能登录解决办法

    我的服务器一直正常使用,平时使用secureCRT进行管理,使用secureFX进行文件的上传下载,突然有一天secureFX连接的时候出问题了,secureFX的日志如下: i SecureFX 版 ...

  8. IOS6屏幕旋转详解(自动旋转、手动旋转、兼容IOS6之前系统)

    转自 http://blog.csdn.net/zzfsuiye/article/details/8251060 概述: 在iOS6之前的版本中,通常使用 shouldAutorotateToInte ...

  9. .NET 4.6中的性能改进

    .NET 4.6中带来了一些与性能改进相关的CLR特性,这些特性中有一部分将会自动生效,而另外一些特性,例如SIMD与异步本地存储(Async Local Storage)则需要对编写应用的方式进行某 ...

  10. 老王教您怎么做cass7.1 8.0 9.1所有系列的复制狗 加密狗 破解狗

    cass7.1 8.0 9.1所有系列的复制狗 加密狗 破解狗本来是出于好奇看到网上有这样的东西,学了下感觉挺简单的,如果你是cass的初学者想仅仅是想学习这个软件,不想花大价格购买正版的,这个是可以 ...