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

Grizzly+Swagger giving 500 Error #1665

Closed
moezubair opened this issue Feb 16, 2016 · 1 comment
Closed

Grizzly+Swagger giving 500 Error #1665

moezubair opened this issue Feb 16, 2016 · 1 comment

Comments

@moezubair
Copy link

Hey,
I have an existing program that I am trying to add Swagger to, but I keep getting 500 error when I try to access the swagger.json or swagger.yaml file
Here is how I am doing it:

package abc.service.rest.main;

//Bunch of imports
@Path("/ABC/server")
public class DynamicPublicationServer {
    public static void main(String args[]) throws Exception {
        BeanConfig beanConfig = new BeanConfig();
        beanConfig.setVersion("1.0.2");
        beanConfig.setSchemes(new String[]{"http"});
        beanConfig.setHost("localhost:9134");
        beanConfig.setBasePath("/ABC/server/");
        beanConfig.setResourcePackage("abc.service.rest.main");
        beanConfig.setScan(true);       
        ResourceConfig rc = new ResourceConfig();
        rc.register(DynamicPublicationServer.class);
        rc.register(BenchmarkRS.class);
        rc.register(SupportServiceRS.class);
        rc.register(JacksonFeature.class);
        rc.register(MultiPartFeature.class);
        rc.register(ApiListingResource.class);
        rc.register(SwaggerSerializers.class);
        EncodingFilter.enableFor(rc, GZipEncoder.class);
        String baseUri = "http://" + InetAddress.getLocalHost().getHostAddress() + ":"
                    + System.getProperty("PORT", "9134") + "/";
        HttpServer server = GrizzlyHttpServerFactory.createHttpServer(URI.create(baseUri), rc);
}
}

In my pom file i've added :

        <dependency>
            <groupId>io.swagger</groupId>
            <artifactId>swagger-jersey2-jaxrs</artifactId>
            <version>1.5.0</version>
        </dependency>

But when I go to localhost:9134/swagger.json I get :

image

@webron
Copy link
Contributor

webron commented Feb 16, 2016

See #1103.

@webron webron closed this as completed Feb 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants