Skip to content

Commit

Permalink
Merge branch '4.0.x' into restore-demo-33
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesfredley committed Sep 29, 2024
2 parents e6e0407 + 5e8f581 commit a4b17cc
Showing 1 changed file with 1 addition and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,20 +117,11 @@ class GrailsApplicationBuilder {
} else {
context = (ConfigurableApplicationContext) ClassUtils.forName('org.springframework.context.annotation.AnnotationConfigApplicationContext').getDeclaredConstructor().newInstance()
}
((AnnotationConfigRegistry) context).register(GrailsAutoConfiguration, CoreConfiguration, CodecsConfiguration, DataBindingConfiguration, MimeTypesConfiguration)
((AnnotationConfigRegistry) context).register(CoreConfiguration, CodecsConfiguration, DataBindingConfiguration, MimeTypesConfiguration)

def applicationClassLoader = this.class.classLoader
def configuredEnvironment = context.getEnvironment()
def beanFactory = context.getBeanFactory()
def beanExcludes = [ConversionService, Environment, PropertyResolver, ConfigurableEnvironment]

try {
Class<?> objectMapper = ClassUtils.forName('com.fasterxml.jackson.databind.ObjectMapper', context.classLoader)
beanExcludes.add(objectMapper)
} catch (ignored) {
// ObjectMapper not found on classpath
}

(beanFactory as DefaultListableBeanFactory).with {
setAllowBeanDefinitionOverriding(true)
setAllowCircularReferences(true)
Expand Down

0 comments on commit a4b17cc

Please sign in to comment.