HttpServerErrorException$InternalServerError: 500

在做微服务是遇到下列的错误

HttpServerErrorException$InternalServerError: 500 :

排查了半天,发现一个奇妙的问题,如下

 Arttype arttype = restTemplate.getForObject(url, Arttype.class,key);
	@Nullable
    public <T> T getForObject(String url, Class<T> responseType, Object... uriVariables) throws RestClientException {
        RequestCallback requestCallback = this.acceptHeaderRequestCallback(responseType);
        HttpMessageConverterExtractor<T> responseExtractor = new HttpMessageConverterExtractor(responseType, this.getMessageConverters(), this.logger);
        return this.execute(url, HttpMethod.GET, requestCallback, responseExtractor, (Object[])uriVariables);
    }

发现直接报 500 错误,搞得我一脸懵逼
后来我改成这样

Arttype arttype = restTemplate.getForObject(url+key, Arttype.class);

就正常了,尼玛,有区别吗

你可能感兴趣的:(springcloud,问题集,java,restTemplate)