@Override public final void customize(T factory) { ManagementServerProperties managementServerProperties = BeanFactoryUtils .beanOfTypeIncludingAncestors(this.beanFactory, ManagementServerProperties.class); // Customize as per the parent context first (so e.g. the access logs go to // the same place) customizeSameAsParentContext(factory); // Then reset the error pages factory.setErrorPages(Collections.emptySet()); // and add the management-specific bits ServerProperties serverProperties = BeanFactoryUtils .beanOfTypeIncludingAncestors(this.beanFactory, ServerProperties.class); customize(factory, managementServerProperties, serverProperties); }