[ 
https://issues.apache.org/jira/browse/CAMEL-21340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17889102#comment-17889102
 ] 

Olivier Jacquemart commented on CAMEL-21340:
--------------------------------------------

hi [~davsclaus],

yes, in the real scenario, in producation, the application is a war file 
deployed in a standalone Tomcat.

The problem can be reproduced running the 
[HelloApplication|https://github.com/ojacquemart/camel-reproducers/blob/main/src/main/java/com/foobarqix/camel/reproducers/HelloApplication.java]
 from the reproducer but I can upload a war file if needed.
The application contains the modifications from the [Spring Boot ticket 
#35091|https://github.com/spring-projects/spring-boot/issues/35091] to 
reproduce the issue.

> camel-spring-boot - 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
>            Priority: Minor
>
> 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)

Reply via email to