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

Cascading exceptions in InstrumentedHandler when super.doStart fails #3325

Closed
mattnelson opened this issue Apr 24, 2023 · 1 comment · Fixed by #3379 or #3380
Closed

Cascading exceptions in InstrumentedHandler when super.doStart fails #3325

mattnelson opened this issue Apr 24, 2023 · 1 comment · Fixed by #3379 or #3380
Labels
Milestone

Comments

@mattnelson
Copy link

When something else throws an exception during InstrumentedHandler's call to super.doStart. It causes a second exception during doStop.
This was with dropwizard-2.1.6 and metrics-4.2.18

Possibly introduced in #3133?

first exception

ERROR [main] io.dropwizard.cli.ServerCommand Unable to start server, shutting down
java.lang.RuntimeException: Cannot run Liquibase, liquibase.datasource is not set
	at liquibase.integration.servlet.GenericServletListener.executeUpdate(GenericServletListener.java:219) 
	at liquibase.integration.servlet.GenericServletListener.contextInitialized(GenericServletListener.java:131) 
	... 44 common frames omitted
Wrapped by: java.lang.RuntimeException: java.lang.RuntimeException: Cannot run Liquibase, liquibase.datasource is not set
	at liquibase.integration.servlet.GenericServletListener.contextInitialized(GenericServletListener.java:136) 
	at liquibase.integration.servlet.LiquibaseServletListener.contextInitialized(LiquibaseServletListener.java:14) 
	at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:1073)
	at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:572)
	at org.eclipse.jetty.server.handler.ContextHandler.contextInitialized(ContextHandler.java:1002)
	at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:765)
	at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:379)
	at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:916)
	at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:288)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110)
	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:97)
	at com.codahale.metrics.jetty9.InstrumentedHandler.doStart(InstrumentedHandler.java:165)

second exception

WARN  [main] io.dropwizard.cli.ServerCommand Failure during stop server
java.lang.NullPointerException: Cannot invoke "java.util.Map.keySet()" because "this.responseCodeMeters" is null
	at com.codahale.metrics.jetty9.InstrumentedHandler.doStop(InstrumentedHandler.java:284)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:94)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.stop(ContainerLifeCycle.java:180)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStop(ContainerLifeCycle.java:201)
	at org.eclipse.jetty.server.handler.AbstractHandler.doStop(AbstractHandler.java:108)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:94)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.stop(ContainerLifeCycle.java:180)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStop(ContainerLifeCycle.java:201)
	at org.eclipse.jetty.server.handler.AbstractHandler.doStop(AbstractHandler.java:108)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:94)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.stop(ContainerLifeCycle.java:180)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStop(ContainerLifeCycle.java:201)
	at org.eclipse.jetty.server.handler.AbstractHandler.doStop(AbstractHandler.java:108)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:94)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.stop(ContainerLifeCycle.java:180)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStop(ContainerLifeCycle.java:201)
	at org.eclipse.jetty.server.handler.AbstractHandler.doStop(AbstractHandler.java:108)
	at org.eclipse.jetty.server.handler.StatisticsHandler.doStop(StatisticsHandler.java:272)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:94)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.stop(ContainerLifeCycle.java:180)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStop(ContainerLifeCycle.java:201)
	at org.eclipse.jetty.server.handler.AbstractHandler.doStop(AbstractHandler.java:108)
	at org.eclipse.jetty.server.Server.doStop(Server.java:470)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:94)
	at io.dropwizard.cli.ServerCommand.run(ServerCommand.java:56)
	at io.dropwizard.cli.EnvironmentCommand.run(EnvironmentCommand.java:68)
	at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:98)
	at io.dropwizard.cli.Cli.run(Cli.java:78)
	at io.dropwizard.Application.run(Application.java:94)
@joschi
Copy link
Member

joschi commented May 30, 2023

Thanks for reporting this!

The issue should be fixed in the next release of Dropwizard Metrics 4.2.x.

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