Hi I just wrote a test to check the fallback converter's loading the registering. Every thing looks good.
So I guess there are some thing wrong with the setting up of OsgiAnnotationTypeConverterLoader. @Charles, Can you change your camel context like this ? <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camel="http://camel.apache.org/schema/spring" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://camel.apache.org/schema/osgi http://camel.apache.org/schema/osgi/camel-osgi.xsd"> http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> <bean id="bindyDataformat" class="org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat"> <constructor-arg type="java.lang.String" value="com.xpectis.camel.bindy.model"/> </bean> <bean id="csv" class="com.xpectis.camel.bindy.csv.CsvBean" /> <camelContext xmlns="http://camel.apache.org/schema/osgi"> <camel:package>com.xpectis.camel.bindy.routing</camel:package> <camel:route> <camel:from uri="file://d:/temp/data/?noop=true" /> <camel:unmarshal ref="bindyDataformat"/> <camel:to uri="bean:csv" /> </camel:route> </camelContext> </beans> Willem Claus Ibsen wrote: > Hi > > The @FallbackConverter type converter should kick in, when you use > file based components > > Willem is there something there that needs to be done in camel-osgi > for registering fallback converteres as well? > > > > On Mon, Mar 2, 2009 at 5:16 PM, cmoulliard <[email protected]> wrote: >> Yes Willem, >> >> Here it is : >> >> <?xml version="1.0" encoding="UTF-8"?> >> <beans xmlns="http://www.springframework.org/schema/beans" >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >> xsi:schemaLocation=" >> http://www.springframework.org/schema/beans >> http://www.springframework.org/schema/beans/spring-beans-2.5.xsd >> http://camel.apache.org/schema/spring >> http://camel.apache.org/schema/spring/camel-spring.xsd"> >> >> <bean id="bindyDataformat" >> >> class="org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat"> >> <constructor-arg type="java.lang.String" >> value="com.xpectis.camel.bindy.model"/> >> </bean> >> >> <bean id="csv" class="com.xpectis.camel.bindy.csv.CsvBean" /> >> >> <camelContext xmlns="http://camel.apache.org/schema/spring"> >> >> <package>com.xpectis.camel.bindy.routing</package> >> >> <route> >> <from uri="file://d:/temp/data/?noop=true" /> >> <unmarshal ref="bindyDataformat"/> >> <to uri="bean:csv" /> >> </route> >> >> >> </camelContext> >> >> </beans> >> >> Remark : I work with camel 2.0-SNAPSHOT. >> >> Regards, >> >> Charles >> >> >> willem.jiang wrote: >>> Hi Charles, >>> >>> What kind of camel context did you create? >>> Can you show me the Spring configuration file or the DSL rule? >>> >>> >>> Willem >>> >>> >>> On Mon, Mar 2, 2009 at 11:01 PM, cmoulliard <[email protected]> wrote: >>> >>>> Hi, >>>> >>>> I have a small camel - bindy project running perfectly in Eclipse or when >>>> launched using command camel:run but when I deploy it on Servicemix >>>> Kernel >>>> 4, I receive the following error : >>>> >>>> 15:48:05,936 | ERROR | ompon...@1cb1d37 | DeadLetterChannel >>>> | >>>> rg.apache.camel.processor.Logger 207 | Failed delivery for exchangeId: >>>> ID-dell-charles-2356-1236005216593-0-1. On delivery attempt: 0 caught: >>>> org.apache.camel.NoTypeConversionAvailableException: No type converter >>>> available to convert from type: >>>> org.apache.camel.component.file.GenericFileMessage to the required type: >>>> java.io.InputStream with value GenericFileMessage: >>>> GenericFile[d:\temp\data\csv.txt] >>>> org.apache.camel.NoTypeConversionAvailableException: No type converter >>>> available to convert from type: >>>> org.apache.camel.component.file.GenericFileMessage to the required type: >>>> java.io.InputStream with value GenericFileMessage: >>>> GenericFile[d:\temp\data\csv.txt] >>>> at >>>> >>>> org.apache.camel.impl.converter.DefaultTypeConverter.convertTo(DefaultTypeConverter.java:126) >>>> at >>>> >>>> org.apache.camel.impl.converter.DefaultTypeConverter.convertTo(DefaultTypeConverter.java:74) >>>> at >>>> org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:70) >>>> at >>>> org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:51) >>>> at >>>> >>>> org.apache.camel.util.ExchangeHelper.getMandatoryInBody(ExchangeHelper.java:135) >>>> at >>>> >>>> org.apache.camel.processor.UnmarshalProcessor.process(UnmarshalProcessor.java:44) >>>> at >>>> >>>> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:80) >>>> at >>>> >>>> org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:194) >>>> at >>>> >>>> org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:129) >>>> at org.apache.camel.processor.Pipeline.process(Pipeline.java:115) >>>> at org.apache.camel.processor.Pipeline.process(Pipeline.java:89) >>>> at >>>> >>>> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68) >>>> at >>>> >>>> org.apache.camel.processor.interceptor.StreamCachingInterceptor.proceed(StreamCachingInterceptor.java:87) >>>> at >>>> >>>> org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:82) >>>> at >>>> >>>> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:52) >>>> at >>>> >>>> org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:170) >>>> at >>>> >>>> org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:103) >>>> at >>>> >>>> org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:66) >>>> at >>>> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) >>>> at >>>> java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) >>>> at >>>> java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) >>>> at >>>> >>>> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) >>>> at >>>> >>>> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181) >>>> at >>>> >>>> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205) >>>> at >>>> >>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) >>>> at >>>> >>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) >>>> at java.lang.Thread.run(Thread.java:619) >>>> >>>> Here is the output that I have in maven : >>>> >>>> 2009-03-02 15:58:23,155 DEBUG FileConsumer - Total 1 files to consume >>>> 2009-03-02 15:58:23,186 DEBUG FileEndpoint - Using Generic file process >>>> strategy: >>>> >>>> org.apache.camel.component.file.strategy.genericfilenoopprocessstrat...@1bca1c3 >>>> 2009-03-02 15:58:23,202 DEBUG FileConsumer - About to process file: >>>> GenericFile[d:\temp\data\csv.txt] using exchange: >>>> Exchange[GenericFileMessage: GenericFile[d:\temp\data\csv.txt]] >>>> 2009-03-02 15:58:23,249 DEBUG ResolverUtil - Searching for annotations of >>>> [interface org.apache.camel.dataformat.bindy.annotation.CsvRecord, >>>> interface >>>> org.apache.camel.dataformat.bindy.annotation.Link, interface >>>> org.apache.camel.dataformat.bindy.annotation.Message] in packages: >>>> [com.xpectis.camel.bindy.model] >>>> 2009-03-02 15:58:23,249 DEBUG ResolverUtil - Using only regular >>>> classloaders >>>> 2009-03-02 15:58:23,249 DEBUG ResolverUtil - Loading from directory: >>>> >>>> D:\Dvlpt\Java\workspace-ganymede\osgi\bindy\target\classes\com\xpectis\camel\bindy\model >>>> 2009-03-02 15:58:23,280 DEBUG ResolverUtil - Found: [class >>>> com.xpectis.camel.bindy.model.Client, class >>>> com.xpectis.camel.bindy.model.Order] >>>> 2009-03-02 15:58:23,280 DEBUG BindyCsvFactory - Position defined in the >>>> class : com.xpectis.camel.bindy.model.Client, position : 1, Field : >>>> @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0, >>>> pattern=, name=, length=0, pos=1) >>>> 2009-03-02 15:58:23,280 DEBUG BindyCsvFactory - Position defined in the >>>> class : com.xpectis.camel.bindy.model.Client, position : 2, Field : >>>> @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0, >>>> pattern=, name=, length=0, pos=2) >>>> 2009-03-02 15:58:23,280 DEBUG BindyCsvFactory - Position defined in the >>>> class : com.xpectis.camel.bindy.model.Client, position : 3, Field : >>>> @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0, >>>> pattern=, name=, length=0, pos=3) >>>> 2009-03-02 15:58:23,280 DEBUG BindyCsvFactory - Position defined in the >>>> class : com.xpectis.camel.bindy.model.Order, position : 0, Field : >>>> @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0, >>>> pattern=, name=, length=0, pos=0) >>>> 2009-03-02 15:58:23,280 DEBUG BindyCsvFactory - Class linked : >>>> com.xpectis.camel.bindy.model.Order, Fieldpublic >>>> com.xpectis.camel.bindy.model.Client >>>> com.xpectis.camel.bindy.model.Order.client >>>> 2009-03-02 15:58:23,280 DEBUG BindyCsvFactory - Position defined in the >>>> class : com.xpectis.camel.bindy.model.Order, position : 4, Field : >>>> @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0, >>>> pattern=, name=, length=0, pos=4) >>>> 2009-03-02 15:58:23,280 DEBUG BindyCsvFactory - Position defined in the >>>> class : com.xpectis.camel.bindy.model.Order, position : 5, Field : >>>> @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0, >>>> pattern=, name=Name, length=0, pos=5) >>>> 2009-03-02 15:58:23,280 DEBUG BindyCsvFactory - Position defined in the >>>> class : com.xpectis.camel.bindy.model.Order, position : 6, Field : >>>> @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0, >>>> pattern=, name=, length=0, pos=6) >>>> 2009-03-02 15:58:23,296 DEBUG BindyCsvFactory - Position defined in the >>>> class : com.xpectis.camel.bindy.model.Order, position : 7, Field : >>>> @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0, >>>> pattern=, name=, length=0, pos=7) >>>> 2009-03-02 15:58:23,296 DEBUG BindyCsvFactory - Position defined in the >>>> class : com.xpectis.camel.bindy.model.Order, position : 8, Field : >>>> @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0, >>>> pattern=dd-MM-yyyy, name=, length=0, pos=8) >>>> 2009-03-02 15:58:23,296 DEBUG BindyCsvFactory - Skip First Line parameter >>>> of >>>> the CSV : false >>>> 2009-03-02 15:58:23,296 DEBUG BindyCsvFactory - Separator defined for the >>>> CSV : , >>>> 2009-03-02 15:58:23,296 DEBUG BindyCsvDataFormat - Counter 0 : content : >>>> 01,A,Albert,Cartier,BE12345678,Belgacom Ventage 10/10,1500,EUR,08-01-2009 >>>> 2009-03-02 15:58:23,296 DEBUG BindyCsvFactory - Pos : 0, Data : 01, Field >>>> type : int >>>> 2009-03-02 15:58:23,327 DEBUG BindyCsvFactory - Pos : 1, Data : A, Field >>>> type : class java.lang.String >>>> 2009-03-02 15:58:23,327 DEBUG BindyCsvFactory - Pos : 2, Data : Albert, >>>> Field type : class java.lang.String >>>> 2009-03-02 15:58:23,327 DEBUG BindyCsvFactory - Pos : 3, Data : Cartier, >>>> Field type : class java.lang.String >>>> 2009-03-02 15:58:23,343 DEBUG BindyCsvFactory - Pos : 4, Data : >>>> BE12345678, >>>> Field type : class java.lang.String >>>> 2009-03-02 15:58:23,343 DEBUG BindyCsvFactory - Pos : 5, Data : Belgacom >>>> Ventage 10/10, Field type : class java.lang.String >>>> 2009-03-02 15:58:23,343 DEBUG BindyCsvFactory - Pos : 6, Data : 1500, >>>> Field >>>> type : class java.lang.String >>>> 2009-03-02 15:58:23,343 DEBUG BindyCsvFactory - Pos : 7, Data : EUR, >>>> Field >>>> type : class java.lang.String >>>> 2009-03-02 15:58:23,343 DEBUG BindyCsvFactory - Pos : 8, Data : >>>> 08-01-2009, >>>> Field type : class java.util.Date >>>> 2009- >>>> >>>> ... >>>> >>>> and osgi config >>>> >>>> [ 73] [Active ] [ ] [ 60] camel-core (2.0.0.SNAPSHOT) >>>> [ 74] [Active ] [ ] [ 60] Spring Transaction (2.5.6) >>>> [ 75] [Active ] [ ] [ 60] camel-spring (2.0.0.SNAPSHOT) >>>> [ 76] [Active ] [ ] [ 60] camel-osgi (2.0.0.SNAPSHOT) >>>> [ 77] [Active ] [ ] [ 60] camel-bindy (2.0.0.SNAPSHOT) >>>> [ 78] [Active ] [Started] [ 60] camel csv bindy (1.0.0.SNAPSHOT) >>>> >>>> Where is the issue ? >>>> >>>> Regards, >>>> >>>> >>>> >>>> ----- >>>> Charles Moulliard >>>> SOA Architect >>>> >>>> My Blog : http://cmoulliard.blogspot.com/ >>>> http://cmoulliard.blogspot.com/ >>>> -- >>>> View this message in context: >>>> http://www.nabble.com/org.apache.camel.NoTypeConversionAvailableException%3A-No-type-converter-available-to-convert-from-type%3A-org.apache.camel.component.file.GenericFileMessage-to-the-required-type---SMX4-%21-tp22289722p22289722.html >>>> Sent from the Camel - Users mailing list archive at Nabble.com. >>>> >>>> >>> >> >> ----- >> Charles Moulliard >> SOA Architect >> >> My Blog : http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/ >> -- >> View this message in context: >> http://www.nabble.com/org.apache.camel.NoTypeConversionAvailableException%3A-No-type-converter-available-to-convert-from-type%3A-org.apache.camel.component.file.GenericFileMessage-to-the-required-type---SMX4-%21-tp22289722p22291120.html >> Sent from the Camel - Users mailing list archive at Nabble.com. >> >> > > >
