Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
4.8.0
-
None
-
Unknown
Description
If a Camel 4.8.0 using Spring Boot is deployed in a standalone Tomcat with JNDI enabled an exception is thrown at startup:
WARN 4424 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.apache.camel.component.jsonvalidator.springboot.JsonValidatorComponentAutoConfiguration': Unsatisfied dependency expressed through field 'configuration': Error creating bean with name 'camel.component.json-validator-org.apache.camel.component.jsonvalidator.springboot.JsonValidatorComponentConfiguration': Could not bind properties to 'JsonValidatorComponentConfiguration' : prefix=camel.component.json-validator, ignoreInvalidFields=false, ignoreUnknownFields=true ... *************************** APPLICATION FAILED TO START *************************** Description: Failed to bind properties under 'camel.component.json-validator.object-mapper.serializer-provider.generator.write-capabilities' to com.fasterxml.jackson.core.util.JacksonFeatureSet<com.fasterxml.jackson.core.StreamWriteCapability>: Reason: org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'camel.component.json-validator.object-mapper.serializer-provider.generator.write-capabilities' to com.fasterxml.jackson.core.util.JacksonFeatureSet<com.fasterxml.jackson.core.StreamWriteCapability> Action: Update your application's configuration
According to Spring boot #35091, one solution is to add a spring.properties file in the src/main/resoures folder with the content:
spring.jndi.ignore=true
Is there any other workaround solution?
The problem seems to come from the ObjectMapper field from the JsonValidatorComponentAutoConfiguration configuration.
Here is a repo to reproduce the problem: camel-reproducer, if it can help.