And you have camel-xstream JAR on the classpath, and the xstream JAR as well?

And which Camel version are you using?

On Wed, May 18, 2011 at 8:00 PM, Craig Taylor <[email protected]> wrote:
> I'm attempting to set up a simple json test and have the following in my
> RouteBuilder ( root is a jetty: prefix)
>
>        from( root + "/test", "seda:test" )
>                .marshal().json(JsonLibrary.XStream)
>                .process(new Processor()
>                {
>
>            @Override
>            public void process(Exchange exchange) throws Exception
>            {
>                System.err.println( "Got exchange:" + exchange );
>                System.err.println( "Body type: " +
> exchange.getIn().getBody().getClass().getName());
>                System.err.println( "Body:" +
> exchange.getIn().getBody(String.class));
>            }
>        });
>
>        from( root+"/test2" )
>                .setBody( constant( new TestClass( 1, "abc" ) ) )
>                .unmarshal().json()
>                .to( "seda:test" );
>
>
> where TestClass is a simple pojo with public getters for numeric, string on
> constructor.
>
> I'm getting an exception thrown stating that
> Caused by: java.lang.IllegalArgumentException: dataFormat must be specified
>
> on the lines where the from( test, seda ).marshal( lines are.  I've tried it
> both with and without the JsonLibrary.XStream and am getting the same
> behavior.
>
> Suggestions?
>
> --
> -------------------------------------------
> Craig Taylor
> [email protected]
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: [email protected]
Web: http://fusesource.com
CamelOne 2011: http://fusesource.com/camelone2011/
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Reply via email to