当前位置:   article > 正文

feign 服务间调用异常,feign.codec.DecodeException: Could not extract response: no suitable HttpMessageConver

feign.codec.decodeexception: could not extract response

feign.codec.DecodeException: Could not extract response: no suitable HttpMessageConverter found for response type [] and content type [text/html;charset=UTF-8]

这是由于微服务添加spring-security-oauth2-autoconfigure导致调用微服务401unauthorised

 try {
            String token = SecurityUtil.getToken(httpServletRequest);
            Class<RedisTokenStore> redisTokenStoreClass = RedisTokenStore.class;
            redisTokenStoreClass.getDeclaredMethod("removeAccessToken", String.class).invoke(redisTokenStoreClass.newInstance(), token);
        } catch (Exception e) {
            e.printStackTrace();
        }
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

在项目中一个微服务的业务代码中加上以上会需要依赖一下依赖,但在微服务加入这个依赖会导致其他服务调用这个服务会出现401unauthorised未授权的情况,谨慎添加,至于关闭的方法还在研究中,或者用在业务使用rabbitmq队列进行异步解耦操作。
在微服务加入这个依赖会导致其他服务调用这个服务会出现未授权的情况,谨慎添加

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/代码探险家/article/detail/813931
推荐阅读
相关标签
  

闽ICP备14008679号