Olivier Jacquemart created CAMEL-21340:
------------------------------------------
Summary: JSON validator object mapper and standalone tomcat
Key: CAMEL-21340
URL: https://issues.apache.org/jira/browse/CAMEL-21340
Project: Camel
Issue Type: Bug
Components: camel-core, camel-spring-boot, camel-validator
Affects Versions: 4.8.0
Reporter: Olivier Jacquemart
If a Camel 4.8.0 using Spring Boot is deployed in a standalone Tomcat with JNDI
enabled an exception is thrown at startup:
{code:java}
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{code}
According to [Spring boot
#35091|https://github.com/spring-projects/spring-boot/issues/35091], one
solution is to add a spring.properties file in the src/main/resoures folder
with the content:
{code:java}
spring.jndi.ignore=true {code}
Is there any other workaround solution?
The problem seems to come from the ObjectMapper field from the
[JsonValidatorComponentAutoConfiguration|https://github.com/apache/camel-spring-boot/blob/main/components-starter/camel-json-validator-starter/src/main/java/org/apache/camel/component/jsonvalidator/springboot/JsonValidatorComponentAutoConfiguration.java]
configuration.
Here is a repo to reproduce the problem:
[camel-reproducer|https://github.com/ojacquemart/camel-reproducers], if it can
help.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)