Tag: resttemplate illegalargumentexception

IllegalArgumentException:RestTemplate没有足够的变量值吗?

我试图像这样使用RestTemplate执行URL – public static void main(String[] args) throws UnsupportedEncodingException { RestTemplate restTemplate = new RestTemplate(); String url = “http://ptr.vip.host.com/pss/repositories/pssdb/branches/main/query/Service[@alias=” + “hello” + “].serviceInstances.runsOn{@resourceId}?allowScan=true&limit=10000&skip=0”; try { String response = restTemplate.getForObject(url, String.class); System.out.println(response); } catch (RestClientException ex) { ex.printStackTrace(); } } 但每次我都会收到这样的错误 – Exception in thread “main” java.lang.IllegalArgumentException: Not enough variable values available to expand ‘@resourceId’ at […]