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: Problem with Camel Spring configuration
Date Tue, 14 Apr 2009 04:47:59 GMT
Hi

William Jiang created a spring DSL version of the tuturial. However we
still need to add a page about it to the tutorial.

The Spring XML file is here
https://svn.apache.org/repos/asf/camel/trunk/examples/camel-example-reportincident/src/main/resources/META-INF/spring/camel-context.xml

Take a look and use it as inspiration. Mind the XML is based on Camel 2.0.



On Sun, Apr 12, 2009 at 11:52 AM, Sagara Gunathunga <sagaragu@gmail.com> wrote:
> Hi all,
> i tried for Camel ReportIncident tutorials with spring based
> configuration, i have following DSL code to convert to Spring XML
> configuration.
>
> from("direct:start")
>            .setHeader(FileComponent.HEADER_FILE_NAME,
> BeanLanguage.bean(FilenameGenerator.class, "generateFilename"))
>            .to("velocity:MailBody.vm")
>            .to("file://info");
>
> i converted  above code as follows
>
>
> <route>
>                        <from uri="direct:start"/>
>                        <pipeline>
>                                <to uri="velocity:MailBody.vm"/>
>                                <to uri="file://info"/>
>                        </pipeline>
> </route>
>
>
> but this will gives following error ,
>
> 2009-04-12 15:10:01,593 [btpool0-1      ] ERROR DeadLetterChannel
>        - Failed delivery for exchangeId:
> ID-sagara/2380-1239529183484/0-0. On delivery attempt: 0 caught:
> org.apache.camel.NoTypeConversionAvailableException: No type converter
> available to convert from type: class
> org.apache.camel.component.file.FileMessage to the required type:
> java.io.InputStream with value FileMessage: info
> org.apache.camel.NoTypeConversionAvailableException: No type converter
> available to convert from type: class
> org.apache.camel.component.file.FileMessage to the required type:
> java.io.InputStream with value FileMessage: info
>        at org.apache.camel.impl.converter.DefaultTypeConverter.convertTo(DefaultTypeConverter.java:117)
>        at org.apache.camel.impl.converter.DefaultTypeConverter.convertTo(DefaultTypeConverter.java:65)
>
> I think i have missed something on spring configuration , can any one
> provide any clue for this ?
>
> Thanks ,
>
> Sagara
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus
Apache Camel Reference Card:
http://refcardz.dzone.com/refcardz/enterprise-integration

Mime
View raw message