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

Can't load custom dataformat

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Not A Bug
    • 3.14.3
    • None
    • None
    • None
    • Java: JDK 11 (Adoptium Temurin)

      OS: Windows 10

    • Unknown

    Description

      I created a custom dataformat and call it with the XML-IO DSL like this:

          <unmarshal>
            <custom ref="myCustomDataformat"/>
          </unmarshal>

      I get the following error:

      org.apache.camel.xml.io.XmlPullParserException: Unexpected element '{}custom'

      According to the XSD I would expect the custom element to be available

      https://camel.apache.org/schema/spring/camel-spring-3.14.3.xsd

      Also in Camel in Action2 (page 340) there is an example of this.

       

      I load the XML with the "xml-io" library and "dataformat" is also on the classpath.

      On the documentation page:

      https://camel.apache.org/components/3.14.x/dataformats/index.html

      The 'custom' dataformat isn't listed however and there is no documentation of it. Is it still supported?

      Complete stacktrace:

      org.apache.camel.xml.io.XmlPullParserException: Unexpected element '{}custom'
              at org.apache.camel.xml.in.BaseParser.handleUnexpectedElement(BaseParser.java:187)
              at org.apache.camel.xml.in.BaseParser.doParse(BaseParser.java:107)
              at org.apache.camel.xml.in.ModelParser.doParseUnmarshalDefinition(ModelParser.java:1449)
              at org.apache.camel.xml.in.ModelParser.doParseProcessorDefinitionRef(ModelParser.java:3212)
              at org.apache.camel.xml.in.ModelParser.lambda$outputDefinitionElementHandler$4(ModelParser.java:132)
              at org.apache.camel.xml.in.ModelParser.lambda$doParseRouteDefinition$71(ModelParser.java:1031)
              at org.apache.camel.xml.in.BaseParser.doParse(BaseParser.java:106)
              at org.apache.camel.xml.in.ModelParser.doParseRouteDefinition(ModelParser.java:1005)
              at org.apache.camel.xml.in.ModelParser.parseSingleRoutesDefinition(ModelParser.java:1185)
              at org.apache.camel.xml.in.ModelParser.parseRoutesDefinition(ModelParser.java:1178)
              at org.apache.camel.dsl.xml.io.XmlRoutesBuilderLoader$1.configure(XmlRoutesBuilderLoader.java:78)
              at org.apache.camel.builder.RouteBuilder.checkInitialized(RouteBuilder.java:607)
              at org.apache.camel.builder.RouteBuilder.configureRoutes(RouteBuilder.java:553)
              at org.apache.camel.builder.RouteBuilder.updateRoutesToCamelContext(RouteBuilder.java:515)
              at org.apache.camel.spi.RoutesLoader.updateRoutes(RoutesLoader.java:105)
              at org.apache.camel.spi.RoutesLoader.updateRoutes(RoutesLoader.java:87)

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              skin27 Raymond
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: