Issue 17335
CLI service runs even with exception during startup
17335
Reporter: mdoering
Type: Bug
Summary: CLI service runs even with exception during startup
Priority: Critical
Status: Open
Created: 2015-03-02 11:34:51.842
Updated: 2015-03-02 16:27:11.899
Description: The dwca downloader process starts up even though it throws an IllegalStateException during startup. It connects to rabbit and receives messages even though its in an illegal state.
Startup should fail completely in such cases with no running process remaining.
From the logs:
-----
[crap@b14g2 bin]$ cat ../logs/crawler-dwca-downloader.log
INFO [2015-03-02 11:04:52,318+0100] [main] org.gbif.cli.service.ServiceCommand: Service starting ...
INFO [2015-03-02 11:04:52,532+0100] [DownloaderService STARTING] org.gbif.common.messaging.DefaultMessagePublisher: Connecting to AMQP broker crawler:crawler@mq.gbif.org:5672 /uat
INFO [2015-03-02 11:04:52,711+0100] [DownloaderService STARTING] org.apache.curator.framework.imps.CuratorFrameworkImpl: Starting
INFO [2015-03-02 11:04:52,771+0100] [DownloaderService STARTING-EventThread] org.apache.curator.framework.state.ConnectionStateManager: State change: CONNECTED
WARN [2015-03-02 11:04:53,056+0100] [main] org.gbif.cli.service.ServiceCommand: Service failed to start
com.google.common.util.concurrent.UncheckedExecutionException: java.lang.IllegalArgumentException: Archive repository needs to be an existing directory: /home/crap/storage/dwca
at com.google.common.util.concurrent.Futures.wrapAndThrowUnchecked(Futures.java:1358) ~[crawler-cli.jar:na]
at com.google.common.util.concurrent.Futures.getUnchecked(Futures.java:1344) ~[crawler-cli.jar:na]
at com.google.common.util.concurrent.AbstractService.startAndWait(AbstractService.java:221) ~[crawler-cli.jar:na]
at com.google.common.util.concurrent.AbstractIdleService.startAndWait(AbstractIdleService.java:106) ~[crawler-cli.jar:na]
at org.gbif.cli.service.ServiceCommand.doRun(ServiceCommand.java:40) ~[crawler-cli.jar:na]
at org.gbif.cli.BaseCommand.run(BaseCommand.java:137) [crawler-cli.jar:na]
at org.gbif.cli.Application.run(Application.java:97) [crawler-cli.jar:na]
at org.gbif.cli.Application.main(Application.java:146) [crawler-cli.jar:na]
Caused by: java.lang.IllegalArgumentException: Archive repository needs to be an existing directory: /home/crap/storage/dwca
at org.gbif.crawler.dwca.downloader.DwcaCrawlConsumer.(DwcaCrawlConsumer.java:55) ~[crawler-cli.jar:na]
at org.gbif.crawler.dwca.downloader.DownloaderService.newConsumer(DownloaderService.java:29) ~[crawler-cli.jar:na]
]]>