feign 服务间调用异常,feign.codec.DecodeException: Could not extract response: no suitable HttpMessageConver
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-autoconfi
·
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();
}
在项目中一个微服务的业务代码中加上以上会需要依赖一下依赖,但在微服务加入这个依赖会导致其他服务调用这个服务会出现401unauthorised未授权的情况,谨慎添加,至于关闭的方法还在研究中,或者用在业务使用rabbitmq队列进行异步解耦操作。
更多推荐
已为社区贡献1条内容
所有评论(0)