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

RESTEasy Reactive build failure with MULTIPART_FORM_DATA #19404

Closed
jsmrcka opened this issue Aug 15, 2021 · 1 comment · Fixed by #19408
Closed

RESTEasy Reactive build failure with MULTIPART_FORM_DATA #19404

jsmrcka opened this issue Aug 15, 2021 · 1 comment · Fixed by #19408
Labels
area/resteasy-reactive kind/bug Something isn't working
Milestone

Comments

@jsmrcka
Copy link
Contributor

jsmrcka commented Aug 15, 2021

Describe the bug

Using quarkus-resteasy-reactive extension, I'm trying to do this:

@Path("/echo")
public class MyResource {
    @POST
    @Consumes(MediaType.MULTIPART_FORM_DATA)
    @Produces(MediaType.TEXT_PLAIN)
    public String echo(byte[] request) {
        return new String(request, StandardCharsets.UTF_8);
    }
}

which should be fine (works for non-reactive quarkus-resteasy).
But when I invoke mvn package, I get an exception:

[ERROR] Failed to execute goal io.quarkus.platform:quarkus-maven-plugin:2.1.2.Final:build (default) on project my-artifactId: Failed to build quarkus application: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[ERROR] 	[error]: Build step io.quarkus.resteasy.reactive.server.deployment.ResteasyReactiveProcessor#setupEndpoints threw an exception: java.lang.RuntimeException: java.lang.RuntimeException: Failed to process method org.my.group.MyResource#java.lang.String echo(byte[] request)
[ERROR] 	at org.jboss.resteasy.reactive.common.processor.EndpointIndexer.createEndpoints(EndpointIndexer.java:245)
[ERROR] 	at io.quarkus.resteasy.reactive.server.deployment.ResteasyReactiveProcessor.setupEndpoints(ResteasyReactiveProcessor.java:423)
[ERROR] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] 	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[ERROR] 	at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:820)
[ERROR] 	at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
[ERROR] 	at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
[ERROR] 	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
[ERROR] 	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
[ERROR] 	at java.base/java.lang.Thread.run(Thread.java:829)
[ERROR] 	at org.jboss.threads.JBossThread.run(JBossThread.java:501)
[ERROR] Caused by: java.lang.RuntimeException: Failed to process method org.my.group.MyResource#java.lang.String echo(byte[] request)
[ERROR] 	at org.jboss.resteasy.reactive.common.processor.EndpointIndexer.createResourceMethod(EndpointIndexer.java:548)
[ERROR] 	at org.jboss.resteasy.reactive.common.processor.EndpointIndexer.createEndpoints(EndpointIndexer.java:293)
[ERROR] 	at org.jboss.resteasy.reactive.common.processor.EndpointIndexer.createEndpoints(EndpointIndexer.java:216)
[ERROR] 	... 12 more
[ERROR] Caused by: java.lang.NullPointerException
[ERROR] 	at io.quarkus.resteasy.reactive.server.deployment.QuarkusServerEndpointIndexer.handleMultipart(QuarkusServerEndpointIndexer.java:226)
[ERROR] 	at org.jboss.resteasy.reactive.common.processor.EndpointIndexer.createResourceMethod(EndpointIndexer.java:459)
[ERROR] 	... 14 more

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

resteasy-reactive-multipart-reproducer.zip

unzip ./resteasy-reactive-multipart-reproducer.zip
cd ./resteasy-reactive-multipart-reproducer/
./mvnw clean package

Output of uname -a or ver

No response

Output of java -version

openjdk version "11.0.11" 2021-04-20 OpenJDK Runtime Environment AdoptOpenJDK-11.0.11+9 (build 11.0.11+9) OpenJDK 64-Bit Server VM AdoptOpenJDK-11.0.11+9 (build 11.0.11+9, mixed mode)

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.1.2.Final

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

Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d)

Additional information

No response

@jsmrcka jsmrcka added the kind/bug Something isn't working label Aug 15, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Aug 15, 2021

/cc @FroMage, @geoand, @stuartwdouglas

