servicecomb-java-chassis icon indicating copy to clipboard operation
servicecomb-java-chassis copied to clipboard

servicecomb not support patchForObject

Open five111 opened this issue 4 years ago • 0 comments

使用RestTemplateBuilder.create()创建出来的restTemplate无法通过patchForObject发送patch请求

请求示例

restTemplate.patchForObject("cse://test-provider2/provider/tomcat/patch", httpEntity, Map.class);

异常如下

2021-12-02 10:08:18.361 ERROR 1008 --- [oup0-1-thread-1] o.a.s.c.h.impl.ProducerOperationHandler  : unexpected error operation=PRODUCER rest test-consumer2.helloConsumer.sayHello, message=null, cause=I/O error on PATCH request for "cse://test-provider2/provider/tomcat/patch": Null OutputStream is not a valid argument; nested exception is com.fasterxml.jackson.core.JsonGenerationException: Null OutputStream is not a valid argument

报错原因

org.apache.servicecomb.provider.springmvc.reference.CseClientHttpRequest 类的public OutputStream getBody() 这个方法return为null

five111 avatar Dec 02 '21 01:12 five111