Currently, it is the ContextIdApplicationContextInitializer (that implements ApplicationContextInitializer) that sets contextId; Since all the initializers are ordered, may be an initializer (with the ContainerMetaData's generated ID) that sets the application context id after ContextIdApplicationContextInitializer could help.