If the use of AOT-generated artifacts isn't enabled, the child management context is an AnnotationConfigServletWebServerApplicationContext. It should be a ServletWebServerApplicationContext.