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

spring-boot - Error binding property in servlet-starter

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.2.0
    • Component/s: camel-servlet
    • Labels:
    • Estimated Complexity:
      Unknown

      Description

      Hi,
      I have this dependencies

      // Camel
      implementation 'org.apache.camel.springboot:camel-spring-boot-starter:3.1.0'
      implementation 'org.apache.camel.springboot:camel-jackson-starter:3.1.0'
      implementation 'org.apache.camel.springboot:camel-jacksonxml-starter:3.1.0'
      implementation 'org.apache.camel.springboot:camel-activemq-starter:3.1.0'
      implementation 'org.apache.camel.springboot:camel-servlet-starter:3.1.0'
      implementation 'org.apache.camel.springboot:camel-rest-starter:3.1.0' 

      My application.properties

      camel.component.servlet.mapping.enabled=true
      camel.component.servlet.mapping.context-path=/rest/*
      
      camel.rest.component=servlet
      camel.rest.binding-mode=json

      When i run application i see this stacktrace

       Exception in thread "CamelMainRunController" java.lang.RuntimeException: org.apache.camel.PropertyBindingException: Error binding property (camel.component.servlet.mapping.enabled=true) with name: mapping.enabled on bean: org.apache.camel.component.servlet.ServletComponent@62562970 with value: true
      	at org.apache.camel.spring.boot.CamelSpringBootApplicationController.run(CamelSpringBootApplicationController.java:90)
      	at org.apache.camel.spring.boot.CamelMainRunController$DaemonTask.run(CamelMainRunController.java:53)
      	at java.base/java.lang.Thread.run(Thread.java:834)
      Caused by: org.apache.camel.PropertyBindingException: Error binding property (camel.component.servlet.mapping.enabled=true) with name: mapping.enabled on bean: org.apache.camel.component.servlet.ServletComponent@62562970 with value: true
      	at org.apache.camel.main.BaseMainSupport.setPropertiesOnTarget(BaseMainSupport.java:176)
      	at org.apache.camel.main.BaseMainSupport.autoConfigurationFromProperties(BaseMainSupport.java:993)
      	at org.apache.camel.main.BaseMainSupport.autoconfigure(BaseMainSupport.java:545)
      	at org.apache.camel.main.BaseMainSupport.postProcessCamelContext(BaseMainSupport.java:587)
      	at org.apache.camel.main.BaseMainSupport.initCamelContext(BaseMainSupport.java:423)
      	at org.apache.camel.main.Main.doInit(Main.java:109)
      	at org.apache.camel.support.service.ServiceSupport.init(ServiceSupport.java:83)
      	at org.apache.camel.support.service.ServiceSupport.start(ServiceSupport.java:112)
      	at org.apache.camel.main.MainSupport.run(MainSupport.java:82)
      	at org.apache.camel.spring.boot.CamelSpringBootApplicationController.run(CamelSpringBootApplicationController.java:85)
      	... 2 more
      

      It always throw error on any first servlet property in configuration but all servlet properties binds correctly and works.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              Deymus Efanov Alexey
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: