Dropwizard won't start if config.yml is empty #8088
Unanswered
sleberknight
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This might be silly, but I recently came across a situation I've never experienced while using Dropwizard since 2014 (thanks for everything you do). Anyway, I created a very simple service so that I could test something out, and only needed code in the
Application
class. The configuration class extendedio.dropwizardio.dropwizard.core.Configuration
but had nothing else in it. And theconfig.yml
was empty, since I didn't need any custom configuration. So, I was surprised when I attempted to run the service and it would not start!I got different errors based on whether the
config.yml
is literally empty or whether it contains just the---
at the top.If the file is empty, you get:
If the config.yml contains only the
---
you get:Both of these were surprising, since I expected to be able to start a simple app without needing to put anything in the config file. If you put something in the config file, then it works. For example,
Or of course, you can put a custom property in your
Configuration
class and then put just that in the config file, e.g.,:I created simplest-dropwizard-service so that anyone can clone it, build, and try to run it using the various config files.
Given that I've used Dropwizard for 8 years and never had this happen, it is probably not all that important. But, it would be better if a service without any configuration started without error.
Beta Was this translation helpful? Give feedback.
All reactions