Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/379.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
RestEasy:javax.ws.rs.ProcessingException:GZIP输入超过最大大小:10000000_Java_Jax Rs_Gzip_Resteasy_Rest Client - Fatal编程技术网

RestEasy:javax.ws.rs.ProcessingException:GZIP输入超过最大大小:10000000

RestEasy:javax.ws.rs.ProcessingException:GZIP输入超过最大大小:10000000,java,jax-rs,gzip,resteasy,rest-client,Java,Jax Rs,Gzip,Resteasy,Rest Client,我试图读一个大的回应。我收到这个错误“javax.ws.rs.ProcessingException:RESTEASY003357:GZIP输入超过最大大小:10000000” 我们正在使用jaxrs WebTarget调用rest服务。如果响应很小,一切正常。如果反应是巨大的,我得到这个错误 javax.ws.rs.core.Response response = webTarget .register(CustomAcceptEncodingGZIPFilter.cl

我试图读一个大的回应。我收到这个错误“javax.ws.rs.ProcessingException:RESTEASY003357:GZIP输入超过最大大小:10000000”

我们正在使用jaxrs WebTarget调用rest服务。如果响应很小,一切正常。如果反应是巨大的,我得到这个错误

javax.ws.rs.core.Response response = webTarget
            .register(CustomAcceptEncodingGZIPFilter.class,999999998)
            .register(new CustomGZIPDecodingInterceptor(999999999),999999999)
            .register(CustomGZIPEncodingInterceptor.class, 999999997)
            .path(path)
            .request()
            .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
            .header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON)
            .get();
我试着按照你的建议解决这个问题。 不过,我还是无法解决这个问题

我得到了200个响应代码,但是在读取响应实体时,我得到了这个异常。 异常跟踪

javax.ws.rs.ProcessingException: RESTEASY003357: GZIP input exceeds max size: 10000000
    at org.jboss.resteasy.plugins.interceptors.GZIPDecodingInterceptor$FinishableGZIPInputStream.read(GZIPDecodingInterceptor.java:87)
    at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
    at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
    at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
    at java.io.InputStreamReader.read(InputStreamReader.java:184)
    at java.io.Reader.read(Reader.java:140)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

感谢您在servlet上下文“resteasy.gzip.max.input”中添加此参数解决了此问题

servletContext.setInitParameter("resteasy.gzip.max.input",
                    String.valueOf(Integer.MAX_VALUE));