java - Unrecognized Field in Dropwizard YAML File -
i'm getting following error when launching dropwizard application uses database connection mysql:
app.yaml has error: * unrecognized field at: database did mean?: - metrics - instanceid - logging - server - statsconfig [12 more]
at end of dropwizard configuration file, have following:
database: driverclass: com.mysql.jdbc.driver user: ${mysql_username} password: ${mysql_password} url: ${mysql_url}
and in configuration class, have following:
@valid() @notnull() @jsonproperty() private static datasourcefactory database; public static datasourcefactory getdatabase() { return database; } public static void setdatabase(final datasourcefactory database) { appconfig.database = database; }
several other complex configuration objects loading correctly (it's pretty big config file), 1 not. ideas why i'm getting error?
edit question similar one: unrecognizedpropertyexception while reading yaml file. however, solution didn't work me.
edit: check example application here , here.
@jsonproperty()
- there brackets here.private static datasourcefactory database;
- removestatic
here. see the docs how should like.- also add
= new datasourcefactory();
per docs , this question.
i've checked on old version of dropwizard
, number 2 immediate problem.
Comments
Post a Comment