Skip to content

Commit

Permalink
catch exception in GrailsApplicationBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesfredley committed Sep 25, 2024
1 parent c7706e6 commit 88b5dc9
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,16 @@ 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())

Class<?> objectMapper
try {
objectMapper = ClassUtils.forName('com.fasterxml.jackson.databind.ObjectMapper', context.getClassLoader())
} catch (ignored) {
}
if (objectMapper) {
beanExcludes.add(objectMapper)
}

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

0 comments on commit 88b5dc9

Please sign in to comment.