简体   繁体   中英

Problems migrating dataformats (bindy, etc) in Springboot with Apache Camel

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!

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM