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

Unmarshalling with JAXBContext does not work: JAXB 2.3.0.1 in camel-spring-boot 2.22.0

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Abandoned
    • 2.22.0
    • None
    • camel-spring-boot
    • None
    • Unknown

    Description

      • camel-spring-boot-starter 2.22.0
        • camel-spring-boot 2.22.0
          •  jaxb-core 2.3.0.1
          • jaxb-impl 2.3.0.1

      In some code we have we use JAXB to unmarschall some XML to a POJO class we have containing a RedeliveryPolicyDefinition  as a property. 
      This seems to fail without errors and the property remains null.

      When we replace jaxb-core and  jaxb-impl version 2.3.0.1 to 2.2.11 the code seems to work again.

      Unmarshalling code:

      JAXBContext ctx = JAXBContext.newInstance(ErrorHandler.class);
      JAXBElement<ErrorHandler> errorHandler = ctx.createUnmarshaller().unmarshal(beanList.item(i), ErrorHandler.class);
      

      Pojo:

      @Getter
      @Setter
      @XmlRootElement(name = "errorHandler", namespace = "http://camel.apache.org/schema/spring")
      @XmlAccessorType(XmlAccessType.FIELD)
      public class ErrorHandler {
          @XmlAttribute
          private String id;
          @XmlElement
          private RedeliveryPolicyDefinition redeliveryPolicy;
          @XmlAttribute
          private org.apache.camel.spring.ErrorHandlerType type;
      

      XML:

      <errorHandlers>
          <errorHandler xmlns="http://camel.apache.org/schema/spring" id="eh-http" type="DefaultErrorHandler">
               <redeliveryPolicy maximumRedeliveries="4" redeliveryDelay="250" backOffMultiplier="2" useExponentialBackOff="true"/>
           </errorHandler>
      </errorHandlers>
      

      Attachments

        Activity

          People

            zregvart Zoran Regvart
            marvinstorage storage
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: