here\'s my code snippets.
here\'s my yml file:
productionServer:
host: production-server.amazonaws.com
publicIp: xx.xx.xx.xx
privateIp: xx.xx.x
The problem is, with this configuration
bind(MyConfiguration.class).to(MyConfiguration.class);
HK2 will create a new instance of the MyConfiguration
. It will not be the same instance populated by DW. What you can do though, is use the instance created by DW, by simply binding that same instance in your HK2 configuration
public class MyApplication extends Application<MyConfiguration> {
@Override
public void run(final MyConfiguration config, Environment env) {
env.jersey().register(new AbstractBinder() {
@Override
protected void configure() {
bind(config).to(MyConfiguration.class);
}
});
}
}