stuartwdouglas added a commit to stuartwdouglas/quarkus that referenced this issue Aug 16, 2021
@quarkus-bot quarkus-bot bot added this to the 2.2 - main milestone Aug 16, 2021
@gsmet gsmet modified the milestones: 2.2 - main, 2.1.3.Final Aug 17, 2021
gsmet pushed a commit to gsmet/quarkus that referenced this issue Aug 17, 2021
jsmrcka added a commit to jsmrcka/quarkus-test-suite that referenced this issue Aug 20, 2021
Add `http/jaxrs-reactive`, which is a RESTEasy reactive equivalent of
`http/jaxrs`.
Notable differenes and limitations:
- In a multipart POJO, Java type for `image` and `octet-stream` were
  changed from `InputStream` to `File` - `InputStream` is not supported
  by `resteasy-reactive`.
- Test of a functionality provided by the
  `quarkus.resteasy.multipart.input-part.default-charset` property has
  been disabled for now - it is unsupported in `resteasy-reactive`.
  quarkusio/quarkus#19527
- [FIXED] Possible bug in `resteasy-reactive` - endpoints  consuming
  `MULTIPART_FORM_DATA` cause build failure.
  quarkusio/quarkus#19404.
- Tests dealing with `text/plain` request/response have been disabled
  on Windows due to a bug.
  quarkusio/quarkus#19535
jsmrcka added a commit to jsmrcka/quarkus-test-suite that referenced this issue Aug 20, 2021
Add `http/jaxrs-reactive`, which is a RESTEasy reactive equivalent of
`http/jaxrs`.
Notable differences and limitations:
- In a multipart POJO, Java type for `image` and `octet-stream` were
  changed from `InputStream` to `File` - `InputStream` is not supported
  by `resteasy-reactive`.
- Test of a functionality provided by the
  `quarkus.resteasy.multipart.input-part.default-charset` property has
  been disabled for now - it is unsupported in `resteasy-reactive`.
  quarkusio/quarkus#19527
- [FIXED] Possible bug in `resteasy-reactive` - endpoints  consuming
  `MULTIPART_FORM_DATA` cause build failure.
  quarkusio/quarkus#19404.
- Tests dealing with `text/plain` request/response have been disabled
  on Windows due to a bug.
  quarkusio/quarkus#19535
jsmrcka added a commit to jsmrcka/quarkus-test-suite that referenced this issue Aug 20, 2021
Add `http/jaxrs-reactive`, which is a RESTEasy reactive equivalent of
`http/jaxrs`.
Notable differences and limitations:
- In a multipart POJO, Java type for `image` and `octet-stream` were
  changed from `InputStream` to `File` - `InputStream` is not supported
  by `resteasy-reactive`.
- Test of a functionality provided by the
  `quarkus.resteasy.multipart.input-part.default-charset` property has
  been disabled for now - it is unsupported in `resteasy-reactive`.
  quarkusio/quarkus#19527
- [FIXED] Possible bug in `resteasy-reactive` - endpoints  consuming
  `MULTIPART_FORM_DATA` cause build failure.
  quarkusio/quarkus#19404.
- Tests dealing with `text/plain` request/response have been disabled
  on Windows due to a bug.
  quarkusio/quarkus#19535
jsmrcka added a commit to jsmrcka/quarkus-test-suite that referenced this issue Aug 25, 2021
Add `http/jaxrs-reactive`, which is a RESTEasy reactive equivalent of
`http/jaxrs`.
Notable differences and limitations:
- In a multipart POJO, Java type for `image` and `octet-stream` were
  changed from `InputStream` to `File` - `InputStream` is not supported
  by `resteasy-reactive`.
- Test of a functionality provided by the
  `quarkus.resteasy.multipart.input-part.default-charset` property has
  been disabled for now - it is unsupported in `resteasy-reactive`.
  quarkusio/quarkus#19527
- [FIXED] Possible bug in `resteasy-reactive` - endpoints  consuming
  `MULTIPART_FORM_DATA` cause build failure.
  quarkusio/quarkus#19404.
- Tests dealing with `text/plain` request/response have been disabled
  on Windows due to a bug.
  quarkusio/quarkus#19535
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/resteasy-reactive kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants