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

mpRestClient send multipart/form-data with List<EntityPart> asynchronous failed #30774

Open
yooman00 opened this issue Feb 12, 2025 · 0 comments
Labels
release bug This bug is present in a released version of Open Liberty

Comments

@yooman00
Copy link

yooman00 commented Feb 12, 2025

Describe the bug
Sending multipart/form-data with mpRestClient asynchronous @restclient (injected in CDI RequestScoped bean) results in exception

[INFO] [err] jakarta.ws.rs.WebApplicationException: Failure in downstream service
[INFO] [err] at ITClass.postMethod(OcrIT.java:104)
[INFO] [err] at ITClass$Proxy$_$$WeldSubclass.postMethod$$super(Unknown Source)
[INFO] [err] at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
[INFO] [err] at java.base/java.lang.reflect.Method.invoke(Method.java:580)
[INFO] [err] at org.jboss.weld.interceptor.proxy.TerminalAroundInvokeInvocationContext.proceedInternal(TerminalAroundInvokeInvocationContext.java:51)
[INFO] [err] at org.jboss.weld.interceptor.proxy.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:78)
[INFO] [err] at com.ibm.tx.jta.cdi.interceptors.TransactionalInterceptor$2.run(TransactionalInterceptor.java:176)
[INFO] [err] at [internal classes]
[INFO] [err] at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
[INFO] [err] at java.base/java.lang.reflect.Method.invoke(Method.java:580)
[INFO] [err] at org.jboss.weld.interceptor.reader.SimpleInterceptorInvocation$SimpleMethodInvocation.invoke(SimpleInterceptorInvocation.java:73)
[INFO] [err] at org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.executeAroundInvoke(InterceptorMethodHandler.java:84)
[INFO] [err] at org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.executeInterception(InterceptorMethodHandler.java:72)
[INFO] [err] at org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.invoke(InterceptorMethodHandler.java:56)
[INFO] [err] at org.jboss.weld.bean.proxy.CombinedInterceptorAndDecoratorStackMethodHandler.invoke(CombinedInterceptorAndDecoratorStackMethodHandler.java:79)
[INFO] [err] at org.jboss.weld.bean.proxy.CombinedInterceptorAndDecoratorStackMethodHandler.invoke(CombinedInterceptorAndDecoratorStackMethodHandler.java:68)
[INFO] [err] at ITClass$Proxy$
$$WeldSubclass.postMethod(Unknown Source)
[INFO] [err] at ITClass$Proxy$
$$_WeldClientProxy.postMethod(Unknown Source)
[INFO] [err] at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
[INFO] [err] at java.base/java.lang.reflect.Method.invoke(Method.java:580)
[INFO] [err] at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:170)
[INFO] [err] at [internal classes]
[INFO] [err] at org.jboss.resteasy.core.ResourceMethodInvoker.lambda$invokeOnTarget$2(ResourceMethodInvoker.java:474)
[INFO] [err] at org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:434)
[INFO] [err] at [internal classes]
[INFO] [err] at org.jboss.resteasy.core.SynchronousDispatcher.lambda$invoke$4(SynchronousDispatcher.java:261)
[INFO] [err] at org.jboss.resteasy.core.SynchronousDispatcher.lambda$preprocess$0(SynchronousDispatcher.java:161)
[INFO] [err] at org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:434)
[INFO] [err] at [internal classes]
[INFO] [err] at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:614)
[INFO] [err] at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1266)
[INFO] [err] at [internal classes]
[INFO] [err] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
[INFO] [err] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
[INFO] [err] at java.base/java.lang.Thread.run(Thread.java:1583)
[INFO] [err] Caused by: java.util.concurrent.CompletionException: jakarta.ws.rs.ProcessingException: RESTEASY004655: Unable to invoke request: jakarta.ws.rs.WebApplicationException: Unexpected entity instance: org.jboss.resteasy.plugins.providers.multipart.ResteasyEntityPartBuilder$EntityPartImpl
[INFO] [err] at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
[INFO] [err] at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)
[INFO] [err] at java.base/java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:936)
[INFO] [err] at java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java:911)
[INFO] [err] at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
[INFO] [err] at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1773)
[INFO] [err] at org.jboss.resteasy.microprofile.client.impl.MpClientInvocation$Decorator.lambda$decorate$0(MpClientInvocation.java:93)
[INFO] [err] at org.jboss.resteasy.concurrent.ContextualExecutors.lambda$runnable$3(ContextualExecutors.java:313)
[INFO] [err] at io.openliberty.restfulWS.client.internal.ThreadContextAsyncTaskWrapper$3.run(ThreadContextAsyncTaskWrapper.java:70)
[INFO] [err] ... 3 more
[INFO] [err] Caused by: jakarta.ws.rs.ProcessingException: RESTEASY004655: Unable to invoke request: jakarta.ws.rs.WebApplicationException: Unexpected entity instance: org.jboss.resteasy.plugins.providers.multipart.ResteasyEntityPartBuilder$EntityPartImpl
[INFO] [err] at org.jboss.resteasy.client.jaxrs.engines.ManualClosingApacheHttpClient43Engine.invoke(ManualClosingApacheHttpClient43Engine.java:391)
[INFO] [err] at [internal classes]
[INFO] [err] at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.lambda$executorSubmit$9(ClientInvocation.java:829)
[INFO] [err] at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
[INFO] [err] ... 6 more
[INFO] [err] Caused by: jakarta.ws.rs.WebApplicationException: Unexpected entity instance: org.jboss.resteasy.plugins.providers.multipart.ResteasyEntityPartBuilder$EntityPartImpl
[INFO] [err] at org.jboss.resteasy.plugins.providers.multipart.IBMMultipartListProvider.writeTo(IBMMultipartListProvider.java:150)
[INFO] [err] at [internal classes]
[INFO] [err] ... 9 more

Steps to Reproduce

  • Enable Features:
    cdi-4.0
    mpRestClient-3.0
  • Create a Rest Client with post form-data
    @post
    @path("/path")
    @produces(MediaType.APPLICATION_JSON)
    @consumes(MediaType.MULTIPART_FORM_DATA)
    CompletionStage postMethod(@HeaderParam("Authorization")String bearerToken, List parts) throws IOException, ProcessingException;
  • Consume the service from RequestScoped bean
    ....
    restClient.postMethod().whenComplete(consumer);

Expected behavior
Expeected is multipart/form-data POST call to success the same way as a GET call

Diagnostic information:

  • OpenLiberty Version: 24.0.0.5
  • Affected feature: mpRestClient-3.0
  • Java Version: OpenJDK 64-Bit Server VM Temurin-21.0.3+9 (build 21.0.3+9-LTS, mixed mode, sharing)
  • server.xml server.xml.txt
  • messages.log messages.log

Additional context
Add any other context about the problem here.

@yooman00 yooman00 added the release bug This bug is present in a released version of Open Liberty label Feb 12, 2025
@yooman00 yooman00 changed the title mpRestClient multipart/ form-data asynchronous mpRestClient multipart/form-data with List<EntityPart> asynchronous failed Feb 13, 2025
@yooman00 yooman00 changed the title mpRestClient multipart/form-data with List<EntityPart> asynchronous failed mpRestClient send multipart/form-data with List<EntityPart> asynchronous failed Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release bug This bug is present in a released version of Open Liberty
Projects
None yet
Development

No branches or pull requests

1 participant