dropwizard-swagger icon indicating copy to clipboard operation
dropwizard-swagger copied to clipboard

NPE in Dropwizard 0.8.0, 0.8.1

Open clamothe opened this issue 9 years ago • 9 comments

apiListingResource.getPath() returns null in some scenarios, resulting in a NPE in Dropwizard code. Tested with dropwizard-swagger 0.7.0 and Dropwizard 0.8.0 and 0.8.1. dropwizard-swagger 0.6.0 works fine.

WARN  [2015-05-13 23:03:47,140] org.eclipse.jetty.util.component.AbstractLifeCycle: FAILED org.eclipse.jetty.server.Server@7f3e9acc: javax.servlet.ServletException: org.glassfish.jersey.servlet.ServletContainer-2d4f67e@7502d052==org.glassfish.jersey.servlet.ServletContainer,1,false
! java.lang.NullPointerException: null
! at io.dropwizard.jersey.DropwizardResourceConfig$EndpointLogger.normalizePath(DropwizardResourceConfig.java:182) ~[dropwizard-jersey-0.8.1.jar:0.8.1]
! at io.dropwizard.jersey.DropwizardResourceConfig$EndpointLogger.populateEndpoints(DropwizardResourceConfig.java:156) ~[dropwizard-jersey-0.8.1.jar:0.8.1]
! at io.dropwizard.jersey.DropwizardResourceConfig$EndpointLogger.populateEndpoints(DropwizardResourceConfig.java:151) ~[dropwizard-jersey-0.8.1.jar:0.8.1]
! at io.dropwizard.jersey.DropwizardResourceConfig$EndpointLogger.<init>(DropwizardResourceConfig.java:147) ~[dropwizard-jersey-0.8.1.jar:0.8.1]
! at io.dropwizard.jersey.DropwizardResourceConfig.getEndpointsInfo(DropwizardResourceConfig.java:125) ~[dropwizard-jersey-0.8.1.jar:0.8.1]
! at io.dropwizard.jersey.DropwizardResourceConfig.logComponents(DropwizardResourceConfig.java:76) ~[dropwizard-jersey-0.8.1.jar:0.8.1]
! at io.dropwizard.jersey.DropwizardResourceConfig$ComponentLoggingListener.onEvent(DropwizardResourceConfig.java:202) ~[dropwizard-jersey-0.8.1.jar:0.8.1]
! at org.glassfish.jersey.server.internal.monitoring.CompositeApplicationEventListener.onEvent(CompositeApplicationEventListener.java:74) ~[jersey-server-2.17.jar:na]
! at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:587) ~[jersey-server-2.17.jar:na]
! at org.glassfish.jersey.server.ApplicationHandler.access$500(ApplicationHandler.java:166) ~[jersey-server-2.17.jar:na]
! at org.glassfish.jersey.server.ApplicationHandler$3.run(ApplicationHandler.java:327) ~[jersey-server-2.17.jar:na]
! at org.glassfish.jersey.internal.Errors$2.call(Errors.java:289) ~[jersey-common-2.17.jar:na]
! at org.glassfish.jersey.internal.Errors$2.call(Errors.java:286) ~[jersey-common-2.17.jar:na]
! at org.glassfish.jersey.internal.Errors.process(Errors.java:315) ~[jersey-common-2.17.jar:na]
! at org.glassfish.jersey.internal.Errors.process(Errors.java:297) ~[jersey-common-2.17.jar:na]
! at org.glassfish.jersey.internal.Errors.processWithException(Errors.java:286) ~[jersey-common-2.17.jar:na]
! at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:324) ~[jersey-server-2.17.jar:na]
! at org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:338) ~[jersey-container-servlet-core-2.17.jar:na]
! at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:171) ~[jersey-container-servlet-core-2.17.jar:na]
! at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:363) ~[jersey-container-servlet-core-2.17.jar:na]
! at javax.servlet.GenericServlet.init(GenericServlet.java:244) ~[javax.servlet-api-3.1.0.jar:3.1.0]
! at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:612) ~[jetty-servlet-9.2.9.v20150224.jar:9.2.9.v20150224]
! ... 36 common frames omitted
! Causing: javax.servlet.ServletException: org.glassfish.jersey.servlet.ServletContainer-2d4f67e@7502d052==org.glassfish.jersey.servlet.ServletContainer,1,false
! at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:633) ~[jetty-servlet-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.servlet.ServletHolder.initialize(ServletHolder.java:395) ~[jetty-servlet-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:871) ~[jetty-servlet-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:298) ~[jetty-servlet-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:741) ~[jetty-server-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) ~[jetty-util-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132) ~[jetty-util-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114) ~[jetty-util-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61) ~[jetty-server-9.2.9.v20150224.jar:9.2.9.v20150224]
! at com.codahale.metrics.jetty9.InstrumentedHandler.doStart(InstrumentedHandler.java:103) ~[metrics-jetty9-3.1.1.jar:3.1.1]
! at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) ~[jetty-util-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132) ~[jetty-util-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114) ~[jetty-util-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61) ~[jetty-server-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) ~[jetty-util-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132) ~[jetty-util-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114) ~[jetty-util-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61) ~[jetty-server-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.server.handler.RequestLogHandler.doStart(RequestLogHandler.java:140) ~[jetty-server-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) ~[jetty-util-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132) ~[jetty-util-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114) ~[jetty-util-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61) ~[jetty-server-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.server.handler.StatisticsHandler.doStart(StatisticsHandler.java:232) ~[jetty-server-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) ~[jetty-util-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132) ~[jetty-util-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.server.Server.start(Server.java:387) ~[jetty-server-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114) ~[jetty-util-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61) ~[jetty-server-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.server.Server.doStart(Server.java:354) ~[jetty-server-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) ~[jetty-util-9.2.9.v20150224.jar:9.2.9.v20150224]
! at io.dropwizard.cli.ServerCommand.run(ServerCommand.java:43) [dropwizard-core-0.8.1.jar:0.8.1]
! at io.dropwizard.cli.EnvironmentCommand.run(EnvironmentCommand.java:43) [dropwizard-core-0.8.1.jar:0.8.1]
! at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:76) [dropwizard-core-0.8.1.jar:0.8.1]
! at io.dropwizard.cli.Cli.run(Cli.java:70) [dropwizard-core-0.8.1.jar:0.8.1]
! at io.dropwizard.Application.run(Application.java:73) [dropwizard-core-0.8.1.jar:0.8.1]
! at com.keypr.webservices.WebServicesApplication.main(WebServicesApplication.java:32) [main/:na]
ERROR [2015-05-13 23:03:47,140] io.dropwizard.cli.ServerCommand: Unable to start server, shutting down
! java.lang.NullPointerException: null
! at io.dropwizard.jersey.DropwizardResourceConfig$EndpointLogger.normalizePath(DropwizardResourceConfig.java:182) ~[dropwizard-jersey-0.8.1.jar:0.8.1]
! at io.dropwizard.jersey.DropwizardResourceConfig$EndpointLogger.populateEndpoints(DropwizardResourceConfig.java:156) ~[dropwizard-jersey-0.8.1.jar:0.8.1]
! at io.dropwizard.jersey.DropwizardResourceConfig$EndpointLogger.populateEndpoints(DropwizardResourceConfig.java:151) ~[dropwizard-jersey-0.8.1.jar:0.8.1]
! at io.dropwizard.jersey.DropwizardResourceConfig$EndpointLogger.<init>(DropwizardResourceConfig.java:147) ~[dropwizard-jersey-0.8.1.jar:0.8.1]
! at io.dropwizard.jersey.DropwizardResourceConfig.getEndpointsInfo(DropwizardResourceConfig.java:125) ~[dropwizard-jersey-0.8.1.jar:0.8.1]
! at io.dropwizard.jersey.DropwizardResourceConfig.logComponents(DropwizardResourceConfig.java:76) ~[dropwizard-jersey-0.8.1.jar:0.8.1]
! at io.dropwizard.jersey.DropwizardResourceConfig$ComponentLoggingListener.onEvent(DropwizardResourceConfig.java:202) ~[dropwizard-jersey-0.8.1.jar:0.8.1]
! at org.glassfish.jersey.server.internal.monitoring.CompositeApplicationEventListener.onEvent(CompositeApplicationEventListener.java:74) ~[jersey-server-2.17.jar:na]
! at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:587) ~[jersey-server-2.17.jar:na]
! at org.glassfish.jersey.server.ApplicationHandler.access$500(ApplicationHandler.java:166) ~[jersey-server-2.17.jar:na]
! at org.glassfish.jersey.server.ApplicationHandler$3.run(ApplicationHandler.java:327) ~[jersey-server-2.17.jar:na]
! at org.glassfish.jersey.internal.Errors$2.call(Errors.java:289) ~[jersey-common-2.17.jar:na]
! at org.glassfish.jersey.internal.Errors$2.call(Errors.java:286) ~[jersey-common-2.17.jar:na]
! at org.glassfish.jersey.internal.Errors.process(Errors.java:315) ~[jersey-common-2.17.jar:na]
! at org.glassfish.jersey.internal.Errors.process(Errors.java:297) ~[jersey-common-2.17.jar:na]
! at org.glassfish.jersey.internal.Errors.processWithException(Errors.java:286) ~[jersey-common-2.17.jar:na]
! at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:324) ~[jersey-server-2.17.jar:na]
! at org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:338) ~[jersey-container-servlet-core-2.17.jar:na]
! at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:171) ~[jersey-container-servlet-core-2.17.jar:na]
! at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:363) ~[jersey-container-servlet-core-2.17.jar:na]
! at javax.servlet.GenericServlet.init(GenericServlet.java:244) ~[javax.servlet-api-3.1.0.jar:3.1.0]
! at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:612) ~[jetty-servlet-9.2.9.v20150224.jar:9.2.9.v20150224]
! ... 36 common frames omitted
! Causing: javax.servlet.ServletException: org.glassfish.jersey.servlet.ServletContainer-2d4f67e@7502d052==org.glassfish.jersey.servlet.ServletContainer,1,false
! at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:633) ~[jetty-servlet-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.servlet.ServletHolder.initialize(ServletHolder.java:395) ~[jetty-servlet-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:871) ~[jetty-servlet-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:298) ~[jetty-servlet-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:741) ~[jetty-server-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) ~[jetty-util-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132) ~[jetty-util-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114) ~[jetty-util-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61) ~[jetty-server-9.2.9.v20150224.jar:9.2.9.v20150224]
! at com.codahale.metrics.jetty9.InstrumentedHandler.doStart(InstrumentedHandler.java:103) ~[metrics-jetty9-3.1.1.jar:3.1.1]
! at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) ~[jetty-util-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132) ~[jetty-util-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114) ~[jetty-util-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61) ~[jetty-server-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) ~[jetty-util-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132) ~[jetty-util-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114) ~[jetty-util-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61) ~[jetty-server-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.server.handler.RequestLogHandler.doStart(RequestLogHandler.java:140) ~[jetty-server-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) ~[jetty-util-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132) ~[jetty-util-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114) ~[jetty-util-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61) ~[jetty-server-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.server.handler.StatisticsHandler.doStart(StatisticsHandler.java:232) ~[jetty-server-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) ~[jetty-util-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132) ~[jetty-util-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.server.Server.start(Server.java:387) ~[jetty-server-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114) ~[jetty-util-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61) ~[jetty-server-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.server.Server.doStart(Server.java:354) ~[jetty-server-9.2.9.v20150224.jar:9.2.9.v20150224]
! at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) ~[jetty-util-9.2.9.v20150224.jar:9.2.9.v20150224]
! at io.dropwizard.cli.ServerCommand.run(ServerCommand.java:43) ~[dropwizard-core-0.8.1.jar:0.8.1]
! at io.dropwizard.cli.EnvironmentCommand.run(EnvironmentCommand.java:43) [dropwizard-core-0.8.1.jar:0.8.1]
! at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:76) [dropwizard-core-0.8.1.jar:0.8.1]
! at io.dropwizard.cli.Cli.run(Cli.java:70) [dropwizard-core-0.8.1.jar:0.8.1]
! at io.dropwizard.Application.run(Application.java:73) [dropwizard-core-0.8.1.jar:0.8.1]
! at com.keypr.webservices.WebServicesApplication.main(WebServicesApplication.java:32) [main/:na]
INFO  [2015-05-13 23:03:47,161] org.eclipse.jetty.server.ServerConnector: Stopped application@1d7f2f0a{HTTP/1.1}{0.0.0.0:8080}
INFO  [2015-05-13 23:03:47,162] org.eclipse.jetty.server.ServerConnector: Stopped admin@54defd69{HTTP/1.1}{0.0.0.0:9090}
Exception in thread "main" javax.servlet.ServletException: org.glassfish.jersey.servlet.ServletContainer-2d4f67e@7502d052==org.glassfish.jersey.servlet.ServletContainer,1,false
    at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:633)
    at org.eclipse.jetty.servlet.ServletHolder.initialize(ServletHolder.java:395)
    at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:871)
    at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:298)
    at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:741)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
    at com.codahale.metrics.jetty9.InstrumentedHandler.doStart(InstrumentedHandler.java:103)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
    at org.eclipse.jetty.server.handler.RequestLogHandler.doStart(RequestLogHandler.java:140)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
    at org.eclipse.jetty.server.handler.StatisticsHandler.doStart(StatisticsHandler.java:232)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
    at org.eclipse.jetty.server.Server.start(Server.java:387)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
    at org.eclipse.jetty.server.Server.doStart(Server.java:354)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at io.dropwizard.cli.ServerCommand.run(ServerCommand.java:43)
    at io.dropwizard.cli.EnvironmentCommand.run(EnvironmentCommand.java:43)
    at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:76)
    at io.dropwizard.cli.Cli.run(Cli.java:70)
    at io.dropwizard.Application.run(Application.java:73)
    at com.keypr.webservices.WebServicesApplication.main(WebServicesApplication.java:32)
