mk23 / jmxproxy

JMX to HTTP Proxy
https://mk23.github.io/jmxproxy
MIT License
42 stars 19 forks source link

NPE thrown when configuration has null values for durations. #183

Open mk23 opened 6 years ago

mk23 commented 6 years ago

For example, if clean_interval is null in config, this is thrown:

13:17:40.411 [main]            ERROR io.dropwizard.cli.ServerCommand - Unable to start server, shutting down
org.eclipse.jetty.util.MultiException: Multiple exceptions
    at org.eclipse.jetty.server.Server.doStart(Server.java:382)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at io.dropwizard.cli.ServerCommand.run(ServerCommand.java:53)
    at io.dropwizard.cli.EnvironmentCommand.run(EnvironmentCommand.java:44)
    at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:85)
    at io.dropwizard.cli.Cli.run(Cli.java:75)
    at io.dropwizard.Application.run(Application.java:93)
    at com.github.mk23.jmxproxy.JMXProxyApplication.main(JMXProxyApplication.java:42)
    Suppressed: java.util.concurrent.RejectedExecutionException: org.eclipse.jetty.io.ManagedSelector$$Lambda$46/665137804@1e5f4170
        at org.eclipse.jetty.util.thread.QueuedThreadPool.execute(QueuedThreadPool.java:402)
        at org.eclipse.jetty.io.SelectorManager.execute(SelectorManager.java:171)
        at org.eclipse.jetty.io.ManagedSelector.doStart(ManagedSelector.java:101)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:133)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:115)
        at org.eclipse.jetty.io.SelectorManager.doStart(SelectorManager.java:271)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:133)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:107)
        at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:278)
        at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:81)
        at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:238)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
        at org.eclipse.jetty.server.Server.doStart(Server.java:397)
        ... 7 common frames omitted
Caused by: java.lang.NullPointerException: null
    at com.github.mk23.jmxproxy.jmx.ConnectionManager.start(ConnectionManager.java:232)
    at io.dropwizard.lifecycle.JettyManaged.doStart(JettyManaged.java:27)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:133)
    at org.eclipse.jetty.server.Server.start(Server.java:418)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:115)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
    at org.eclipse.jetty.server.Server.doStart(Server.java:385)
    ... 7 common frames omitted
mk23 commented 6 years ago

Add null checks and tests.