Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'routerFunctionMapping' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfigurationEnableWebMvcConfiguration.class]:Failedtoinstantiate[org.sprMappingJackson2HttpMessageConverterConfiguration.class]: Unsatisfied dependency expressed through method 'mappingJackson2HttpMessageConverter' parameter 0: Error creating bean with name 'jacksonObjectMapper' defined in class path resource [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfigurationJacksonObjectMapperBuilderConfiguration.class]: Unsatisfied dependency expressed through method 'jacksonObjectMapperBuilder' parameter 1: Error creating bean with name 'standardJacksonObjectMapperBuilderCustomizer' defined in class path resource [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration$Jackson2ObjectMapperBuilderCustomizerConfiguration.class]: Unsatisfied dependency expressed through method 'standardJacksonObjectMapperBuilderCustomizer' parameter 0: Error creating bean with name 'spring.jackson-org.springframework.boot.autoconfigure.jackson.JacksonProperties': Failed to instantiate [org.springframework.boot.autoconfigure.jackson.JacksonProperties]: Constructor threw exception
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.function.support.RouterFunctionMapping]: Factory method 'routerFunctionMapping' threw exception with message: Error creating bean with name 'messageConverters' defined in class path resource [org/springframework/boot/autoconfigure/http/HttpMessageConvertersAutoConfiguration.class]: Failed to instantiate [org.springframework.boot.autoconfigure.http.HttpMessageConverters]: Factory method 'messageConverters' threw exception with message: Error creating bean with name 'mappingJackson2HttpMessageConverter' defined in class path resource [org/springframework/boot/autoconfigure/http/JacksonHttpMessageConvertersConfigurationMappingJackson2HttpMessageConverterConfiguration.class]:UnsatJacksonObjectMapperConfiguration.class]: Unsatisfied dependency expressed through method 'jacksonObjectMapper' parameter 0: Error creating bean with name 'jacksonObjectMapperBuilder' defined in class path resource [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfigurationJackson2ObjectMapperBuilderCustomizerConfiguration.class]: Unsatisfied dependency expressed through method 'standardJacksonObjectMapperBuilderCustomizer' parameter 0: Error creating bean with name 'spring.jackson-org.springframework.boot.autoconfigure.jackson.JacksonProperties': Failed to instantiate [org.springframework.boot.autoconfigure.jackson.JacksonProperties]: Constructor threw exception
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'messageConverters' defined in class path resource [org/springframework/boot/autoconfigure/http/HttpMessageConvertersAutoConfiguration.class]: Failed to instantiate [org.springframework.boot.autoconfigure.http.HttpMessageConverters]: Factory method 'messageConverters' threw exception with message: Error creating bean with name 'mappingJackson2HttpMessageConverter' defined in class path resource [org/springframework/boot/autoconfigure/http/JacksonHttpMessageConvertersConfigurationMappingJackson2HttpMessageConverterConfiguration.class]:UnsatJacksonObjectMapperConfiguration.class]: Unsatisfied dependency expressed through method 'jacksonObjectMapper' parameter 0: Error creating bean with name 'jacksonObjectMapperBuilder' defined in class path resource [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfigurationJackson2ObjectMapperBuilderCustomizerConfiguration.class]: Unsatisfied dependency expressed through method 'standardJacksonObjectMapperBuilderCustomizer' parameter 0: Error creating bean with name 'spring.jackson-org.springframework.boot.autoconfigure.jackson.JacksonProperties': Failed to instantiate [org.springframework.boot.autoconfigure.jackson.JacksonProperties]: Constructor threw exception
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.autoconfigure.http.HttpMessageConverters]: Factory method 'messageConverters' threw exception with message: Error creating bean with name 'mappingJackson2HttpMessageConverter' defined in class path resource [org/springframework/boot/autoconfigure/http/JacksonHttpMessageConvertersConfigurationMappingJackson2HttpMessageConverterConfiguration.class]:UnsatJacksonObjectMapperConfiguration.class]: Unsatisfied dependency expressed through method 'jacksonObjectMapper' parameter 0: Error creating bean with name 'jacksonObjectMapperBuilder' defined in class path resource [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfigurationJackson2ObjectMapperBuilderCustomizerConfiguration.class]: Unsatisfied dependency expressed through method 'standardJacksonObjectMapperBuilderCustomizer' parameter 0: Error creating bean with name 'spring.jackson-org.springframework.boot.autoconfigure.jackson.JacksonProperties': Failed to instantiate [org.springframework.boot.autoconfigure.jackson.JacksonProperties]: Constructor threw exception
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'mappingJackson2HttpMessageConverter' defined in class path resource [org/springframework/boot/autoconfigure/http/JacksonHttpMessageConvertersConfigurationMappingJackson2HttpMessageConverterConfiguration.class]:UnsatJacksonObjectMapperConfiguration.class]: Unsatisfied dependency expressed through method 'jacksonObjectMapper' parameter 0: Error creating bean with name 'jacksonObjectMapperBuilder' defined in class path resource [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfigurationJackson2ObjectMapperBuilderCustomizerConfiguration.class]: Unsatisfied dependency expressed through method 'standardJacksonObjectMapperBuilderCustomizer' parameter 0: Error creating bean with name 'spring.jackson-org.springframework.boot.autoconfigure.jackson.JacksonProperties': Failed to instantiate [org.springframework.boot.autoconfigure.jackson.JacksonProperties]: Constructor threw exception
The stack trace you've provided indicates that the Spring Boot application context has failed to load due to a complex chain of bean creation errors.
Here’s a high-level breakdown of the issue:
The fundamental cause seems to be linked to JacksonProperties, which Spring Boot uses to configure Jackson's ObjectMapper.
Unsatisfied dependency for standardJacksonObjectMapperBuilderCustomizer, which customizes the Jackson2ObjectMapperBuilder.
That further cascades into issues creating jacksonObjectMapperBuilder, jacksonObjectMapper, mappingJackson2HttpMessageConverter, and messageConverters.
To resolve this problem, consider the following steps:
Check your configuration properties: The root cause is linked to JacksonProperties. Ensure that any custom configuration you have provided in application.properties or application.yml for Jackson is correct. It's possible that there is an incorrect property setting that Jackson is unable to parse or use to instantiate JacksonProperties.
Validate any custom Jackson customization: If you have any custom beans or configuration classes that affect Jackson's ObjectMapper, confirm that they are correctly defined and not causing any conflicts with the auto-configured beans.
Review your dependencies: Ensure that your Maven or Gradle dependencies do not contain conflicting versions of Jackson or any related libraries.
Isolate the issue: Create a minimal test configuration that only sets up the part of the application context that is failing. This can help isolate configuration issues.
Enable debug logging: Starting your application with debug logs enabled might give you a clearer picture of what Spring Boot is trying to do when it's configuring your application context. You can enable debug logs by setting logging.level.org.springframework=DEBUG in your application.properties or application.yml.
Inspect the source code: Looking at the source code of the configurations mentioned in the stack trace can sometimes give clues as to what specific conditions or expectations are not being met. You may want to look at JacksonAutoConfiguration, HttpMessageConvertersAutoConfiguration, and JacksonHttpMessageConvertersConfiguration in Spring Boot's source code.
If these steps do not help, it might be useful to get the full stack trace, as it might contain more specific error messages closer to the root cause of the exception. Alternatively, you could share more details of your configuration or the custom code that might be interacting with Jackson's ObjectMapper setup.