Caused by: java.lang.NullPointerException
    at io.dropwizard.jersey.DropwizardResourceConfig$EndpointLogger.normalizePath(DropwizardResourceConfig.java:182)
    at io.dropwizard.jersey.DropwizardResourceConfig$EndpointLogger.populateEndpoints(DropwizardResourceConfig.java:156)
    at io.dropwizard.jersey.DropwizardResourceConfig$EndpointLogger.populateEndpoints(DropwizardResourceConfig.java:151)
    at io.dropwizard.jersey.DropwizardResourceConfig$EndpointLogger.<init>(DropwizardResourceConfig.java:147)
    at io.dropwizard.jersey.DropwizardResourceConfig.getEndpointsInfo(DropwizardResourceConfig.java:125)
    at io.dropwizard.jersey.DropwizardResourceConfig.logComponents(DropwizardResourceConfig.java:76)
    at io.dropwizard.jersey.DropwizardResourceConfig$ComponentLoggingListener.onEvent(DropwizardResourceConfig.java:202)
    at org.glassfish.jersey.server.internal.monitoring.CompositeApplicationEventListener.onEvent(CompositeApplicationEventListener.java:74)
    at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:587)
    at org.glassfish.jersey.server.ApplicationHandler.access$500(ApplicationHandler.java:166)
    at org.glassfish.jersey.server.ApplicationHandler$3.run(ApplicationHandler.java:327)
    at org.glassfish.jersey.internal.Errors$2.call(Errors.java:289)
    at org.glassfish.jersey.internal.Errors$2.call(Errors.java:286)
    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.processWithException(Errors.java:286)
    at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:324)
    at org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:338)
    at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:171)
    at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:363)
    at javax.servlet.GenericServlet.init(GenericServlet.java:244)
    at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:612)
    ... 36 more

