0

I have this project in Springboot with Apache Camel and since we changed the version (we updated Spring to 2.7.2 and Camel to 3.16.0, which was previously in 2.x) in Maven, now I have to "migrate" these dataformats that are in the applicationContext.xml:

<dataFormats>
    <jacksonxml id="jack" prettyPrint="true"/>
    <jacksonxml id="ResponseNack" unmarshalTypeName="com.project.dataset.RespNack"/>
    <jacksonxml id="ResponseAck" unmarshalTypeName="com.project.dataset.RespAck"/>
    <bindy id="headerDataFormat" type "Fixed" classType="com.project.dataset.AcctBalHeader"/>
    <bindy id="headerDataFormat" type "Csv" classType="com.project.dataset.AcctBalBody"/>
    <bindy id="headerDataFormat" type "Fixed" classType="com.project.dataset.AcctBalTrailer"/>
</dataFormats>

I don't see that the tag is being recognized and it crashes directly due to the applicationContext:

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
[2022-08-30T16:36:08,188][INFO ][io.undertow] stopping server: Undertwo - 2.2.19.Final
[2022-08-30T16:36:08,225][ERROR][boot.SpringApplication] Application run failed
org.apache.camel.spring.boot.CamelSpringBootInitializationException: org.apache.camel.xml.io.XmlPullParserException: Unexpected element '{http://camel.apache.org/schema/spring}dataFormats'
... (the error continues)

How can I migrate or refactor these dataformats?

Thank you!

f_puras
  • 2,521
  • 4
  • 33
  • 38
  • For me it looks like a problem with schema definition (xsd). Can you post the whole xml? Also the next line in the error would be nice (I believe it will say what is expected). BTW: I believe, you should upgrade to 3.18.1 for Spring Boot 2.7.x – grekier Sep 05 '22 at 06:38

1 Answers1

0

The dataformat parameter unmarshalTypeName has been changed to unmarshalType. Camel 3.16.0 has been based on Spring Boot 2.6.4, so you should use Spring Boot 2.6.4 and not 2.7.4. Camel 3.18.0 supports Spring Boot 2.7.1, Camel 3.18.1 supports Spring boot 2.7.2 and Camel 3.18.2 (released these days) supports Spring Boot 2.7.3

Oscerd
  • 1,616
  • 11
  • 14