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 on Undertow. swagger.json is not found #1669

Closed
amreladawy opened this issue Feb 18, 2016 · 7 comments
Closed

RESTEasy on Undertow. swagger.json is not found #1669

amreladawy opened this issue Feb 18, 2016 · 7 comments

Comments

@amreladawy
Copy link

Hi Ron,

I am trying to get swagger.json on a project that is using REASTEasy on Undertow.

Here is my AppApi class

@ApplicationPath("/v1")
public class ApiApp extends Application {

    @Override
    public Set<Class<?>> getClasses() {
    HashSet<Class<?>> classes = new HashSet<Class<?>>();
    classes.add(Users.class);
    classes.add(Orders.class);
    classes.add(Admin.class);
    classes.add(Menus.class);
    classes.add(SecurityFilter.class);
    return classes;
    }

    public ApiApp() {
    BeanConfig beanConfig = new BeanConfig();
    beanConfig.setTitle("QMenu API");
    beanConfig.setVersion("1.0.0");
    beanConfig.setSchemes(new String[] { "http" });
    beanConfig.setHost("localhost:8090");
    beanConfig.setBasePath("/");
    beanConfig.setResourcePackage("com.eigonic.qmenu.core.api.rest");
    beanConfig.setPrettyPrint(true);
    beanConfig.setScan(true);
    }

}

I went debuggingthrough the method beanConfig.setScan(true); and I found that swagger is able to read my resources classes successfully.

when I get the URL http://localhost:8090/v1/swagger.json I get 404

with the following error

9:20:35.763 [XNIO-1 task-2] ERROR (ExceptionHandler.java:199) - RESTEASY002010: Failed to execute} javax.ws.rs.NotFoundException: RESTEASY003210: Could not find resource for full path: http://localhost:8090/v1/swagger.json at org.jboss.resteasy.core.registry.ClassNode.match(ClassNode.java:75) ~[resteasy-jaxrs-3.0.14.Final.jar:3.0.14.Final] at org.jboss.resteasy.core.registry.RootClassNode.match(RootClassNode.java:48) ~[resteasy-jaxrs-3.0.14.Final.jar:3.0.14.Final] at org.jboss.resteasy.core.ResourceMethodRegistry.getResourceInvoker(ResourceMethodRegistry.java:445) ~[resteasy-jaxrs-3.0.14.Final.jar:3.0.14.Final] at org.jboss.resteasy.core.SynchronousDispatcher.getInvoker(SynchronousDispatcher.java:257) [resteasy-jaxrs-3.0.14.Final.jar:3.0.14.Final] at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:194) [resteasy-jaxrs-3.0.14.Final.jar:3.0.14.Final] at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:221) [resteasy-jaxrs-3.0.14.Final.jar:3.0.14.Final] at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56) [resteasy-jaxrs-3.0.14.Final.jar:3.0.14.Final] at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51) [resteasy-jaxrs-3.0.14.Final.jar:3.0.14.Final] at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [jboss-servlet-api_3.1_spec-1.0.0.Final.jar:1.0.0.Final] at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85) [undertow-servlet-1.3.10.Final.jar:1.3.10.Final] at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) [undertow-servlet-1.3.10.Final.jar:1.3.10.Final] at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.3.10.Final.jar:1.3.10.Final] at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131) [undertow-servlet-1.3.10.Final.jar:1.3.10.Final] at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57) [undertow-servlet-1.3.10.Final.jar:1.3.10.Final] at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.3.10.Final.jar:1.3.10.Final] at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46) [undertow-core-1.3.10.Final.jar:1.3.10.Final] at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64) [undertow-servlet-1.3.10.Final.jar:1.3.10.Final] at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60) [undertow-core-1.3.10.Final.jar:1.3.10.Final] at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77) [undertow-servlet-1.3.10.Final.jar:1.3.10.Final] at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43) [undertow-core-1.3.10.Final.jar:1.3.10.Final] at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.3.10.Final.jar:1.3.10.Final] at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.3.10.Final.jar:1.3.10.Final] at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:284) [undertow-servlet-1.3.10.Final.jar:1.3.10.Final] at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:263) [undertow-servlet-1.3.10.Final.jar:1.3.10.Final] at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81) [undertow-servlet-1.3.10.Final.jar:1.3.10.Final] at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:174) [undertow-servlet-1.3.10.Final.jar:1.3.10.Final] at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202) [undertow-core-1.3.10.Final.jar:1.3.10.Final] at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:793) [undertow-core-1.3.10.Final.jar:1.3.10.Final] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_65] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_65] at java.lang.Thread.run(Thread.java:745) [?:1.8.0_65]

@webron
Copy link
Contributor

webron commented Feb 18, 2016

@amreladawy
Copy link
Author

Hi Ron,

Thanks a lot. That solved my issue.

@ghost
Copy link

ghost commented Aug 30, 2016

Hi @webron
I followed all the steps mentioned in u suggested URL but still getting same error as mentioned by @amreladawy

@hyperknob
Copy link

Hi @webron
I followed all the steps mentioned in u suggested URL but still getting same error as mentioned by @amreladawy

I ecountered the same problem

@webron
Copy link
Contributor

webron commented Mar 23, 2017

Then you're missing a step still. Start from the beginning, follow the instructions. It's pretty straightforward.

@imaginalis
Copy link

Hello I encountered the same problem.
I tried to configure it both by custom Application class and Servlet. Also with specified resources paths and with RESTEasy auto-scanning and still getting 404 (javax.ws.rs.NotFoundException) when trying to access swagger.json file.

Do you have any idea what is the problem here?
Thanks

@mashkurm
Copy link

mashkurm commented Jul 6, 2017

Hello, I followed the same pattern, I am getting swagger.json but with only GET request.. There are so many PUT, POST and DELETE requests which are not shown in swagger.json file.

Any idea how to solve it?

Thanks in advance!

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

5 participants