Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-21340

camel-spring-boot - JSON validator object mapper and standalone tomcat

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • 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.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            davsclaus Claus Ibsen
            foobarqix Olivier Jacquemart
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment