camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Incompatible types in Object mailBody = template.sendBody()
Date Mon, 17 Jun 2013 07:12:59 GMT
Hi

You should use requestBody instead of sendBody.

I assume you may have downloaded that old code which was attached as a
.zip file to the documentation of the tutorial?
If so that code is old as its about 5 years old when that tutorial was
written, and based on Camel 1.x API.

So basically in Camel 2.x you should use requestXXX if you want a
reply back. And sendXXX if its a one-way operation.

On Mon, Jun 10, 2013 at 9:33 PM, fvillavi <fvillavi@yahoo.com> wrote:
> I am trying to run Apache Camel Tutorial Example Report incident Part 2.
> Here are the instructions:
>
> mvn test
>
> And the result:
>
> [INFO] BUILD FAILURE
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 4.690s
> [INFO] Finished at: Mon Jun 10 12:12:58 ECT 2013
> [INFO] Final Memory: 14M/83M
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-compiler-plugin:2.0:compile (default-compile)
> on project camel-example-reportincident: Compilation failure: Compilation
> failure:
> [ERROR]
> /var/lib/jetty/webapps/camel-example-reportincident/src/main/java/ReportIncidentEndpointImpl.java:[33,43]
> error: incompatible types
>
> The segment of java code:
>
>  public OutputReportIncident reportIncident(InputReportIncident parameters)
> {
>         // transform the request into a mail body
>       .......
>
>         Object mailBody = template.sendBody("velocity:MailBody.vm",
> parameters);
>
> Browsing the documentation, sendBody (....) is defined as void so it can't
> return an object.
>
> Software I am using:
> Fedora 17
> jdk 1.7
> Apache Camel 2.11.0
> Apache cxf 2.7.5
> Apache maven 3.0.5
> Spring 94.11
>
> I don't know how to solve this problem, can some body help me?
> Thanks.
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Incompatible-types-in-Object-mailBody-template-sendBody-tp5734074.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
www.camelone.org: The open source integration conference.

Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Mime
View raw message