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

swagger example issue #62

Open
jenrryyou opened this issue Aug 19, 2017 · 1 comment
Open

swagger example issue #62

jenrryyou opened this issue Aug 19, 2017 · 1 comment
Labels

Comments

@jenrryyou
Copy link

jenrryyou commented Aug 19, 2017

Hello:

When I run swagger example project(version 4.5.2) in mutiple verticles mode(e.g.,
(java -jar vertx-jersey-examples-swagger-4.5.2-fat.jar -instances 4 -conf src/test/resources/config.json), something is wrong。Sometimes the response of the url http://localhost:8080/swagger.json is ok, and sometimes returns 404。

If I run jersey server in single verticle mode(e.g., java -jar vertx-jersey-examples-swagger-4.5.2-fat.jar -conf src/test/resources/config.json), everything is ok。

I trace the code and find some code in class org.glassfish.jersey.server.ServerRuntime.java:

public void process(final ContainerRequest request) {
    ...
    requestScope.runInScope(requestScopeInstance, new Runnable() {
    ...
    final RequestProcessingContext data = Stages.process(context, requestProcessingRoot, endpointRef);
    ...
    }
    ...
}

The SwaggerServletContext instance in data.routingContext.matchedResources would miss swagger attribute in some verticles。Is it a bug or I miss something?

@adrianluisgonzalez
Copy link
Member

@jenrryyou I have not been able to reproduce with the latest snapshot 4.6.0-SNAPSHOT. This includes a newer version of swagger 1.5.16, perhaps that resolved the issue?

I ran the fat jar with 4 instances as you suggested:

java -jar target/vertx-jersey-examples-swagger-4.6.0-SNAPSHOT-fat.jar  -instances 4 -conf src/test/resources/config.json

Then I cURLed the swagger.json 1000 times:

for ((i=1;i<=1000;i++)); do curl -v "http://localhost:8080/rest/swagger.json"; done

Are you still able to reproduce?

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

No branches or pull requests

2 participants