Hi

Try with

ctx.getProperties().put(Exchange.LOG_DEBUG_BODY_STREAMS, "true");

On Thu, Jul 18, 2013 at 7:07 AM, vinay <vinay_samu...@yahoo.com> wrote:
> Hi All,
>
> I am new to camel, here is what I am trying and is giving me exception.....
>
> $groovy -v
> Groovy Version: 2.1.3 JVM: 1.7.0_11 Vendor: Oracle Corporation OS: Linux
> $groovy  CallCallista1.groovy
>
> give following exception...............
> [main] INFO camelLogger - Exchange[ExchangePattern:InOut, BodyType:String,
> Body
> test message]
> Caught: java.lang.ClassCastException: java.lang.Boolean cannot be cast to
> java.
> ang.String
> java.lang.ClassCastException: java.lang.Boolean cannot be cast to
> java.lang.Str
> ng
>         at
> org.apache.camel.impl.DefaultCamelContext.getProperty(DefaultCamelCo
> text.java:2594)
>         at
> org.apache.camel.util.MessageHelper.extractBodyForLogging(MessageHel
> er.java:161)
>         at
> org.apache.camel.util.MessageHelper.extractBodyForLogging(MessageHel
> er.java:144)
>         at
> org.apache.camel.impl.DefaultMessage.toString(DefaultMessage.java:46
>
>         at
> org.apache.camel.impl.DefaultExchange.toString(DefaultExchange.java:
> 0)
>         at CallCallista1.run(CallCallista1.groovy:25)
>
>
> and, here is program.......
> =============================================
> @Grab('org.apache.camel:camel-core:')
> @Grab('org.slf4j:slf4j-simple:')
> import org.apache.camel.*
> import org.apache.camel.impl.*
> import org.apache.camel.builder.*
>
> class MyRouteBuilder extends org.apache.camel.builder.RouteBuilder {
>   void configure() {
>     from("direct://foo")
>      .to("log://camelLogger?level=INFO")
>      .to("mock://result?retainLast=10")
>   }
> }
>
> def mrb = new MyRouteBuilder()
> def ctx = new org.apache.camel.impl.DefaultCamelContext()
> ctx.getProperties().put(Exchange.LOG_DEBUG_BODY_STREAMS, true);
> ctx.addRoutes mrb
> ctx.start()
> p = ctx.createProducerTemplate()
> p.sendBody("direct:foo", ExchangePattern.InOut, "test message")
>
> e = ctx.getEndpoint("mock://result?retainLast=10");
> def ex = e.exchanges
> println "INFO> ${ex.first()}"
> println "INFO> ${ex.first().getException()}"
>
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/camel-error-with-simple-program-with-camel-core-2-11-1-jar-tp5735829.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Reply via email to