camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: Camel Scala JAXB DSL
Date Tue, 12 Feb 2013 07:15:24 GMT
On Mon, Feb 11, 2013 at 7:20 PM, Joe San <> wrote:
> Does the Scala DSL support JAXB marshal and unmarshal? I have the following
> scenario where I have xjc generated Java files. I give these files to my
> JaxbDataFormat and assign it to a val in Scala as below:
> val jaxb = new JaxbDataFormat("com.test.model.generated.Shiporder")
> I now reference this in my route as below:
> from("file:/Users/joe/Desktop/in?noop=true").unmarshal(jaxb)......
> But the Scala compiler seems not to be happy and spits out strange error:
> scala: type mismatch;
>  found   : java.lang.String("com.test.model.generated.Shiporder")
>  required: Boolean
>     val jaxb = new JaxbDataFormat("com.test.model.generated.Shiporder")
> Help appreciated.

Yes Scala DSL supports marshal / unmarshal. However it does not have
the data formats defined in the DSL out of the box, as in Java or XML
We have a ticket about this.

You need to create them as you do. Just mind there is 2 classes named
JaxbDataFormat, and you need to use the correct one in the DSL.

> Regards,
> Joe
>                                   ^

Claus Ibsen
Red Hat, Inc.
FuseSource is now part of Red Hat
Twitter: davsclaus
Author of Camel in Action:

View raw message