Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClassCastException in PausableHttpPostRequestEncoder for custom encoder-mode in configuration #37261

Closed
luca-bassoricci opened this issue Nov 22, 2023 · 0 comments · Fixed by #37262
Labels
env/windows Impacts Windows machines kind/bug Something isn't working
Milestone

Comments

@luca-bassoricci
Copy link
Contributor

luca-bassoricci commented Nov 22, 2023

Describe the bug

Using multipart and quarkus.rest-client.multipart-post-encoder-mode in client side leads to ClassCastException

Expected behavior

No errors

Actual behavior

java.lang.ClassCastException: class io.netty.handler.codec.http.multipart.HttpPostRequestEncoder$EncoderMode cannot be cast to class org.jboss.resteasy.reactive.client.impl.multipart.PausableHttpPostRequestEncoder$EncoderMode (io.netty.handler.codec.http.multipart.HttpPostRequestEncoder$EncoderMode and org.jboss.resteasy.reactive.client.impl.multipart.PausableHttpPostRequestEncoder$EncoderMode are in unnamed module of loader io.quarkus.bootstrap.classloading.QuarkusClassLoader @545b995e)
	at org.jboss.resteasy.reactive.client.handlers.ClientSendRequestHandler.setMultipartHeadersAndPrepareBody(ClientSendRequestHandler.java:464)
	at org.jboss.resteasy.reactive.client.handlers.ClientSendRequestHandler$1.accept(ClientSendRequestHandler.java:103)
	at org.jboss.resteasy.reactive.client.handlers.ClientSendRequestHandler$1.accept(ClientSendRequestHandler.java:93)
	at io.smallrye.context.impl.wrappers.SlowContextualConsumer.accept(SlowContextualConsumer.java:21)
	at io.smallrye.mutiny.helpers.UniCallbackSubscriber.onItem(UniCallbackSubscriber.java:73)
	at io.smallrye.mutiny.operators.uni.UniOnItemTransformToUni$UniOnItemTransformToUniProcessor.onItem(UniOnItemTransformToUni.java:60)
	at org.jboss.resteasy.reactive.client.AsyncResultUni.lambda$subscribe$1(AsyncResultUni.java:35)
	at io.vertx.core.impl.future.FutureImpl$3.onSuccess(FutureImpl.java:141)
	at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:60)
	at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:211)
	at io.vertx.core.impl.future.PromiseImpl.tryComplete(PromiseImpl.java:23)
	at io.vertx.core.http.impl.HttpClientImpl.lambda$null$5(HttpClientImpl.java:683)
	at io.vertx.core.impl.future.FutureImpl$3.onSuccess(FutureImpl.java:141)
	at io.vertx.core.impl.future.FutureBase.lambda$emitSuccess$0(FutureBase.java:54)
	at io.vertx.core.impl.EventLoopContext.execute(EventLoopContext.java:86)
	at io.vertx.core.impl.DuplicatedContext.execute(DuplicatedContext.java:184)
	at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:51)
	at io.vertx.core.impl.future.FutureImpl.addListener(FutureImpl.java:196)
	at io.vertx.core.impl.future.PromiseImpl.addListener(PromiseImpl.java:23)
	at io.vertx.core.impl.future.FutureImpl.onComplete(FutureImpl.java:164)
	at io.vertx.core.impl.future.PromiseImpl.onComplete(PromiseImpl.java:23)
	at io.vertx.core.http.impl.Http1xClientConnection.createStream(Http1xClientConnection.java:1271)
	at io.vertx.core.http.impl.HttpClientImpl.lambda$doRequest$6(HttpClientImpl.java:666)
	at io.vertx.core.net.impl.pool.Endpoint.lambda$getConnection$0(Endpoint.java:52)
	at io.vertx.core.http.impl.SharedClientHttpStreamEndpoint$Request.handle(SharedClientHttpStreamEndpoint.java:162)
	at io.vertx.core.http.impl.SharedClientHttpStreamEndpoint$Request.handle(SharedClientHttpStreamEndpoint.java:123)
	at io.vertx.core.impl.EventLoopContext.emit(EventLoopContext.java:55)
	at io.vertx.core.impl.ContextBase.emit(ContextBase.java:297)
	at io.vertx.core.net.impl.pool.SimpleConnectionPool$LeaseImpl.emit(SimpleConnectionPool.java:715)
	at io.vertx.core.net.impl.pool.SimpleConnectionPool$ConnectSuccess$2.run(SimpleConnectionPool.java:338)
	at io.vertx.core.net.impl.pool.Task.runNextTasks(Task.java:43)
	at io.vertx.core.net.impl.pool.CombinerExecutor.submit(CombinerExecutor.java:82)
	at io.vertx.core.net.impl.pool.SimpleConnectionPool.execute(SimpleConnectionPool.java:245)
	at io.vertx.core.net.impl.pool.SimpleConnectionPool.lambda$connect$2(SimpleConnectionPool.java:257)
	at io.vertx.core.http.impl.SharedClientHttpStreamEndpoint.lambda$connect$2(SharedClientHttpStreamEndpoint.java:102)
	at io.vertx.core.impl.future.FutureImpl$3.onSuccess(FutureImpl.java:141)
	at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:60)
	at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:211)
	at io.vertx.core.impl.future.Composition$1.onSuccess(Composition.java:62)
	at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:60)
	at io.vertx.core.impl.future.FutureImpl.addListener(FutureImpl.java:196)
	at io.vertx.core.impl.future.PromiseImpl.addListener(PromiseImpl.java:23)
	at io.vertx.core.impl.future.Composition.onSuccess(Composition.java:43)
	at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:60)
	at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:211)
	at io.vertx.core.impl.future.PromiseImpl.tryComplete(PromiseImpl.java:23)
	at io.vertx.core.Promise.complete(Promise.java:66)
	at io.vertx.core.net.impl.NetClientImpl.lambda$connected$9(NetClientImpl.java:338)
	at io.vertx.core.net.impl.VertxHandler.setConnection(VertxHandler.java:82)
	at io.vertx.core.net.impl.VertxHandler.handlerAdded(VertxHandler.java:88)
	at io.netty.channel.AbstractChannelHandlerContext.callHandlerAdded(AbstractChannelHandlerContext.java:1114)
	at io.netty.channel.DefaultChannelPipeline.callHandlerAdded0(DefaultChannelPipeline.java:609)
	at io.netty.channel.DefaultChannelPipeline.addLast(DefaultChannelPipeline.java:223)
	at io.netty.channel.DefaultChannelPipeline.addLast(DefaultChannelPipeline.java:195)
	at io.vertx.core.net.impl.NetClientImpl.connected(NetClientImpl.java:340)
	at io.vertx.core.net.impl.NetClientImpl.lambda$connectInternal2$3(NetClientImpl.java:302)
	at io.vertx.core.impl.ContextInternal.dispatch(ContextInternal.java:277)
	at io.vertx.core.net.impl.ChannelProvider.connected(ChannelProvider.java:172)
	at io.vertx.core.net.impl.ChannelProvider.lambda$handleConnect$0(ChannelProvider.java:155)
	at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:590)
	at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:583)
	at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:559)
	at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:492)
	at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:636)
	at io.netty.util.concurrent.DefaultPromise.setSuccess0(DefaultPromise.java:625)
	at io.netty.util.concurrent.DefaultPromise.trySuccess(DefaultPromise.java:105)
	at io.netty.channel.DefaultChannelPromise.trySuccess(DefaultChannelPromise.java:84)
	at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.fulfillConnectPromise(AbstractNioChannel.java:300)
	at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:335)
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:776)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:833)

