You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by maistrovyi May 31, 2024
I'm facing with issue:
Caused by: java.lang.NegativeArraySizeException: -1
at org.zalando.logbook.httpclient5.LocalRequest$Offering.buffer(LocalRequest.java:85)
at org.zalando.logbook.httpclient5.LocalRequest.lambda$getBody$3(LocalRequest.java:244)
at org.zalando.fauxpas.ThrowingFunction.apply(ThrowingFunction.java:19)
at java.base/java.util.concurrent.atomic.AtomicReference.updateAndGet(AtomicReference.java:210)
at org.zalando.logbook.httpclient5.LocalRequest.getBody(LocalRequest.java:243)
at org.zalando.logbook.HttpMessage.getBodyAsString(HttpMessage.java:44)
at org.zalando.logbook.ForwardingHttpMessage.getBodyAsString(ForwardingHttpMessage.java:47)
at org.zalando.logbook.FilteredHttpRequest.getBodyAsString(FilteredHttpRequest.java:84)
at org.zalando.logbook.DefaultHttpLogFormatter.format(DefaultHttpLogFormatter.java:26)
at org.zalando.logbook.Strategy.write(Strategy.java:69)
at org.zalando.logbook.DefaultLogbook$1.write(DefaultLogbook.java:43)
at org.zalando.logbook.httpclient5.LogbookHttpRequestInterceptor.process(LogbookHttpRequestInterceptor.java:25)
at org.apache.hc.core5.http.protocol.DefaultHttpProcessor.process(DefaultHttpProcessor.java:107)
at org.apache.hc.client5.http.impl.async.HttpAsyncMainClientExec$1.produceRequest(HttpAsyncMainClientExec.java:148)
at org.apache.hc.core5.http.impl.nio.ClientHttp1StreamHandler.produceOutput(ClientHttp1StreamHandler.java:183)
at org.apache.hc.core5.http.impl.nio.ClientHttp1StreamDuplexer.execute(ClientHttp1StreamDuplexer.java:326)
at org.apache.hc.core5.http.impl.nio.AbstractHttp1StreamDuplexer.processCommands(AbstractHttp1StreamDuplexer.java:239)
at org.apache.hc.core5.http.impl.nio.AbstractHttp1StreamDuplexer.onConnect(AbstractHttp1StreamDuplexer.java:251)
at org.apache.hc.core5.http.impl.nio.AbstractHttp1IOEventHandler.connected(AbstractHttp1IOEventHandler.java:55)
at org.apache.hc.core5.http.impl.nio.ClientHttp1IOEventHandler.connected(ClientHttp1IOEventHandler.java:41)
at org.apache.hc.core5.http2.impl.nio.ClientHttp1UpgradeHandler.upgrade(ClientHttp1UpgradeHandler.java:63)
at org.apache.hc.core5.reactor.InternalDataChannel.switchProtocol(InternalDataChannel.java:420)
at org.apache.hc.core5.http2.impl.nio.HttpProtocolNegotiator.startProtocol(HttpProtocolNegotiator.java:77)
at org.apache.hc.core5.http2.impl.nio.HttpProtocolNegotiator.connected(HttpProtocolNegotiator.java:101)
at org.apache.hc.core5.reactor.InternalDataChannel.onIOEvent(InternalDataChannel.java:132)
at org.apache.hc.core5.reactor.InternalChannel.handleIOEvent(InternalChannel.java:51)
The text was updated successfully, but these errors were encountered:
@maistrovyi could you provide more details about the issue? An example repository where it's reproducible would be great to have. As well as Logbook version you used and steps to reproduce.
@kasmarian hey, for sure, here is our lab
All versions are available in pom.xml, but i've checked that on different versions (same as spring boot 2.7.18 and logbook 2.16.0) - with async httpclient5 behaviour logbook response consuming failed with: java.lang.NegativeArraySizeException: -1
Another point is to update documentation maybe that we mandatory need instantiate HttpContext by ourself like: client.execute(requestProducer, responseConsumer, HttpClientContext.create(), new FutureCallback...
if no we will faced with: Cannot invoke "org.apache.hc.core5.http.protocol.HttpContext.getAttribute(String)" because "context" is null, what is actually logical.
NB: actually, i've implemented my own temporary solution with custom LogbookAsyncResponseCallback implements FutureCallback<SimpleHttpResponse>, let me know if you need details
Discussed in #1853
Originally posted by maistrovyi May 31, 2024
I'm facing with issue:
The text was updated successfully, but these errors were encountered: