Update to fix issues introduced in Boot 2.0.0.M1

This commit is contained in:
Dave Syer
2017-05-16 18:16:14 +01:00
parent 021a77d997
commit 3f005ab238
4 changed files with 14 additions and 9 deletions

View File

@@ -62,7 +62,7 @@ public class ConfigurationPropertiesRebinder
private ApplicationContext applicationContext;
private Map<String, Exception> errors = new ConcurrentHashMap<>();
private boolean resetting = false;
public ConfigurationPropertiesRebinder(
@@ -129,7 +129,7 @@ public class ConfigurationPropertiesRebinder
private void resetBinder() {
try {
setField(binder, "binder", null);
setField(binder, "propertySources", null);
binder.afterPropertiesSet();
}
catch (Exception e) {

View File

@@ -9,6 +9,7 @@ import java.util.Map;
import java.util.Set;
import org.springframework.boot.Banner.Mode;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.config.ConfigFileApplicationListener;
import org.springframework.cloud.bootstrap.BootstrapApplicationListener;
@@ -65,7 +66,8 @@ public class ContextRefresher {
StandardEnvironment environment = copyEnvironment(
this.context.getEnvironment());
SpringApplicationBuilder builder = new SpringApplicationBuilder(Empty.class)
.bannerMode(Mode.OFF).web(false).environment(environment);
.bannerMode(Mode.OFF).web(WebApplicationType.NONE)
.environment(environment);
// Just the listeners that affect the environment (e.g. excluding logging
// listener because it has side effects)
builder.application()

View File

@@ -151,7 +151,7 @@ public class RefreshScope extends GenericScope
try {
ConfigurationPropertiesBindingPostProcessor processor = context
.getBean(ConfigurationPropertiesBindingPostProcessor.class);
setField(processor, "binder", null);
setField(processor, "propertySources", null);
processor.afterPropertiesSet();
}
catch (Exception e) {