admin管理员组文章数量:1316376
I am calling another api using RestTemplate but it return error Here is the code
@Autowired
private RestTemplate restTemplate;
@Override
public User getUser(String userId) {
User user = userRepository.findById(userId).orElseThrow(() -> new ResourceNotFoundException("User with give id is not found on server !! " + userId));
//fetch rating for the above user from the RATING SERVICE
String url = "http://localhost:8083/ratings/users/ab2573f5-1b25-41b3-b353-4eb40f995dd5";
Array forObject = restTemplate.getForObject(url, Array.class);
//httpMessageConverter.canRead()
logger.info("{}", forObject);
return user;
}
Exception is -
.springframework.web.client.UnknownContentTypeException: Could not extract response: no suitable HttpMessageConverter found for response type [class java.lang.reflect.Array] and content type [application/json]
at .springframework.web.client.HttpMessageConverterExtractor.extractData(HttpMessageConverterExtractor.java:133) ~[spring-web-6.2.1.jar:6.2.1]
at .springframework.web.client.RestTemplate.doExecute(RestTemplate.java:903) ~[spring-web-6.2.1.jar:6.2.1]
enter image description here
enter image description here
enter image description here
本文标签:
版权声明:本文标题:reactjs - no suitable HttpMessageConverter found for response type [class java.lang.reflect.Array] and content type [application 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741981840a2408442.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论