You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Eric Eduardo Piñera Trinchet <ee...@gmail.com> on 2022/04/04 18:41:52 UTC

Doubts on how to use jacksonxml as xmlDataFormat for bindingMode.auto in camel 3.3.0

Hello everyone, I hope this channel is the right one to share my doubt, if
not, I apologize, and I would appreciate help regarding where to write
asking for help.

*******************************************************************

I changed my version of camel from 3.1.0 to 3.3.0 and my setting for
bindingMode.auto doesn't work. Previously I had this configuration:

.bindingMode(RestBindingMode.auto) .xmlDataFormat("jacksonxml")
.dataFormatProperty("prettyPrint", "true")
.dataFormatProperty("contentTypeHeader", "true");

But after camel upgraded from 3.2.0 to 3.3.0 when I try to access the
endpoint I get this error:

org.apache.camel.FailedToCreateRouteException: Failed to create route
get-xxxx: Route(get-xxxx)[From[rest://get:xxxxxx@0x7a615950], Lo... because
of java.lang.IllegalArgumentException: Cannot find
RestBindingJaxbDataFormatFactory on classpath. Add camel-jaxb to classpath.

I tried adding camel-jaxb dependency but I get this error:

class org.apache.camel.component.jacksonxml.JacksonXMLDataFormat cannot be
cast to class org.apache.camel.converter.jaxb.JaxbDataFormat
(org.apache.camel.component.jacksonxml.JacksonXMLDataFormat and
org.apache.camel.converter.jaxb .JaxbDataFormat are in unnamed module of
loader 'app')

*Note*: I'm ussing camel with spring-boot

*I wonder what am I missing to be able to use jacksonxml as xmlDataFormat.*

All help is appreciated. Thanks in advance

I would expect to be able to use jacksonxml as xmlDataFormat since all the
annotations I have in the pojos are from
com.fasterxml.jackson.dataformat.xml.annotation

sjms batch

Posted by Bing Lu <mf...@yahoo.com.INVALID>.
 Hi, just wondering why the sjms-batch component was removed in camel 3.** and when will it be reimplemented? thanks

Re: Doubts on how to use jacksonxml as xmlDataFormat for bindingMode.auto in camel 3.3.0

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

You need to set the xmlDataFormat to jacksonXml as the default is jaxb
https://camel.apache.org/manual/rest-dsl.html#_camel_rest_dsl_configurations

On Tue, Apr 5, 2022 at 7:30 AM Claus Ibsen <cl...@gmail.com> wrote:
>
> Hi
>
> We do not support old camel versions. Try with the latest release or
> the LTS releases.
>
> On Mon, Apr 4, 2022 at 9:14 PM Eric Eduardo Piñera Trinchet
> <ee...@gmail.com> wrote:
> >
> > Hello everyone, I hope this channel is the right one to share my doubt, if
> > not, I apologize, and I would appreciate help regarding where to write
> > asking for help.
> >
> > *******************************************************************
> >
> > I changed my version of camel from 3.1.0 to 3.3.0 and my setting for
> > bindingMode.auto doesn't work. Previously I had this configuration:
> >
> > .bindingMode(RestBindingMode.auto) .xmlDataFormat("jacksonxml")
> > .dataFormatProperty("prettyPrint", "true")
> > .dataFormatProperty("contentTypeHeader", "true");
> >
> > But after camel upgraded from 3.2.0 to 3.3.0 when I try to access the
> > endpoint I get this error:
> >
> > org.apache.camel.FailedToCreateRouteException: Failed to create route
> > get-xxxx: Route(get-xxxx)[From[rest://get:xxxxxx@0x7a615950], Lo... because
> > of java.lang.IllegalArgumentException: Cannot find
> > RestBindingJaxbDataFormatFactory on classpath. Add camel-jaxb to classpath.
> >
> > I tried adding camel-jaxb dependency but I get this error:
> >
> > class org.apache.camel.component.jacksonxml.JacksonXMLDataFormat cannot be
> > cast to class org.apache.camel.converter.jaxb.JaxbDataFormat
> > (org.apache.camel.component.jacksonxml.JacksonXMLDataFormat and
> > org.apache.camel.converter.jaxb .JaxbDataFormat are in unnamed module of
> > loader 'app')
> >
> > *Note*: I'm ussing camel with spring-boot
> >
> > *I wonder what am I missing to be able to use jacksonxml as xmlDataFormat.*
> >
> > All help is appreciated. Thanks in advance
> >
> > I would expect to be able to use jacksonxml as xmlDataFormat since all the
> > annotations I have in the pojos are from
> > com.fasterxml.jackson.dataformat.xml.annotation
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Re: Doubts on how to use jacksonxml as xmlDataFormat for bindingMode.auto in camel 3.3.0

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

We do not support old camel versions. Try with the latest release or
the LTS releases.

On Mon, Apr 4, 2022 at 9:14 PM Eric Eduardo Piñera Trinchet
<ee...@gmail.com> wrote:
>
> Hello everyone, I hope this channel is the right one to share my doubt, if
> not, I apologize, and I would appreciate help regarding where to write
> asking for help.
>
> *******************************************************************
>
> I changed my version of camel from 3.1.0 to 3.3.0 and my setting for
> bindingMode.auto doesn't work. Previously I had this configuration:
>
> .bindingMode(RestBindingMode.auto) .xmlDataFormat("jacksonxml")
> .dataFormatProperty("prettyPrint", "true")
> .dataFormatProperty("contentTypeHeader", "true");
>
> But after camel upgraded from 3.2.0 to 3.3.0 when I try to access the
> endpoint I get this error:
>
> org.apache.camel.FailedToCreateRouteException: Failed to create route
> get-xxxx: Route(get-xxxx)[From[rest://get:xxxxxx@0x7a615950], Lo... because
> of java.lang.IllegalArgumentException: Cannot find
> RestBindingJaxbDataFormatFactory on classpath. Add camel-jaxb to classpath.
>
> I tried adding camel-jaxb dependency but I get this error:
>
> class org.apache.camel.component.jacksonxml.JacksonXMLDataFormat cannot be
> cast to class org.apache.camel.converter.jaxb.JaxbDataFormat
> (org.apache.camel.component.jacksonxml.JacksonXMLDataFormat and
> org.apache.camel.converter.jaxb .JaxbDataFormat are in unnamed module of
> loader 'app')
>
> *Note*: I'm ussing camel with spring-boot
>
> *I wonder what am I missing to be able to use jacksonxml as xmlDataFormat.*
>
> All help is appreciated. Thanks in advance
>
> I would expect to be able to use jacksonxml as xmlDataFormat since all the
> annotations I have in the pojos are from
> com.fasterxml.jackson.dataformat.xml.annotation



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2