Guice injection not working with Dropwizard -
i new dropwizard , guice, followed tutorial : dropwizard , guice integration. when executing main method, i've got error:
default configuration has error: * message can not found (was null) so guess guice injection did not work. have exact same code tutorial, except don't have plugins part in pom.xml, , have line in main method:
new serviceapplication().run(new string[] {"server"}); instead of:
new serviceapplication().run(args); am missing something? there must add?
thanks.
yes, have missed important bit. article gives following command running dropwizard app (please note string after server option, points file configuration options):
$ java -jar target/dropwizardguice-1.0-snapshot.jar server config.yml
also earlier in article there description of relation between configuration .yml file , guice:
now need bit of glue code takes message configuration file make available guice.
by changing code in main method to:
new serviceapplication().run(new string[] {"server"});
you explicitly refused provide dropwizard information needs configuration options (including in case value of message property). , error message says.
Comments
Post a Comment