clamothe avatar May 13 '15 23:05 clamothe

Also seeing the same thing. I tracked it down to an upstream bug last week, but can't find it anymore.

Edit: May be this one: https://github.com/swagger-api/swagger-core/issues/951

Edit2: It is not the same issue as mine. Mine was this cause:

Caused by: java.lang.NullPointerException
    at com.wordnik.swagger.jaxrs.config.BeanConfig.configure(BeanConfig.java:223)

Not sure why it's null though...

esiqveland avatar May 20 '15 14:05 esiqveland

@clamothe I don't think this is a dropwizard-swagger issue. Please check if all of your resources have the @Path annotation at class-level. I got the same issue here and fixing the annotations the problem gone away. FYI, I'm with dropwizard 0.8.1 and dropwizard-swagger 0.7.0.

thiagomoretto avatar May 20 '15 17:05 thiagomoretto

Unfortunately I don't have time to look at this again right now. However if it's helpful, one of my sub-resources intentionally does not have a @Path annotation.

The error I received was from Swagger's ApiListingResource returning no Path.

clamothe avatar May 20 '15 21:05 clamothe

This issue should not happen anymore in a future dropwizard release: https://github.com/dropwizard/dropwizard/pull/1067

thiagomoretto avatar May 25 '15 16:05 thiagomoretto

@esiqveland I am facing the same issue with BeanConfig.java:223 file, did you manage to solve this?

sheldon-sminq avatar Jun 03 '15 11:06 sheldon-sminq

No, but I have not had the time to try it again since I found it didn't work. I downgraded to previous dropwizard-swagger.

esiqveland avatar Jun 03 '15 11:06 esiqveland

Which version is that? does it work with dropwizard 0.8.1?

sheldon-sminq avatar Jun 03 '15 11:06 sheldon-sminq

Worked with 0.6 thanks @esiqveland

sheldon-sminq avatar Jun 03 '15 12:06 sheldon-sminq

@thiagomoretto >>Please check if all of your resources have the @Path annotation at class-level. It worked for me with DropWizard 0.8.2. Thank you!

damino avatar Oct 20 '15 08:10 damino