How to Reproduce?

https://github.com/luca-bassoricci/encodermode-issue

run test for error

Output of uname -a or ver

windows 11

Output of java -version

jdk 17

Quarkus version or git rev

3.5.3

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

@luca-bassoricci luca-bassoricci added the kind/bug Something isn't working label Nov 22, 2023
@quarkus-bot quarkus-bot bot added env/windows Impacts Windows machines triage/needs-triage labels Nov 22, 2023
luca-bassoricci added a commit to luca-bassoricci/quarkus that referenced this issue Nov 22, 2023
Used PausableHttpPostRequestEncoder.EncoderMode instead of
io.netty.handler.codec.http.multipart.HttpPostRequestEncoder.EncoderMode
luca-bassoricci added a commit to luca-bassoricci/quarkus that referenced this issue Nov 23, 2023
luca-bassoricci added a commit to luca-bassoricci/quarkus that referenced this issue Nov 23, 2023
Used PausableHttpPostRequestEncoder.EncoderMode instead of
io.netty.handler.codec.http.multipart.HttpPostRequestEncoder.EncoderMode
luca-bassoricci added a commit to luca-bassoricci/quarkus that referenced this issue Nov 23, 2023
Used PausableHttpPostRequestEncoder.EncoderMode instead of
io.netty.handler.codec.http.multipart.HttpPostRequestEncoder.EncoderMode
luca-bassoricci added a commit to luca-bassoricci/quarkus that referenced this issue Nov 24, 2023
Used PausableHttpPostRequestEncoder.EncoderMode instead of
io.netty.handler.codec.http.multipart.HttpPostRequestEncoder.EncoderMode
luca-bassoricci added a commit to luca-bassoricci/quarkus that referenced this issue Nov 29, 2023
luca-bassoricci added a commit to luca-bassoricci/quarkus that referenced this issue Nov 29, 2023
Used PausableHttpPostRequestEncoder.EncoderMode instead of
io.netty.handler.codec.http.multipart.HttpPostRequestEncoder.EncoderMode
luca-bassoricci added a commit to luca-bassoricci/quarkus that referenced this issue Nov 29, 2023
luca-bassoricci added a commit to luca-bassoricci/quarkus that referenced this issue Nov 29, 2023
Used PausableHttpPostRequestEncoder.EncoderMode instead of
io.netty.handler.codec.http.multipart.HttpPostRequestEncoder.EncoderMode
luca-bassoricci added a commit to luca-bassoricci/quarkus that referenced this issue Nov 29, 2023
Used PausableHttpPostRequestEncoder.EncoderMode instead of
io.netty.handler.codec.http.multipart.HttpPostRequestEncoder.EncoderMode
luca-bassoricci added a commit to luca-bassoricci/quarkus that referenced this issue Nov 29, 2023
Used PausableHttpPostRequestEncoder.EncoderMode instead of
io.netty.handler.codec.http.multipart.HttpPostRequestEncoder.EncoderMode
@quarkus-bot quarkus-bot bot added this to the 3.7 - main milestone Nov 29, 2023
holly-cummins pushed a commit to holly-cummins/quarkus that referenced this issue Feb 8, 2024
Used PausableHttpPostRequestEncoder.EncoderMode instead of
io.netty.handler.codec.http.multipart.HttpPostRequestEncoder.EncoderMode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
env/windows Impacts Windows machines kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant