-------------------------------------------- On Mon, 1/2/17, Dali <[email protected]> wrote:
Subject: Re: Can't get swagger.json To: "Swagger" <[email protected]> Date: Monday, January 2, 2017, 6:31 PM Here are my logs : INFO 2017-01-02 17:29:50:041 ApiDaoProvider:45 - http://localhost:5003/v1/swagger.json INFO 2017-01-02 17:29:50:043 ApiDaoProvider:49 - InstanceContextFilter Jan 02, 2017 5:29:50 PM org.eclipse.jetty.servlet.ServletHandler doHandle WARNING: javax.servlet.ServletException: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1 at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:489) at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427) at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388) at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341) at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:717) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:552) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1111) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:479) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1045) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) at org.eclipse.jetty.server.Server.handle(Server.java:462) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:279) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:232) at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:534) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:607) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:536) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1 at java.util.LinkedList.checkElementIndex(LinkedList.java:553) at java.util.LinkedList.get(LinkedList.java:474) at java.util.Collections$UnmodifiableList.get(Collections.java:1211) at com.fiftyfive.services.filters.InstanceContextFilter.filter(InstanceContextFilter.java:54) at org.glassfish.jersey.server.ContainerFilteringStage.apply(ContainerFilteringStage.java:132) at org.glassfish.jersey.server.ContainerFilteringStage.apply(ContainerFilteringStage.java:68) at org.glassfish.jersey.process.internal.Stages.process(Stages.java:197) at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:318) at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) at org.glassfish.jersey.internal.Errors.process(Errors.java:315) at org.glassfish.jersey.internal.Errors.process(Errors.java:297) at org.glassfish.jersey.internal.Errors.process(Errors.java:267) at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317) at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305) at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154) at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473) ... 18 more On Thursday, December 29, 2016 at 8:17:18 PM UTC+1, Ron wrote:You’d need to check you application logs to see why you’re getting 500. You might need to bump up the log levels. From: <swagger-sw...@ googlegroups.com> on behalf of Dali <[email protected]> Reply-To: "swagger-sw...@ googlegroups.com" <swagger-sw...@ googlegroups.com> Date: Thursday, 29 December 2016 at 5:59 To: Swagger <swagger-sw...@ googlegroups.com> Subject: Re: Can't get swagger.json Thanks for the reply. I updated my build.gradle compile 'io.swagger:swagger-core:1.5. 12' compile 'io.swagger:swagger-jaxrs:1.5. 12' and I added the package io.swagger.jaxrs.listing here jerseyServletHolder.setInitPar ameter(ServerProperties.PROVID ER_PACKAGES, "com.fiftyfive.services;com. fasterxml.jackson.jaxrs.json; io.swagger.jaxrs.listing"); Now i'm getting error 500 when i try with http://localhost:5003/v1/ swagger.json On Wednesday, December 28, 2016 at 6:34:59 PM UTC+1, Ron wrote: If you’re getting a 404, it doesn’t mean the scanning isn’t happening, it means Jersey doesn’t register ApiListingResource for some reason (even though it’s in your ResourceConfig).ApiListingResource is just a JAX-RS resource like your own – which should be exposed at the root of the other resources. You’re also using a really old version of swagger-core – that version has many known issues, some of which are critical.Try upgrading to the latest – 1.5.12. From: <swagger-sw...@googlegroups. com> on behalf of Dali <[email protected]> Reply-To: "swagger-sw...@googlegroups. com" <swagger-sw...@googlegroups. com> Date: Wednesday, 28 December 2016 at 5:23 To: Swagger <swagger-sw...@googlegroups. com> Subject: Re: Can't get swagger.json I'm using swagger-core 1.5.0 My API is accessible on http://localhost:5003/v1/ I think that the swagger.json is not created. I tried http://localhost:5003/ v1/swagger.json or http://localhost:5003/swagger. json but it's always an 404. On Tuesday, December 27, 2016 at 7:20:59 PM UTC+1, Ron wrote: Which version of swagger-core do you use?What URL do you use to access your API?The swagger.json? From: <swagger-sw...@googlegroups. com> on behalf of Dali <[email protected]> Reply-To: "swagger-sw...@googlegroups. com" <swagger-sw...@googlegroups. com> Date: Tuesday, 27 December 2016 at 10:16 To: Swagger <swagger-sw...@googlegroups. com> Subject: Can't get swagger.json Hello, I tried to integrate swagger on java + embedded jetty project but i can't get swagger.json file. I'm always getting 404 not found error on any path combination.I think swagger is not scanning my packages !?! Main.javapublic class ApiServer { public static void main(String[] args) throws Exception { BeanConfig beanConfig = new BeanConfig(); beanConfig.setVersion("1.0.0" ); beanConfig.setResourcePackage ("my.resources.packages"); beanConfig.setScan(true); beanConfig.setBasePath("/"); beanConfig.setPrettyPrint(tru e); Server server = new Server(Env.SERVER_PORT); ServletHolder jerseyServletHolder = new ServletHolder(new ServletContainer()); jerseyServletHolder.setInitPa rameter(ServerProperties.PROVI DER_PACKAGES,"my.resources. packages;com.fasterxml. jackson.jaxrs.json"); jerseyServletHolder.setInitPa rameter(ServerProperties.WADL_ FEATURE_DISABLE, ServletContextHandler handler = new ServletContextHandler(server, "/"); "true"); handler.addServlet(jerseyServ letHolder, Env.API_PREFIX); server.start(); server.join(); } @ApplicationPath("/")public class Application extends ResourceConfig { public Application() { // Register all resources present under the package. packages("my.resources. packages"); packages("com.fasterxml. jackson.jaxrs.json"); register(JacksonFeature.class) ; register(ApiListingResource.cl ass); register(SwaggerSerializers.cl ass); }} I'm using jersey 2.22 and swagger 1.5.My API classes (and swagger annotations) are under my.resources.packagesMy Api calls works All help appreciated Regards,Dali p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; color: #777777} p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco} p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; min-height: 15.0px} p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; color: #4e9072} p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; color: #3933ff} span.s1 {color: #000000} span.s2 {color: #3933ff} span.s3 {color: #931a68}-- You received this message because you are subscribed to the Google Groups "Swagger" group. To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+ [email protected]. For more options, visit https://groups.google.com/d/ optout.-- You received this message because you are subscribed to the Google Groups "Swagger" group. To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+ [email protected]. For more options, visit https://groups.google.com/d/ optout.-- You received this message because you are subscribed to the Google Groups "Swagger" group. To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+ [email protected]. For more options, visit https://groups.google.com/d/ optout. -- You received this message because you are subscribed to the Google Groups "Swagger" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout. egociat cu M. Litvinov bazele viitorului tratat care au fost consemnate intr-un -- You received this message because you are subscribed to the Google Groups "Swagger" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
