Skip to content

Commit

Permalink
Reapply "catch exception in GrailsApplicationBuilder (#425)" (#430)
Browse files Browse the repository at this point in the history
* Reapply "catch exception in GrailsApplicationBuilder (#425)"

This reverts commit a793484.
  • Loading branch information
jamesfredley committed Sep 26, 2024
1 parent aadb56d commit 36c53d2
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,14 @@ class GrailsApplicationBuilder {
def configuredEnvironment = context.getEnvironment()
def beanFactory = context.getBeanFactory()
def beanExcludes = [ConversionService, Environment, PropertyResolver, ConfigurableEnvironment]
def objectMapper = ClassUtils.forName('com.fasterxml.jackson.databind.ObjectMapper', context.getClassLoader())
if (objectMapper) {

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 36c53d2

Please sign in to comment.