网站建设资讯

NEWS

网站建设资讯

Springboot中使用actuator工具时报Couldnotfindacceptablerepresentation怎么办

这篇文章主要介绍“Springboot中使用actuator工具时报Could not find acceptable representation怎么办”,在日常操作中,相信很多人在Springboot中使用actuator工具时报Could not find acceptable representation怎么办问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”Springboot中使用actuator工具时报Could not find acceptable representation怎么办”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!

创新互联公司主要从事网站建设、网站设计、网页设计、企业做网站、公司建网站等业务。立足成都服务坪山,十年网站建设经验,价格优惠、服务专业,欢迎来电咨询建站服务:18980820575

造成这种结果的原因是 ,Spring无法找到合适的视图解析器  。

网上找了一圈都是说其他原因的解决方法。

自己debug一遍 ,其实很简单。

由于我的项目使用了fastjsonConfig , 又指定了唯一的MediaType 为json ,

而actuator 需要的mediaType是 application/vnd.spring-boot.actuator.v2+json

所以添加mediaType即可

FastJsonHttpMessageConverter

 Springboot中使用actuator工具时报Could not find acceptable representation怎么办

到此,关于“Springboot中使用actuator工具时报Could not find acceptable representation怎么办”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注创新互联网站,小编会继续努力为大家带来更多实用的文章!


当前名称:Springboot中使用actuator工具时报Couldnotfindacceptablerepresentation怎么办
文章网址:http://cdweb.net/article/pishdc.html