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.

  1. @jsonproperty() - there brackets here.
  2. private static datasourcefactory database; - remove static here. see the docs how should like.
  3. also add = new datasourcefactory(); per docs , this question.

i've checked on old version of dropwizard , number 2 immediate problem.


Comments

Popular posts from this blog

account - Script error login visual studio DefaultLogin_PCore.js -

xcode - CocoaPod Storyboard error: -