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-vertx example exception #427

Open
1416360754 opened this issue Jun 22, 2021 · 2 comments
Open

resteasy-vertx example exception #427

1416360754 opened this issue Jun 22, 2021 · 2 comments
Labels

Comments

@1416360754
Copy link

1416360754 commented Jun 22, 2021

Questions

in https://github.com/vert-x3/vertx-examples/tree/4.x/resteasy-examples/src/main/java/io/vertx/examples/resteasy/helloworld
Serve.java ,After the start, visit http feedback:
java.lang.NoSuchMethodError: io.vertx.core.http.HttpServerRequest.rawMethod()Ljava/lang/String;
jdk1.8

`

  <groupId>io.vertx</groupId>
  <artifactId>vertx-core</artifactId>
  <version>4.1.0</version>
</dependency>

<dependency>
  <groupId>org.jboss.resteasy</groupId>
  <artifactId>resteasy-vertx</artifactId>
  <version>3.1.0.Final</version>
</dependency>

`

i find bug is resteasy-vertx used vertx3.x version. exception from org.jboss.resteasy.plugins.server.vertx.VertxRequestHandler. handle(HttpServerRequest request)

here method

`public void handle(HttpServerRequest request) {
request.bodyHandler((buff) -> {
Context ctx = this.vertx.getOrCreateContext();
ResteasyUriInfo uriInfo = VertxUtil.extractUriInfo(request, this.servletMappingPrefix);
ResteasyHttpHeaders headers = VertxUtil.extractHttpHeaders(request);
HttpServerResponse response = request.response();
VertxHttpResponse vertxResponse = new VertxHttpResponse(response, this.dispatcher.getProviderFactory());
VertxHttpRequest vertxRequest = new VertxHttpRequest(ctx, headers, uriInfo, request.rawMethod(), this.dispatcher.getDispatcher(), vertxResponse, false);
if (buff.length() > 0) {
ByteBufInputStream in = new ByteBufInputStream(buff.getByteBuf());
vertxRequest.setInputStream(in);
}
try {
this.dispatcher.service(ctx, request, response, vertxRequest, vertxResponse, true);
} catch (Failure var11) {
vertxResponse.setStatus(var11.getErrorCode());
} catch (Exception var12) {
vertxResponse.setStatus(500);
LogMessages.LOGGER.error(Messages.MESSAGES.unexpected(), var12);
}

        if (!vertxRequest.getAsyncContext().isSuspended()) {
            try {
                vertxResponse.finish();
            } catch (IOException var10) {
                var10.printStackTrace();
            }
        }

    });
}

`

@1416360754 1416360754 added the bug label Jun 22, 2021
@tsegismont
Copy link
Contributor

I think we should remove this example from the 4.x branch. Users looking for an annotation-driven, reactive REST framework would better give a try to Quarkus.

Fine with you @vietj ?

@1416360754
Copy link
Author

1416360754 commented Jun 22, 2021

Use annotation-driven is wonderful idea,it can let you just focus on the business,with future. - v -

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants