You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by cmoulliard <cm...@gmail.com> on 2009/03/02 16:01:14 UTC

org.apache.camel.NoTypeConversionAvailableException: No type converter available to convert from type: org.apache.camel.component.file.GenericFileMessage to the required type - SMX4 !

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 | omponent@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.GenericFileNoOpProcessStrategy@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.


Re: org.apache.camel.NoTypeConversionAvailableException: No type converter available to convert from type: org.apache.camel.component.file.GenericFileMessage to the required type - SMX4 !

Posted by cmoulliard <cm...@gmail.com>.
Thanks for your help. It works now


willem.jiang wrote:
> 
> Hi Charles,
> 
> Since Spring support to load the schema from class patch, the camel
> context that I proposed should work :)
> If you want to run outside of a OSGI server , you need to add the
> dependency of camel-osgi module.
> 
> Please check out this pom.xml[1] as an example.
> [1]
> http://svn.apache.org/repos/asf/camel/trunk/examples/camel-example-osgi/pom.xml
> 
> Willem
> 
> cmoulliard wrote:
>> Hi,
>> 
>> Two remarks concerning what you propose :
>> 
>> 1) If i try to use the camel context as you propose (using osgi schema),
>> camel cannot run localy (outside of a OSGI server)
>> 
>> [INFO] Classpath =
>> [file:/D:/Dvlpt/Java/workspace-ganymede/osgi/reportincident.interfaces/target/classes/,
>> file:/c:/.m2/repository/org/apache/camel/camel-core/2.0-SNAPSHOT/camel-core-2.0-SNAPSHOT.jar,
>> file:/c:/.m2/repository/commons-logging/commons-logging-api/1.1/commons-logging-api-1.1.jar,
>> file:/c:/.m2/repository/org/apache/camel/camel-spring/2.0-SNAPSHOT/camel-spring-2.0-SNAPSHOT.jar,
>> file:/c:/.m2/repository/org/springframework/spring-core/2.5.6/spring-core-2.5.6.jar,
>> file:/c:/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar,
>> file:/c:/.m2/repository/org/springframework/spring-context/2.5.6/spring-context-2.5.6.jar,
>> file:/c:/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar,
>> file:/c:/.m2/repository/org/springframework/spring-beans/2.5.6/spring-beans-2.5.6.jar,
>> file:/c:/.m2/repository/org/springframework/spring-tx/2.5.6/spring-tx-2.5.6.jar,
>> file:/c:/.m2/repository/org/springframework/spring-aop/2.5.6/spring-aop-2.5.6.jar,
>> file:/c:/.m2/repository/org/apache/camel/camel-bindy/2.0-SNAPSHOT/camel-bindy-2.0-SNAPSHOT.jar,
>> file:/c:/.m2/repository/log4j/log4j/1.2.14/log4j-1.2.14.jar]
>> 2009-03-03 12:00:09,937 INFO  MainSupport - Apache Camel 2.0-SNAPSHOT
>> starting 
>> 2009-03-03 12:00:09,984 INFO  ClassPathXmlApplicationContext - Refreshing
>> org.springframework.context.support.ClassPathXmlApplicationContext@57ea52:
>> display name
>> [org.springframework.context.support.ClassPathXmlApplicationContext@57ea52];
>> startup date [Tue Mar 03 12:00:09 CET 2009]; root of context hierarchy 
>> 2009-03-03 12:00:10,109 DEBUG PathMatchingResourcePatternResolver -
>> Looking
>> for matching resources in directory tree
>> [D:\Dvlpt\Java\workspace-ganymede\osgi\reportincident.interfaces\target\classes\META-INF\spring] 
>> 2009-03-03 12:00:10,109 DEBUG PathMatchingResourcePatternResolver -
>> Searching directory
>> [D:\Dvlpt\Java\workspace-ganymede\osgi\reportincident.interfaces\target\classes\META-INF\spring]
>> for files matching pattern
>> [D:/Dvlpt/Java/workspace-ganymede/osgi/reportincident.interfaces/target/classes/META-INF/spring/*.xml] 
>> 2009-03-03 12:00:10,125 DEBUG PathMatchingResourcePatternResolver -
>> Resolved
>> location pattern [META-INF/spring/*.xml] to resources [file
>> [D:\Dvlpt\Java\workspace-ganymede\osgi\reportincident.interfaces\target\classes\META-INF\spring\camel-context.xml]] 
>> 2009-03-03 12:00:10,125 INFO  XmlBeanDefinitionReader - Loading XML bean
>> definitions from file
>> [D:\Dvlpt\Java\workspace-ganymede\osgi\reportincident.interfaces\target\classes\META-INF\spring\camel-context.xml] 
>> 2009-03-03 12:00:10,140 DEBUG DefaultDocumentLoader - Using JAXP provider
>> [com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl] 
>> 2009-03-03 12:00:10,203 DEBUG PluggableSchemaResolver - Loading schema
>> mappings from [META-INF/spring.schemas] 
>> 2009-03-03 12:00:10,218 DEBUG PluggableSchemaResolver - Loaded schema
>> mappings:
>> {http://activemq.apache.org/camel/schema/spring/camel-spring-1.5.0.xsd=camel-spring.xsd,
>> http://www.springframework.org/schema/lang/spring-lang-2.5.xsd=org/springframework/scripting/config/spring-lang-2.5.xsd,
>> http://www.springframework.org/schema/lang/spring-lang.xsd=org/springframework/scripting/config/spring-lang-2.5.xsd,
>> http://www.springframework.org/schema/context/spring-context-2.5.xsd=org/springframework/context/config/spring-context-2.5.xsd,
>> http://www.springframework.org/schema/aop/spring-aop.xsd=org/springframework/aop/config/spring-aop-2.5.xsd,
>> http://www.springframework.org/schema/context/spring-context.xsd=org/springframework/context/config/spring-context-2.5.xsd,
>> http://camel.apache.org/schema/spring/camel-spring-2.0-SNAPSHOT.xsd=camel-spring.xsd,
>> http://www.springframework.org/schema/util/spring-util-2.0.xsd=org/springframework/beans/factory/xml/spring-util-2.0.xsd,
>> http://activemq.apache.org/camel/schema/spring/camel-spring-1.2.0.xsd=camel-spring.xsd,
>> http://activemq.apache.org/camel/schema/spring/camel-spring-1.1.0.xsd=camel-spring.xsd,
>> http://www.springframework.org/schema/util/spring-util-2.5.xsd=org/springframework/beans/factory/xml/spring-util-2.5.xsd,
>> http://activemq.apache.org/camel/schema/spring/camel-spring-1.0.0.xsd=camel-spring.xsd,
>> http://www.springframework.org/schema/tx/spring-tx-2.0.xsd=org/springframework/transaction/config/spring-tx-2.0.xsd,
>> http://www.springframework.org/schema/tool/spring-tool-2.0.xsd=org/springframework/beans/factory/xml/spring-tool-2.0.xsd,
>> http://www.springframework.org/schema/tx/spring-tx-2.5.xsd=org/springframework/transaction/config/spring-tx-2.5.xsd,
>> http://www.springframework.org/schema/tool/spring-tool-2.5.xsd=org/springframework/beans/factory/xml/spring-tool-2.5.xsd,
>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd=org/springframework/beans/factory/xml/spring-beans-2.0.xsd,
>> http://www.springframework.org/schema/beans/spring-beans.xsd=org/springframework/beans/factory/xml/spring-beans-2.5.xsd,
>> http://www.springframework.org/schema/beans/spring-beans-2.5.xsd=org/springframework/beans/factory/xml/spring-beans-2.5.xsd,
>> http://www.springframework.org/schema/jee/spring-jee.xsd=org/springframework/ejb/config/spring-jee-2.5.xsd,
>> http://www.springframework.org/schema/tool/spring-tool.xsd=org/springframework/beans/factory/xml/spring-tool-2.5.xsd,
>> http://camel.apache.org/schema/spring/camel-spring.xsd=camel-spring.xsd,
>> http://activemq.apache.org/camel/schema/spring/camel-spring-1.4.0.xsd=camel-spring.xsd,
>> http://activemq.apache.org/camel/schema/spring/camel-spring-1.3.0.xsd=camel-spring.xsd,
>> http://www.springframework.org/schema/tx/spring-tx.xsd=org/springframework/transaction/config/spring-tx-2.5.xsd,
>> http://www.springframework.org/schema/aop/spring-aop-2.0.xsd=org/springframework/aop/config/spring-aop-2.0.xsd,
>> http://www.springframework.org/schema/jee/spring-jee-2.0.xsd=org/springframework/ejb/config/spring-jee-2.0.xsd,
>> http://www.springframework.org/schema/aop/spring-aop-2.5.xsd=org/springframework/aop/config/spring-aop-2.5.xsd,
>> http://www.springframework.org/schema/jee/spring-jee-2.5.xsd=org/springframework/ejb/config/spring-jee-2.5.xsd,
>> http://www.springframework.org/schema/lang/spring-lang-2.0.xsd=org/springframework/scripting/config/spring-lang-2.0.xsd,
>> http://www.springframework.org/schema/util/spring-util.xsd=org/springframework/beans/factory/xml/spring-util-2.5.xsd} 
>> 2009-03-03 12:00:10,218 DEBUG PluggableSchemaResolver - Found XML schema
>> [http://www.springframework.org/schema/beans/spring-beans-2.5.xsd] in
>> classpath: org/springframework/beans/factory/xml/spring-beans-2.5.xsd 
>> 2009-03-03 12:00:10,453 DEBUG PluggableSchemaResolver - Found XML schema
>> [http://camel.apache.org/schema/spring/camel-spring.xsd] in classpath:
>> camel-spring.xsd 
>> 2009-03-03 12:00:10,578 DEBUG DefaultBeanDefinitionDocumentReader -
>> Loading
>> bean definitions 
>> 2009-03-03 12:00:10,640 DEBUG DefaultNamespaceHandlerResolver - Loaded
>> mappings
>> [{http://www.springframework.org/schema/p=org.springframework.beans.factory.xml.SimplePropertyNamespaceHandler,
>> http://www.springframework.org/schema/lang=org.springframework.scripting.config.LangNamespaceHandler,
>> http://www.springframework.org/schema/jee=org.springframework.ejb.config.JeeNamespaceHandler,
>> http://www.springframework.org/schema/aop=org.springframework.aop.config.AopNamespaceHandler,
>> http://www.springframework.org/schema/util=org.springframework.beans.factory.xml.UtilNamespaceHandler,
>> http://camel.apache.org/schema/spring=org.apache.camel.spring.handler.CamelNamespaceHandler,
>> http://www.springframework.org/schema/tx=org.springframework.transaction.config.TxNamespaceHandler,
>> http://www.springframework.org/schema/context=org.springframework.context.config.ContextNamespaceHandler}] 
>> 2009-03-03 12:00:10,640 ERROR MainSupport - Failed:
>> org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
>> Configuration problem: Unable to locate Spring NamespaceHandler for XML
>> schema namespace [http://camel.apache.org/schema/osgi]
>> Offending resource: file
>> [D:\Dvlpt\Java\workspace-ganymede\osgi\reportincident.interfaces\target\classes\META-INF\spring\camel-context.xml]
>>  
>> org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
>> Configuration problem: Unable to locate Spring NamespaceHandler for XML
>> schema namespace [http://camel.apache.org/schema/osgi]
>> Offending resource: file
>> [D:\Dvlpt\Java\workspace-ganymede\osgi\reportincident.interfaces\target\classes\META-INF\spring\camel-context.xml]
>> 
>> 	at
>> org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
>> 	at
>> org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
>> 	at
>> org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:80)
>> 	at
>> org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:281)
>> 	at
>> org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1294)
>> 	at
>> org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1287)
>> 	at
>> org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135)
>> 	at
>> org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92)
>> 	at
>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:507)
>> 	at
>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398)
>> 	at
>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)
>> 	at
>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
>> 	at
>> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
>> 	at
>> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
>> 	at
>> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
>> 	at
>> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:212)
>> 	at
>> org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:113)
>> 	at
>> org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:80)
>> 	at
>> org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)
>> 	at
>> org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422)
>> 	at
>> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
>> 	at
>> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
>> 	at
>> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
>> 	at
>> org.apache.camel.spring.Main.createDefaultApplicationContext(Main.java:232)
>> 	at org.apache.camel.spring.Main.doStart(Main.java:186)
>> 	at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:50)
>> 	at org.apache.camel.util.MainSupport.run(MainSupport.java:121)
>> 	at org.apache.camel.util.MainSupport.run(MainSupport.java:299)
>> 	at org.apache.camel.spring.Main.main(Main.java:98)
>> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> 	at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> 	at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>> 	at java.lang.reflect.Method.invoke(Method.java:597)
>> 	at org.apache.camel.maven.RunMojo$1.run(RunMojo.java:396)
>> 	at java.lang.Thread.run(Thread.java:619)
>> [INFO] ------------------------------------------------------
>> 
>> 2) The schema  location must be :
>> 
>> http://camel.apache.org/schema/osgi
>> http://camel.apache.org/schema/osgi/camel-osgi-2.0-SNAPSHOT.xsd
>> 
>> and not :
>> 
>> http://camel.apache.org/schema/osgi
>> http://camel.apache.org/schema/osgi/camel-osgi.xsd
>> 
>> Regards,
>> 
>> Charles
>> 
>> willem.jiang wrote:
>>> 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 <cm...@gmail.com>
>>>> 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 <cm...@gmail.com>
>>>>>> 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 | omponent@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.GenericFileNoOpProcessStrategy@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.
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>> 
>> 
>> -----
>> Charles Moulliard
>> SOA Architect
>> 
>> My Blog :  http://cmoulliard.blogspot.com/
>> http://cmoulliard.blogspot.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-tp22289722p22307437.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: org.apache.camel.NoTypeConversionAvailableException: No type converter available to convert from type: org.apache.camel.component.file.GenericFileMessage to the required type - SMX4 !

Posted by Willem Jiang <wi...@gmail.com>.
Hi Charles,

Since Spring support to load the schema from class patch, the camel
context that I proposed should work :)
If you want to run outside of a OSGI server , you need to add the
dependency of camel-osgi module.

Please check out this pom.xml[1] as an example.
[1]
http://svn.apache.org/repos/asf/camel/trunk/examples/camel-example-osgi/pom.xml

Willem

cmoulliard wrote:
> Hi,
> 
> Two remarks concerning what you propose :
> 
> 1) If i try to use the camel context as you propose (using osgi schema),
> camel cannot run localy (outside of a OSGI server)
> 
> [INFO] Classpath =
> [file:/D:/Dvlpt/Java/workspace-ganymede/osgi/reportincident.interfaces/target/classes/,
> file:/c:/.m2/repository/org/apache/camel/camel-core/2.0-SNAPSHOT/camel-core-2.0-SNAPSHOT.jar,
> file:/c:/.m2/repository/commons-logging/commons-logging-api/1.1/commons-logging-api-1.1.jar,
> file:/c:/.m2/repository/org/apache/camel/camel-spring/2.0-SNAPSHOT/camel-spring-2.0-SNAPSHOT.jar,
> file:/c:/.m2/repository/org/springframework/spring-core/2.5.6/spring-core-2.5.6.jar,
> file:/c:/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar,
> file:/c:/.m2/repository/org/springframework/spring-context/2.5.6/spring-context-2.5.6.jar,
> file:/c:/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar,
> file:/c:/.m2/repository/org/springframework/spring-beans/2.5.6/spring-beans-2.5.6.jar,
> file:/c:/.m2/repository/org/springframework/spring-tx/2.5.6/spring-tx-2.5.6.jar,
> file:/c:/.m2/repository/org/springframework/spring-aop/2.5.6/spring-aop-2.5.6.jar,
> file:/c:/.m2/repository/org/apache/camel/camel-bindy/2.0-SNAPSHOT/camel-bindy-2.0-SNAPSHOT.jar,
> file:/c:/.m2/repository/log4j/log4j/1.2.14/log4j-1.2.14.jar]
> 2009-03-03 12:00:09,937 INFO  MainSupport - Apache Camel 2.0-SNAPSHOT
> starting 
> 2009-03-03 12:00:09,984 INFO  ClassPathXmlApplicationContext - Refreshing
> org.springframework.context.support.ClassPathXmlApplicationContext@57ea52:
> display name
> [org.springframework.context.support.ClassPathXmlApplicationContext@57ea52];
> startup date [Tue Mar 03 12:00:09 CET 2009]; root of context hierarchy 
> 2009-03-03 12:00:10,109 DEBUG PathMatchingResourcePatternResolver - Looking
> for matching resources in directory tree
> [D:\Dvlpt\Java\workspace-ganymede\osgi\reportincident.interfaces\target\classes\META-INF\spring] 
> 2009-03-03 12:00:10,109 DEBUG PathMatchingResourcePatternResolver -
> Searching directory
> [D:\Dvlpt\Java\workspace-ganymede\osgi\reportincident.interfaces\target\classes\META-INF\spring]
> for files matching pattern
> [D:/Dvlpt/Java/workspace-ganymede/osgi/reportincident.interfaces/target/classes/META-INF/spring/*.xml] 
> 2009-03-03 12:00:10,125 DEBUG PathMatchingResourcePatternResolver - Resolved
> location pattern [META-INF/spring/*.xml] to resources [file
> [D:\Dvlpt\Java\workspace-ganymede\osgi\reportincident.interfaces\target\classes\META-INF\spring\camel-context.xml]] 
> 2009-03-03 12:00:10,125 INFO  XmlBeanDefinitionReader - Loading XML bean
> definitions from file
> [D:\Dvlpt\Java\workspace-ganymede\osgi\reportincident.interfaces\target\classes\META-INF\spring\camel-context.xml] 
> 2009-03-03 12:00:10,140 DEBUG DefaultDocumentLoader - Using JAXP provider
> [com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl] 
> 2009-03-03 12:00:10,203 DEBUG PluggableSchemaResolver - Loading schema
> mappings from [META-INF/spring.schemas] 
> 2009-03-03 12:00:10,218 DEBUG PluggableSchemaResolver - Loaded schema
> mappings:
> {http://activemq.apache.org/camel/schema/spring/camel-spring-1.5.0.xsd=camel-spring.xsd,
> http://www.springframework.org/schema/lang/spring-lang-2.5.xsd=org/springframework/scripting/config/spring-lang-2.5.xsd,
> http://www.springframework.org/schema/lang/spring-lang.xsd=org/springframework/scripting/config/spring-lang-2.5.xsd,
> http://www.springframework.org/schema/context/spring-context-2.5.xsd=org/springframework/context/config/spring-context-2.5.xsd,
> http://www.springframework.org/schema/aop/spring-aop.xsd=org/springframework/aop/config/spring-aop-2.5.xsd,
> http://www.springframework.org/schema/context/spring-context.xsd=org/springframework/context/config/spring-context-2.5.xsd,
> http://camel.apache.org/schema/spring/camel-spring-2.0-SNAPSHOT.xsd=camel-spring.xsd,
> http://www.springframework.org/schema/util/spring-util-2.0.xsd=org/springframework/beans/factory/xml/spring-util-2.0.xsd,
> http://activemq.apache.org/camel/schema/spring/camel-spring-1.2.0.xsd=camel-spring.xsd,
> http://activemq.apache.org/camel/schema/spring/camel-spring-1.1.0.xsd=camel-spring.xsd,
> http://www.springframework.org/schema/util/spring-util-2.5.xsd=org/springframework/beans/factory/xml/spring-util-2.5.xsd,
> http://activemq.apache.org/camel/schema/spring/camel-spring-1.0.0.xsd=camel-spring.xsd,
> http://www.springframework.org/schema/tx/spring-tx-2.0.xsd=org/springframework/transaction/config/spring-tx-2.0.xsd,
> http://www.springframework.org/schema/tool/spring-tool-2.0.xsd=org/springframework/beans/factory/xml/spring-tool-2.0.xsd,
> http://www.springframework.org/schema/tx/spring-tx-2.5.xsd=org/springframework/transaction/config/spring-tx-2.5.xsd,
> http://www.springframework.org/schema/tool/spring-tool-2.5.xsd=org/springframework/beans/factory/xml/spring-tool-2.5.xsd,
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd=org/springframework/beans/factory/xml/spring-beans-2.0.xsd,
> http://www.springframework.org/schema/beans/spring-beans.xsd=org/springframework/beans/factory/xml/spring-beans-2.5.xsd,
> http://www.springframework.org/schema/beans/spring-beans-2.5.xsd=org/springframework/beans/factory/xml/spring-beans-2.5.xsd,
> http://www.springframework.org/schema/jee/spring-jee.xsd=org/springframework/ejb/config/spring-jee-2.5.xsd,
> http://www.springframework.org/schema/tool/spring-tool.xsd=org/springframework/beans/factory/xml/spring-tool-2.5.xsd,
> http://camel.apache.org/schema/spring/camel-spring.xsd=camel-spring.xsd,
> http://activemq.apache.org/camel/schema/spring/camel-spring-1.4.0.xsd=camel-spring.xsd,
> http://activemq.apache.org/camel/schema/spring/camel-spring-1.3.0.xsd=camel-spring.xsd,
> http://www.springframework.org/schema/tx/spring-tx.xsd=org/springframework/transaction/config/spring-tx-2.5.xsd,
> http://www.springframework.org/schema/aop/spring-aop-2.0.xsd=org/springframework/aop/config/spring-aop-2.0.xsd,
> http://www.springframework.org/schema/jee/spring-jee-2.0.xsd=org/springframework/ejb/config/spring-jee-2.0.xsd,
> http://www.springframework.org/schema/aop/spring-aop-2.5.xsd=org/springframework/aop/config/spring-aop-2.5.xsd,
> http://www.springframework.org/schema/jee/spring-jee-2.5.xsd=org/springframework/ejb/config/spring-jee-2.5.xsd,
> http://www.springframework.org/schema/lang/spring-lang-2.0.xsd=org/springframework/scripting/config/spring-lang-2.0.xsd,
> http://www.springframework.org/schema/util/spring-util.xsd=org/springframework/beans/factory/xml/spring-util-2.5.xsd} 
> 2009-03-03 12:00:10,218 DEBUG PluggableSchemaResolver - Found XML schema
> [http://www.springframework.org/schema/beans/spring-beans-2.5.xsd] in
> classpath: org/springframework/beans/factory/xml/spring-beans-2.5.xsd 
> 2009-03-03 12:00:10,453 DEBUG PluggableSchemaResolver - Found XML schema
> [http://camel.apache.org/schema/spring/camel-spring.xsd] in classpath:
> camel-spring.xsd 
> 2009-03-03 12:00:10,578 DEBUG DefaultBeanDefinitionDocumentReader - Loading
> bean definitions 
> 2009-03-03 12:00:10,640 DEBUG DefaultNamespaceHandlerResolver - Loaded
> mappings
> [{http://www.springframework.org/schema/p=org.springframework.beans.factory.xml.SimplePropertyNamespaceHandler,
> http://www.springframework.org/schema/lang=org.springframework.scripting.config.LangNamespaceHandler,
> http://www.springframework.org/schema/jee=org.springframework.ejb.config.JeeNamespaceHandler,
> http://www.springframework.org/schema/aop=org.springframework.aop.config.AopNamespaceHandler,
> http://www.springframework.org/schema/util=org.springframework.beans.factory.xml.UtilNamespaceHandler,
> http://camel.apache.org/schema/spring=org.apache.camel.spring.handler.CamelNamespaceHandler,
> http://www.springframework.org/schema/tx=org.springframework.transaction.config.TxNamespaceHandler,
> http://www.springframework.org/schema/context=org.springframework.context.config.ContextNamespaceHandler}] 
> 2009-03-03 12:00:10,640 ERROR MainSupport - Failed:
> org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
> Configuration problem: Unable to locate Spring NamespaceHandler for XML
> schema namespace [http://camel.apache.org/schema/osgi]
> Offending resource: file
> [D:\Dvlpt\Java\workspace-ganymede\osgi\reportincident.interfaces\target\classes\META-INF\spring\camel-context.xml]
>  
> org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
> Configuration problem: Unable to locate Spring NamespaceHandler for XML
> schema namespace [http://camel.apache.org/schema/osgi]
> Offending resource: file
> [D:\Dvlpt\Java\workspace-ganymede\osgi\reportincident.interfaces\target\classes\META-INF\spring\camel-context.xml]
> 
> 	at
> org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
> 	at
> org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
> 	at
> org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:80)
> 	at
> org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:281)
> 	at
> org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1294)
> 	at
> org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1287)
> 	at
> org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135)
> 	at
> org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92)
> 	at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:507)
> 	at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398)
> 	at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)
> 	at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
> 	at
> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
> 	at
> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
> 	at
> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
> 	at
> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:212)
> 	at
> org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:113)
> 	at
> org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:80)
> 	at
> org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)
> 	at
> org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422)
> 	at
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
> 	at
> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
> 	at
> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
> 	at
> org.apache.camel.spring.Main.createDefaultApplicationContext(Main.java:232)
> 	at org.apache.camel.spring.Main.doStart(Main.java:186)
> 	at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:50)
> 	at org.apache.camel.util.MainSupport.run(MainSupport.java:121)
> 	at org.apache.camel.util.MainSupport.run(MainSupport.java:299)
> 	at org.apache.camel.spring.Main.main(Main.java:98)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.apache.camel.maven.RunMojo$1.run(RunMojo.java:396)
> 	at java.lang.Thread.run(Thread.java:619)
> [INFO] ------------------------------------------------------
> 
> 2) The schema  location must be :
> 
> http://camel.apache.org/schema/osgi
> http://camel.apache.org/schema/osgi/camel-osgi-2.0-SNAPSHOT.xsd
> 
> and not :
> 
> http://camel.apache.org/schema/osgi
> http://camel.apache.org/schema/osgi/camel-osgi.xsd
> 
> Regards,
> 
> Charles
> 
> willem.jiang wrote:
>> 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 <cm...@gmail.com> 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 <cm...@gmail.com>
>>>>> 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 | omponent@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.GenericFileNoOpProcessStrategy@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.
>>>>
>>>>
>>>
>>>
>>
>>
> 
> 
> -----
> Charles Moulliard
> SOA Architect
> 
> My Blog :  http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/  


Re: org.apache.camel.NoTypeConversionAvailableException: No type converter available to convert from type: org.apache.camel.component.file.GenericFileMessage to the required type - SMX4 !

Posted by cmoulliard <cm...@gmail.com>.
Hi,

Two remarks concerning what you propose :

1) If i try to use the camel context as you propose (using osgi schema),
camel cannot run localy (outside of a OSGI server)

[INFO] Classpath =
[file:/D:/Dvlpt/Java/workspace-ganymede/osgi/reportincident.interfaces/target/classes/,
file:/c:/.m2/repository/org/apache/camel/camel-core/2.0-SNAPSHOT/camel-core-2.0-SNAPSHOT.jar,
file:/c:/.m2/repository/commons-logging/commons-logging-api/1.1/commons-logging-api-1.1.jar,
file:/c:/.m2/repository/org/apache/camel/camel-spring/2.0-SNAPSHOT/camel-spring-2.0-SNAPSHOT.jar,
file:/c:/.m2/repository/org/springframework/spring-core/2.5.6/spring-core-2.5.6.jar,
file:/c:/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar,
file:/c:/.m2/repository/org/springframework/spring-context/2.5.6/spring-context-2.5.6.jar,
file:/c:/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar,
file:/c:/.m2/repository/org/springframework/spring-beans/2.5.6/spring-beans-2.5.6.jar,
file:/c:/.m2/repository/org/springframework/spring-tx/2.5.6/spring-tx-2.5.6.jar,
file:/c:/.m2/repository/org/springframework/spring-aop/2.5.6/spring-aop-2.5.6.jar,
file:/c:/.m2/repository/org/apache/camel/camel-bindy/2.0-SNAPSHOT/camel-bindy-2.0-SNAPSHOT.jar,
file:/c:/.m2/repository/log4j/log4j/1.2.14/log4j-1.2.14.jar]
2009-03-03 12:00:09,937 INFO  MainSupport - Apache Camel 2.0-SNAPSHOT
starting 
2009-03-03 12:00:09,984 INFO  ClassPathXmlApplicationContext - Refreshing
org.springframework.context.support.ClassPathXmlApplicationContext@57ea52:
display name
[org.springframework.context.support.ClassPathXmlApplicationContext@57ea52];
startup date [Tue Mar 03 12:00:09 CET 2009]; root of context hierarchy 
2009-03-03 12:00:10,109 DEBUG PathMatchingResourcePatternResolver - Looking
for matching resources in directory tree
[D:\Dvlpt\Java\workspace-ganymede\osgi\reportincident.interfaces\target\classes\META-INF\spring] 
2009-03-03 12:00:10,109 DEBUG PathMatchingResourcePatternResolver -
Searching directory
[D:\Dvlpt\Java\workspace-ganymede\osgi\reportincident.interfaces\target\classes\META-INF\spring]
for files matching pattern
[D:/Dvlpt/Java/workspace-ganymede/osgi/reportincident.interfaces/target/classes/META-INF/spring/*.xml] 
2009-03-03 12:00:10,125 DEBUG PathMatchingResourcePatternResolver - Resolved
location pattern [META-INF/spring/*.xml] to resources [file
[D:\Dvlpt\Java\workspace-ganymede\osgi\reportincident.interfaces\target\classes\META-INF\spring\camel-context.xml]] 
2009-03-03 12:00:10,125 INFO  XmlBeanDefinitionReader - Loading XML bean
definitions from file
[D:\Dvlpt\Java\workspace-ganymede\osgi\reportincident.interfaces\target\classes\META-INF\spring\camel-context.xml] 
2009-03-03 12:00:10,140 DEBUG DefaultDocumentLoader - Using JAXP provider
[com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl] 
2009-03-03 12:00:10,203 DEBUG PluggableSchemaResolver - Loading schema
mappings from [META-INF/spring.schemas] 
2009-03-03 12:00:10,218 DEBUG PluggableSchemaResolver - Loaded schema
mappings:
{http://activemq.apache.org/camel/schema/spring/camel-spring-1.5.0.xsd=camel-spring.xsd,
http://www.springframework.org/schema/lang/spring-lang-2.5.xsd=org/springframework/scripting/config/spring-lang-2.5.xsd,
http://www.springframework.org/schema/lang/spring-lang.xsd=org/springframework/scripting/config/spring-lang-2.5.xsd,
http://www.springframework.org/schema/context/spring-context-2.5.xsd=org/springframework/context/config/spring-context-2.5.xsd,
http://www.springframework.org/schema/aop/spring-aop.xsd=org/springframework/aop/config/spring-aop-2.5.xsd,
http://www.springframework.org/schema/context/spring-context.xsd=org/springframework/context/config/spring-context-2.5.xsd,
http://camel.apache.org/schema/spring/camel-spring-2.0-SNAPSHOT.xsd=camel-spring.xsd,
http://www.springframework.org/schema/util/spring-util-2.0.xsd=org/springframework/beans/factory/xml/spring-util-2.0.xsd,
http://activemq.apache.org/camel/schema/spring/camel-spring-1.2.0.xsd=camel-spring.xsd,
http://activemq.apache.org/camel/schema/spring/camel-spring-1.1.0.xsd=camel-spring.xsd,
http://www.springframework.org/schema/util/spring-util-2.5.xsd=org/springframework/beans/factory/xml/spring-util-2.5.xsd,
http://activemq.apache.org/camel/schema/spring/camel-spring-1.0.0.xsd=camel-spring.xsd,
http://www.springframework.org/schema/tx/spring-tx-2.0.xsd=org/springframework/transaction/config/spring-tx-2.0.xsd,
http://www.springframework.org/schema/tool/spring-tool-2.0.xsd=org/springframework/beans/factory/xml/spring-tool-2.0.xsd,
http://www.springframework.org/schema/tx/spring-tx-2.5.xsd=org/springframework/transaction/config/spring-tx-2.5.xsd,
http://www.springframework.org/schema/tool/spring-tool-2.5.xsd=org/springframework/beans/factory/xml/spring-tool-2.5.xsd,
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd=org/springframework/beans/factory/xml/spring-beans-2.0.xsd,
http://www.springframework.org/schema/beans/spring-beans.xsd=org/springframework/beans/factory/xml/spring-beans-2.5.xsd,
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd=org/springframework/beans/factory/xml/spring-beans-2.5.xsd,
http://www.springframework.org/schema/jee/spring-jee.xsd=org/springframework/ejb/config/spring-jee-2.5.xsd,
http://www.springframework.org/schema/tool/spring-tool.xsd=org/springframework/beans/factory/xml/spring-tool-2.5.xsd,
http://camel.apache.org/schema/spring/camel-spring.xsd=camel-spring.xsd,
http://activemq.apache.org/camel/schema/spring/camel-spring-1.4.0.xsd=camel-spring.xsd,
http://activemq.apache.org/camel/schema/spring/camel-spring-1.3.0.xsd=camel-spring.xsd,
http://www.springframework.org/schema/tx/spring-tx.xsd=org/springframework/transaction/config/spring-tx-2.5.xsd,
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd=org/springframework/aop/config/spring-aop-2.0.xsd,
http://www.springframework.org/schema/jee/spring-jee-2.0.xsd=org/springframework/ejb/config/spring-jee-2.0.xsd,
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd=org/springframework/aop/config/spring-aop-2.5.xsd,
http://www.springframework.org/schema/jee/spring-jee-2.5.xsd=org/springframework/ejb/config/spring-jee-2.5.xsd,
http://www.springframework.org/schema/lang/spring-lang-2.0.xsd=org/springframework/scripting/config/spring-lang-2.0.xsd,
http://www.springframework.org/schema/util/spring-util.xsd=org/springframework/beans/factory/xml/spring-util-2.5.xsd} 
2009-03-03 12:00:10,218 DEBUG PluggableSchemaResolver - Found XML schema
[http://www.springframework.org/schema/beans/spring-beans-2.5.xsd] in
classpath: org/springframework/beans/factory/xml/spring-beans-2.5.xsd 
2009-03-03 12:00:10,453 DEBUG PluggableSchemaResolver - Found XML schema
[http://camel.apache.org/schema/spring/camel-spring.xsd] in classpath:
camel-spring.xsd 
2009-03-03 12:00:10,578 DEBUG DefaultBeanDefinitionDocumentReader - Loading
bean definitions 
2009-03-03 12:00:10,640 DEBUG DefaultNamespaceHandlerResolver - Loaded
mappings
[{http://www.springframework.org/schema/p=org.springframework.beans.factory.xml.SimplePropertyNamespaceHandler,
http://www.springframework.org/schema/lang=org.springframework.scripting.config.LangNamespaceHandler,
http://www.springframework.org/schema/jee=org.springframework.ejb.config.JeeNamespaceHandler,
http://www.springframework.org/schema/aop=org.springframework.aop.config.AopNamespaceHandler,
http://www.springframework.org/schema/util=org.springframework.beans.factory.xml.UtilNamespaceHandler,
http://camel.apache.org/schema/spring=org.apache.camel.spring.handler.CamelNamespaceHandler,
http://www.springframework.org/schema/tx=org.springframework.transaction.config.TxNamespaceHandler,
http://www.springframework.org/schema/context=org.springframework.context.config.ContextNamespaceHandler}] 
2009-03-03 12:00:10,640 ERROR MainSupport - Failed:
org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
Configuration problem: Unable to locate Spring NamespaceHandler for XML
schema namespace [http://camel.apache.org/schema/osgi]
Offending resource: file
[D:\Dvlpt\Java\workspace-ganymede\osgi\reportincident.interfaces\target\classes\META-INF\spring\camel-context.xml]
 
org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
Configuration problem: Unable to locate Spring NamespaceHandler for XML
schema namespace [http://camel.apache.org/schema/osgi]
Offending resource: file
[D:\Dvlpt\Java\workspace-ganymede\osgi\reportincident.interfaces\target\classes\META-INF\spring\camel-context.xml]

	at
org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
	at
org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
	at
org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:80)
	at
org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:281)
	at
org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1294)
	at
org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1287)
	at
org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135)
	at
org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92)
	at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:507)
	at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398)
	at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)
	at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
	at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
	at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
	at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
	at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:212)
	at
org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:113)
	at
org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:80)
	at
org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)
	at
org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422)
	at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
	at
org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
	at
org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
	at
org.apache.camel.spring.Main.createDefaultApplicationContext(Main.java:232)
	at org.apache.camel.spring.Main.doStart(Main.java:186)
	at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:50)
	at org.apache.camel.util.MainSupport.run(MainSupport.java:121)
	at org.apache.camel.util.MainSupport.run(MainSupport.java:299)
	at org.apache.camel.spring.Main.main(Main.java:98)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.camel.maven.RunMojo$1.run(RunMojo.java:396)
	at java.lang.Thread.run(Thread.java:619)
[INFO] ------------------------------------------------------

2) The schema  location must be :

http://camel.apache.org/schema/osgi
http://camel.apache.org/schema/osgi/camel-osgi-2.0-SNAPSHOT.xsd

and not :

http://camel.apache.org/schema/osgi
http://camel.apache.org/schema/osgi/camel-osgi.xsd

Regards,

Charles

willem.jiang wrote:
> 
> 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 <cm...@gmail.com> 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 <cm...@gmail.com>
>>>> 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 | omponent@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.GenericFileNoOpProcessStrategy@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.
>>>
>>>
>> 
>> 
>> 
> 
> 
> 


-----
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-tp22289722p22306532.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: org.apache.camel.NoTypeConversionAvailableException: No type converter available to convert from type: org.apache.camel.component.file.GenericFileMessage to the required type - SMX4 !

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Charles can you try again with latest code from 2.0-SNAPSHOT
I have fixed camel-bindy to use a class resolver that is OSGi aware if
you run in OSGi



On Tue, Mar 3, 2009 at 1:24 PM, Claus Ibsen <cl...@gmail.com> wrote:
> On Tue, Mar 3, 2009 at 1:13 PM, Willem Jiang <wi...@gmail.com> wrote:
>> Hi Charles,
>>
>> I think you can get the ResolverUtil from the camel context.
>> Maybe we need to do some changes on the bindy component.
> Yeah I will expose some nice APIs for that in Camel 2.0, so you can
> get the ResolverUtil from the CamelContext.
>
>
>
>>
>> Willem
>>
>> cmoulliard wrote:
>>> Do you see a temporary workaround because I'm blocked  ?
>>>
>>>
>>> Claus Ibsen-2 wrote:
>>>> Hi
>>>>
>>>> Yeah this resolver needs to be OSGi aware also.
>>>>
>>>> I think we need to provide these resolvers on the CamelContext so
>>>> component authors like you can use them to resolve classes and
>>>> whatelse, and it would be transparent for you if it was regular or
>>>> OSGi platforms.
>>>>
>>>> See ticket 1411 that is about this. Just need to add getResolverUtil
>>>> as well, and we should probably rename it as its a bad name to put out
>>>> in the open.
>>>> We need an API for it as well in the SPI package.
>>>>
>>>> There is a mail on the dev forum about this as well to disucss it there.
>>>>
>>>> The DEBUG logging could maybe be toned down to TRACE
>>>>
>>>>
>>>> On Tue, Mar 3, 2009 at 12:32 PM, cmoulliard <cm...@gmail.com> wrote:
>>>>> Hi Willem,
>>>>>
>>>>> It works (I mean the file can be processed by Camel) but
>>>>>
>>>>> 1) in DEBUG mode, the log of SMX4 server is polluted by hundreds of line
>>>>> like this :
>>>>>
>>>>> 12:11:01,687 | DEBUG | omponent@1d4f279 | ResolverUtil
>>>>>   |
>>>>> g.apache.camel.util.ResolverUtil  571 | Could not find class
>>>>> 'org/apache/camel/converter/stream/StreamCacheConverter$InputStreamCache.class'
>>>>> in classloader: BundleDelegatingClassLoader for [Report Incident
>>>>> Interfaces
>>>>> Bundle (reportincident.interfaces)]. Reason:
>>>>> java.lang.ClassNotFoundException:
>>>>> org.apache.camel.converter.stream.StreamCacheConverter$InputStreamCache
>>>>> not
>>>>> found from bundle [reportincident.interfaces]
>>>>> java.lang.ClassNotFoundException:
>>>>> org.apache.camel.converter.stream.StreamCacheConverter$InputStreamCache
>>>>> not
>>>>> found from bundle [reportincident.interfaces]
>>>>>        at
>>>>> org.springframework.osgi.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:103)
>>>>>        at
>>>>> org.springframework.osgi.util.BundleDelegatingClassLoader.loadClass(BundleDelegatingClassLoader.java:156)
>>>>>        at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
>>>>>        at
>>>>> org.apache.camel.util.ResolverUtil.addIfMatching(ResolverUtil.java:561)
>>>>>        at
>>>>> org.apache.camel.osgi.OsgiResolverUtil.loadImplementationsInBundle(OsgiResolverUtil.java:135)
>>>>>        at
>>>>> org.apache.camel.osgi.OsgiResolverUtil.findInOsgiClassLoader(OsgiResolverUtil.java:92)
>>>>>        at
>>>>> org.apache.camel.osgi.OsgiResolverUtil.find(OsgiResolverUtil.java:73)
>>>>>        at
>>>>> org.apache.camel.util.ResolverUtil.findAnnotated(ResolverUtil.java:301)
>>>>>        at
>>>>> org.apache.camel.impl.converter.AnnotationTypeConverterLoader.load(AnnotationTypeConverterLoader.java:73)
>>>>>        at
>>>>> org.apache.camel.impl.converter.DefaultTypeConverter.checkLoaded(DefaultTypeConverter.java:296)
>>>>>        at
>>>>> org.apache.camel.impl.converter.DefaultTypeConverter.convertTo(DefaultTypeConverter.java:98)
>>>>>        at
>>>>> org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:66)
>>>>>        at
>>>>> org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:51)
>>>>>        at
>>>>> org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:74)
>>>>>        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)
>>>>> Caused by: java.lang.ClassNotFoundException:
>>>>> org.apache.camel.converter.stream.StreamCacheConverter$InputStreamCache
>>>>>        at
>>>>> org.apache.felix.framework.searchpolicy.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:566)
>>>>>        at
>>>>> org.apache.felix.framework.searchpolicy.ModuleImpl.access$100(ModuleImpl.java:59)
>>>>>        at
>>>>> org.apache.felix.framework.searchpolicy.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1371)
>>>>>        at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
>>>>>        at
>>>>> org.apache.felix.framework.searchpolicy.ModuleImpl.getClassByDelegation(ModuleImpl.java:428)
>>>>>        at
>>>>> org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1341)
>>>>>        at
>>>>> org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:737)
>>>>>        at
>>>>> org.springframework.osgi.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:99)
>>>>>        ... 26 more
>>>>>
>>>>> 2) I have a more serious problem. The classes of my model are not loaded.
>>>>> In
>>>>> DEBUG mode, we should see this on the console
>>>>>
>>>>> 2009-03-03 12:28:34,671 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:
>>>>> [org.apache.camel.example.reportincident.model]
>>>>> 2009-03-03 12:28:34,687 DEBUG ResolverUtil - Using only regular
>>>>> classloaders
>>>>> 2009-03-03 12:28:34,687 DEBUG ResolverUtil - Loading from directory:
>>>>> D:\Dvlpt\Java\workspace-ganymede\osgi\reportincident.interfaces\target\classes\org\apache\camel\example\reportincident\model
>>>>> 2009-03-03 12:28:34,703 DEBUG ResolverUtil - Found: [class
>>>>> org.apache.camel.example.reportincident.model.Order, class
>>>>> org.apache.camel.example.reportincident.model.Client]
>>>>> 2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
>>>>> class : org.apache.camel.example.reportincident.model.Order, position :
>>>>> 0,
>>>>> Field :
>>>>> @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
>>>>> pattern=, name=, length=0, pos=0)
>>>>> 2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Class linked  :
>>>>> org.apache.camel.example.reportincident.model.Order, Fieldpublic
>>>>> org.apache.camel.example.reportincident.model.Client
>>>>> org.apache.camel.example.reportincident.model.Order.client
>>>>> 2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
>>>>> class : org.apache.camel.example.reportincident.model.Order, position :
>>>>> 4,
>>>>> Field :
>>>>> @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
>>>>> pattern=, name=, length=0, pos=4)
>>>>> 2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
>>>>> class : org.apache.camel.example.reportincident.model.Order, position :
>>>>> 5,
>>>>> Field :
>>>>> @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
>>>>> pattern=, name=Name, length=0, pos=5)
>>>>> 2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
>>>>> class : org.apache.camel.example.reportincident.model.Order, position :
>>>>> 6,
>>>>> Field :
>>>>> @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
>>>>> pattern=, name=, length=0, pos=6)
>>>>> 2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
>>>>> class : org.apache.camel.example.reportincident.model.Order, position :
>>>>> 7,
>>>>> Field :
>>>>> @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
>>>>> pattern=, name=, length=0, pos=7)
>>>>> 2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
>>>>> class : org.apache.camel.example.reportincident.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-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
>>>>> class : org.apache.camel.example.reportincident.model.Client, position :
>>>>> 1,
>>>>> Field :
>>>>> @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
>>>>> pattern=, name=, length=0, pos=1)
>>>>> 2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
>>>>> class : org.apache.camel.example.reportincident.model.Client, position :
>>>>> 2,
>>>>> Field :
>>>>> @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
>>>>> pattern=, name=, length=0, pos=2)
>>>>> 2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
>>>>> class : org.apache.camel.example.reportincident.model.Client, position :
>>>>> 3,
>>>>> Field :
>>>>> @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
>>>>> pattern=, name=, length=0, pos=3)
>>>>>
>>>>>
>>>>> but nothing is displayed except :
>>>>>
>>>>> 12:11:01,765 | DEBUG | omponent@1d4f279 | ResolverUtil
>>>>>   |
>>>>> g.apache.camel.util.ResolverUtil  324 | 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:
>>>>> [org.apache.camel.example.reportincident.model]
>>>>>
>>>>> - Is the error due to the AnnotationModelLoader.java class of camel-bindy
>>>>> ?
>>>>> - Do we have to do something to convert camel-bindy into an OSGI bundle ?
>>>>>
>>>>> Regards,
>>>>>
>>>>>
>>>>> willem.jiang wrote:
>>>>>> 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 <cm...@gmail.com>
>>>>>>> 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 <cm...@gmail.com>
>>>>>>>>> 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 | omponent@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.GenericFileNoOpProcessStrategy@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.
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>> -----
>>>>> 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-tp22289722p22306918.html
>>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Claus Ibsen
>>>> Apache Camel Committer
>>>>
>>>> Open Source Integration: http://fusesource.com
>>>> Blog: http://davsclaus.blogspot.com/
>>>>
>>>>
>>>
>>>
>>> -----
>>> Charles Moulliard
>>> SOA Architect
>>>
>>> My Blog :  http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/
>>
>>
>
>
>
> --
> Claus Ibsen
> Apache Camel Committer
>
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/

Re: org.apache.camel.NoTypeConversionAvailableException: No type converter available to convert from type: org.apache.camel.component.file.GenericFileMessage to the required type - SMX4 !

Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Mar 3, 2009 at 1:13 PM, Willem Jiang <wi...@gmail.com> wrote:
> Hi Charles,
>
> I think you can get the ResolverUtil from the camel context.
> Maybe we need to do some changes on the bindy component.
Yeah I will expose some nice APIs for that in Camel 2.0, so you can
get the ResolverUtil from the CamelContext.



>
> Willem
>
> cmoulliard wrote:
>> Do you see a temporary workaround because I'm blocked  ?
>>
>>
>> Claus Ibsen-2 wrote:
>>> Hi
>>>
>>> Yeah this resolver needs to be OSGi aware also.
>>>
>>> I think we need to provide these resolvers on the CamelContext so
>>> component authors like you can use them to resolve classes and
>>> whatelse, and it would be transparent for you if it was regular or
>>> OSGi platforms.
>>>
>>> See ticket 1411 that is about this. Just need to add getResolverUtil
>>> as well, and we should probably rename it as its a bad name to put out
>>> in the open.
>>> We need an API for it as well in the SPI package.
>>>
>>> There is a mail on the dev forum about this as well to disucss it there.
>>>
>>> The DEBUG logging could maybe be toned down to TRACE
>>>
>>>
>>> On Tue, Mar 3, 2009 at 12:32 PM, cmoulliard <cm...@gmail.com> wrote:
>>>> Hi Willem,
>>>>
>>>> It works (I mean the file can be processed by Camel) but
>>>>
>>>> 1) in DEBUG mode, the log of SMX4 server is polluted by hundreds of line
>>>> like this :
>>>>
>>>> 12:11:01,687 | DEBUG | omponent@1d4f279 | ResolverUtil
>>>>   |
>>>> g.apache.camel.util.ResolverUtil  571 | Could not find class
>>>> 'org/apache/camel/converter/stream/StreamCacheConverter$InputStreamCache.class'
>>>> in classloader: BundleDelegatingClassLoader for [Report Incident
>>>> Interfaces
>>>> Bundle (reportincident.interfaces)]. Reason:
>>>> java.lang.ClassNotFoundException:
>>>> org.apache.camel.converter.stream.StreamCacheConverter$InputStreamCache
>>>> not
>>>> found from bundle [reportincident.interfaces]
>>>> java.lang.ClassNotFoundException:
>>>> org.apache.camel.converter.stream.StreamCacheConverter$InputStreamCache
>>>> not
>>>> found from bundle [reportincident.interfaces]
>>>>        at
>>>> org.springframework.osgi.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:103)
>>>>        at
>>>> org.springframework.osgi.util.BundleDelegatingClassLoader.loadClass(BundleDelegatingClassLoader.java:156)
>>>>        at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
>>>>        at
>>>> org.apache.camel.util.ResolverUtil.addIfMatching(ResolverUtil.java:561)
>>>>        at
>>>> org.apache.camel.osgi.OsgiResolverUtil.loadImplementationsInBundle(OsgiResolverUtil.java:135)
>>>>        at
>>>> org.apache.camel.osgi.OsgiResolverUtil.findInOsgiClassLoader(OsgiResolverUtil.java:92)
>>>>        at
>>>> org.apache.camel.osgi.OsgiResolverUtil.find(OsgiResolverUtil.java:73)
>>>>        at
>>>> org.apache.camel.util.ResolverUtil.findAnnotated(ResolverUtil.java:301)
>>>>        at
>>>> org.apache.camel.impl.converter.AnnotationTypeConverterLoader.load(AnnotationTypeConverterLoader.java:73)
>>>>        at
>>>> org.apache.camel.impl.converter.DefaultTypeConverter.checkLoaded(DefaultTypeConverter.java:296)
>>>>        at
>>>> org.apache.camel.impl.converter.DefaultTypeConverter.convertTo(DefaultTypeConverter.java:98)
>>>>        at
>>>> org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:66)
>>>>        at
>>>> org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:51)
>>>>        at
>>>> org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:74)
>>>>        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)
>>>> Caused by: java.lang.ClassNotFoundException:
>>>> org.apache.camel.converter.stream.StreamCacheConverter$InputStreamCache
>>>>        at
>>>> org.apache.felix.framework.searchpolicy.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:566)
>>>>        at
>>>> org.apache.felix.framework.searchpolicy.ModuleImpl.access$100(ModuleImpl.java:59)
>>>>        at
>>>> org.apache.felix.framework.searchpolicy.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1371)
>>>>        at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
>>>>        at
>>>> org.apache.felix.framework.searchpolicy.ModuleImpl.getClassByDelegation(ModuleImpl.java:428)
>>>>        at
>>>> org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1341)
>>>>        at
>>>> org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:737)
>>>>        at
>>>> org.springframework.osgi.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:99)
>>>>        ... 26 more
>>>>
>>>> 2) I have a more serious problem. The classes of my model are not loaded.
>>>> In
>>>> DEBUG mode, we should see this on the console
>>>>
>>>> 2009-03-03 12:28:34,671 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:
>>>> [org.apache.camel.example.reportincident.model]
>>>> 2009-03-03 12:28:34,687 DEBUG ResolverUtil - Using only regular
>>>> classloaders
>>>> 2009-03-03 12:28:34,687 DEBUG ResolverUtil - Loading from directory:
>>>> D:\Dvlpt\Java\workspace-ganymede\osgi\reportincident.interfaces\target\classes\org\apache\camel\example\reportincident\model
>>>> 2009-03-03 12:28:34,703 DEBUG ResolverUtil - Found: [class
>>>> org.apache.camel.example.reportincident.model.Order, class
>>>> org.apache.camel.example.reportincident.model.Client]
>>>> 2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
>>>> class : org.apache.camel.example.reportincident.model.Order, position :
>>>> 0,
>>>> Field :
>>>> @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
>>>> pattern=, name=, length=0, pos=0)
>>>> 2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Class linked  :
>>>> org.apache.camel.example.reportincident.model.Order, Fieldpublic
>>>> org.apache.camel.example.reportincident.model.Client
>>>> org.apache.camel.example.reportincident.model.Order.client
>>>> 2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
>>>> class : org.apache.camel.example.reportincident.model.Order, position :
>>>> 4,
>>>> Field :
>>>> @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
>>>> pattern=, name=, length=0, pos=4)
>>>> 2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
>>>> class : org.apache.camel.example.reportincident.model.Order, position :
>>>> 5,
>>>> Field :
>>>> @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
>>>> pattern=, name=Name, length=0, pos=5)
>>>> 2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
>>>> class : org.apache.camel.example.reportincident.model.Order, position :
>>>> 6,
>>>> Field :
>>>> @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
>>>> pattern=, name=, length=0, pos=6)
>>>> 2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
>>>> class : org.apache.camel.example.reportincident.model.Order, position :
>>>> 7,
>>>> Field :
>>>> @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
>>>> pattern=, name=, length=0, pos=7)
>>>> 2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
>>>> class : org.apache.camel.example.reportincident.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-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
>>>> class : org.apache.camel.example.reportincident.model.Client, position :
>>>> 1,
>>>> Field :
>>>> @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
>>>> pattern=, name=, length=0, pos=1)
>>>> 2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
>>>> class : org.apache.camel.example.reportincident.model.Client, position :
>>>> 2,
>>>> Field :
>>>> @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
>>>> pattern=, name=, length=0, pos=2)
>>>> 2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
>>>> class : org.apache.camel.example.reportincident.model.Client, position :
>>>> 3,
>>>> Field :
>>>> @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
>>>> pattern=, name=, length=0, pos=3)
>>>>
>>>>
>>>> but nothing is displayed except :
>>>>
>>>> 12:11:01,765 | DEBUG | omponent@1d4f279 | ResolverUtil
>>>>   |
>>>> g.apache.camel.util.ResolverUtil  324 | 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:
>>>> [org.apache.camel.example.reportincident.model]
>>>>
>>>> - Is the error due to the AnnotationModelLoader.java class of camel-bindy
>>>> ?
>>>> - Do we have to do something to convert camel-bindy into an OSGI bundle ?
>>>>
>>>> Regards,
>>>>
>>>>
>>>> willem.jiang wrote:
>>>>> 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 <cm...@gmail.com>
>>>>>> 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 <cm...@gmail.com>
>>>>>>>> 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 | omponent@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.GenericFileNoOpProcessStrategy@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.
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>> -----
>>>> 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-tp22289722p22306918.html
>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>>>
>>> --
>>> Claus Ibsen
>>> Apache Camel Committer
>>>
>>> Open Source Integration: http://fusesource.com
>>> Blog: http://davsclaus.blogspot.com/
>>>
>>>
>>
>>
>> -----
>> Charles Moulliard
>> SOA Architect
>>
>> My Blog :  http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/

Re: org.apache.camel.NoTypeConversionAvailableException: No type converter available to convert from type: org.apache.camel.component.file.GenericFileMessage to the required type - SMX4 !

Posted by Willem Jiang <wi...@gmail.com>.
Hi Charles,

I think you can get the ResolverUtil from the camel context.
Maybe we need to do some changes on the bindy component.

Willem

cmoulliard wrote:
> Do you see a temporary workaround because I'm blocked  ?
> 
> 
> Claus Ibsen-2 wrote:
>> Hi
>>
>> Yeah this resolver needs to be OSGi aware also.
>>
>> I think we need to provide these resolvers on the CamelContext so
>> component authors like you can use them to resolve classes and
>> whatelse, and it would be transparent for you if it was regular or
>> OSGi platforms.
>>
>> See ticket 1411 that is about this. Just need to add getResolverUtil
>> as well, and we should probably rename it as its a bad name to put out
>> in the open.
>> We need an API for it as well in the SPI package.
>>
>> There is a mail on the dev forum about this as well to disucss it there.
>>
>> The DEBUG logging could maybe be toned down to TRACE
>>
>>
>> On Tue, Mar 3, 2009 at 12:32 PM, cmoulliard <cm...@gmail.com> wrote:
>>> Hi Willem,
>>>
>>> It works (I mean the file can be processed by Camel) but
>>>
>>> 1) in DEBUG mode, the log of SMX4 server is polluted by hundreds of line
>>> like this :
>>>
>>> 12:11:01,687 | DEBUG | omponent@1d4f279 | ResolverUtil                  
>>>   |
>>> g.apache.camel.util.ResolverUtil  571 | Could not find class
>>> 'org/apache/camel/converter/stream/StreamCacheConverter$InputStreamCache.class'
>>> in classloader: BundleDelegatingClassLoader for [Report Incident
>>> Interfaces
>>> Bundle (reportincident.interfaces)]. Reason:
>>> java.lang.ClassNotFoundException:
>>> org.apache.camel.converter.stream.StreamCacheConverter$InputStreamCache
>>> not
>>> found from bundle [reportincident.interfaces]
>>> java.lang.ClassNotFoundException:
>>> org.apache.camel.converter.stream.StreamCacheConverter$InputStreamCache
>>> not
>>> found from bundle [reportincident.interfaces]
>>>        at
>>> org.springframework.osgi.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:103)
>>>        at
>>> org.springframework.osgi.util.BundleDelegatingClassLoader.loadClass(BundleDelegatingClassLoader.java:156)
>>>        at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
>>>        at
>>> org.apache.camel.util.ResolverUtil.addIfMatching(ResolverUtil.java:561)
>>>        at
>>> org.apache.camel.osgi.OsgiResolverUtil.loadImplementationsInBundle(OsgiResolverUtil.java:135)
>>>        at
>>> org.apache.camel.osgi.OsgiResolverUtil.findInOsgiClassLoader(OsgiResolverUtil.java:92)
>>>        at
>>> org.apache.camel.osgi.OsgiResolverUtil.find(OsgiResolverUtil.java:73)
>>>        at
>>> org.apache.camel.util.ResolverUtil.findAnnotated(ResolverUtil.java:301)
>>>        at
>>> org.apache.camel.impl.converter.AnnotationTypeConverterLoader.load(AnnotationTypeConverterLoader.java:73)
>>>        at
>>> org.apache.camel.impl.converter.DefaultTypeConverter.checkLoaded(DefaultTypeConverter.java:296)
>>>        at
>>> org.apache.camel.impl.converter.DefaultTypeConverter.convertTo(DefaultTypeConverter.java:98)
>>>        at
>>> org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:66)
>>>        at
>>> org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:51)
>>>        at
>>> org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:74)
>>>        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)
>>> Caused by: java.lang.ClassNotFoundException:
>>> org.apache.camel.converter.stream.StreamCacheConverter$InputStreamCache
>>>        at
>>> org.apache.felix.framework.searchpolicy.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:566)
>>>        at
>>> org.apache.felix.framework.searchpolicy.ModuleImpl.access$100(ModuleImpl.java:59)
>>>        at
>>> org.apache.felix.framework.searchpolicy.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1371)
>>>        at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
>>>        at
>>> org.apache.felix.framework.searchpolicy.ModuleImpl.getClassByDelegation(ModuleImpl.java:428)
>>>        at
>>> org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1341)
>>>        at
>>> org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:737)
>>>        at
>>> org.springframework.osgi.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:99)
>>>        ... 26 more
>>>
>>> 2) I have a more serious problem. The classes of my model are not loaded.
>>> In
>>> DEBUG mode, we should see this on the console
>>>
>>> 2009-03-03 12:28:34,671 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:
>>> [org.apache.camel.example.reportincident.model]
>>> 2009-03-03 12:28:34,687 DEBUG ResolverUtil - Using only regular
>>> classloaders
>>> 2009-03-03 12:28:34,687 DEBUG ResolverUtil - Loading from directory:
>>> D:\Dvlpt\Java\workspace-ganymede\osgi\reportincident.interfaces\target\classes\org\apache\camel\example\reportincident\model
>>> 2009-03-03 12:28:34,703 DEBUG ResolverUtil - Found: [class
>>> org.apache.camel.example.reportincident.model.Order, class
>>> org.apache.camel.example.reportincident.model.Client]
>>> 2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
>>> class : org.apache.camel.example.reportincident.model.Order, position :
>>> 0,
>>> Field :
>>> @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
>>> pattern=, name=, length=0, pos=0)
>>> 2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Class linked  :
>>> org.apache.camel.example.reportincident.model.Order, Fieldpublic
>>> org.apache.camel.example.reportincident.model.Client
>>> org.apache.camel.example.reportincident.model.Order.client
>>> 2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
>>> class : org.apache.camel.example.reportincident.model.Order, position :
>>> 4,
>>> Field :
>>> @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
>>> pattern=, name=, length=0, pos=4)
>>> 2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
>>> class : org.apache.camel.example.reportincident.model.Order, position :
>>> 5,
>>> Field :
>>> @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
>>> pattern=, name=Name, length=0, pos=5)
>>> 2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
>>> class : org.apache.camel.example.reportincident.model.Order, position :
>>> 6,
>>> Field :
>>> @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
>>> pattern=, name=, length=0, pos=6)
>>> 2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
>>> class : org.apache.camel.example.reportincident.model.Order, position :
>>> 7,
>>> Field :
>>> @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
>>> pattern=, name=, length=0, pos=7)
>>> 2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
>>> class : org.apache.camel.example.reportincident.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-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
>>> class : org.apache.camel.example.reportincident.model.Client, position :
>>> 1,
>>> Field :
>>> @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
>>> pattern=, name=, length=0, pos=1)
>>> 2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
>>> class : org.apache.camel.example.reportincident.model.Client, position :
>>> 2,
>>> Field :
>>> @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
>>> pattern=, name=, length=0, pos=2)
>>> 2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
>>> class : org.apache.camel.example.reportincident.model.Client, position :
>>> 3,
>>> Field :
>>> @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
>>> pattern=, name=, length=0, pos=3)
>>>
>>>
>>> but nothing is displayed except :
>>>
>>> 12:11:01,765 | DEBUG | omponent@1d4f279 | ResolverUtil                  
>>>   |
>>> g.apache.camel.util.ResolverUtil  324 | 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:
>>> [org.apache.camel.example.reportincident.model]
>>>
>>> - Is the error due to the AnnotationModelLoader.java class of camel-bindy
>>> ?
>>> - Do we have to do something to convert camel-bindy into an OSGI bundle ?
>>>
>>> Regards,
>>>
>>>
>>> willem.jiang wrote:
>>>> 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 <cm...@gmail.com>
>>>>> 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 <cm...@gmail.com>
>>>>>>> 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 | omponent@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.GenericFileNoOpProcessStrategy@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.
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>> -----
>>> 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-tp22289722p22306918.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>> -- 
>> Claus Ibsen
>> Apache Camel Committer
>>
>> Open Source Integration: http://fusesource.com
>> Blog: http://davsclaus.blogspot.com/
>>
>>
> 
> 
> -----
> Charles Moulliard
> SOA Architect
> 
> My Blog :  http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/  


Re: org.apache.camel.NoTypeConversionAvailableException: No type converter available to convert from type: org.apache.camel.component.file.GenericFileMessage to the required type - SMX4 !

Posted by cmoulliard <cm...@gmail.com>.
Do you see a temporary workaround because I'm blocked  ?


Claus Ibsen-2 wrote:
> 
> Hi
> 
> Yeah this resolver needs to be OSGi aware also.
> 
> I think we need to provide these resolvers on the CamelContext so
> component authors like you can use them to resolve classes and
> whatelse, and it would be transparent for you if it was regular or
> OSGi platforms.
> 
> See ticket 1411 that is about this. Just need to add getResolverUtil
> as well, and we should probably rename it as its a bad name to put out
> in the open.
> We need an API for it as well in the SPI package.
> 
> There is a mail on the dev forum about this as well to disucss it there.
> 
> The DEBUG logging could maybe be toned down to TRACE
> 
> 
> On Tue, Mar 3, 2009 at 12:32 PM, cmoulliard <cm...@gmail.com> wrote:
>>
>> Hi Willem,
>>
>> It works (I mean the file can be processed by Camel) but
>>
>> 1) in DEBUG mode, the log of SMX4 server is polluted by hundreds of line
>> like this :
>>
>> 12:11:01,687 | DEBUG | omponent@1d4f279 | ResolverUtil                  
>>   |
>> g.apache.camel.util.ResolverUtil  571 | Could not find class
>> 'org/apache/camel/converter/stream/StreamCacheConverter$InputStreamCache.class'
>> in classloader: BundleDelegatingClassLoader for [Report Incident
>> Interfaces
>> Bundle (reportincident.interfaces)]. Reason:
>> java.lang.ClassNotFoundException:
>> org.apache.camel.converter.stream.StreamCacheConverter$InputStreamCache
>> not
>> found from bundle [reportincident.interfaces]
>> java.lang.ClassNotFoundException:
>> org.apache.camel.converter.stream.StreamCacheConverter$InputStreamCache
>> not
>> found from bundle [reportincident.interfaces]
>>        at
>> org.springframework.osgi.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:103)
>>        at
>> org.springframework.osgi.util.BundleDelegatingClassLoader.loadClass(BundleDelegatingClassLoader.java:156)
>>        at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
>>        at
>> org.apache.camel.util.ResolverUtil.addIfMatching(ResolverUtil.java:561)
>>        at
>> org.apache.camel.osgi.OsgiResolverUtil.loadImplementationsInBundle(OsgiResolverUtil.java:135)
>>        at
>> org.apache.camel.osgi.OsgiResolverUtil.findInOsgiClassLoader(OsgiResolverUtil.java:92)
>>        at
>> org.apache.camel.osgi.OsgiResolverUtil.find(OsgiResolverUtil.java:73)
>>        at
>> org.apache.camel.util.ResolverUtil.findAnnotated(ResolverUtil.java:301)
>>        at
>> org.apache.camel.impl.converter.AnnotationTypeConverterLoader.load(AnnotationTypeConverterLoader.java:73)
>>        at
>> org.apache.camel.impl.converter.DefaultTypeConverter.checkLoaded(DefaultTypeConverter.java:296)
>>        at
>> org.apache.camel.impl.converter.DefaultTypeConverter.convertTo(DefaultTypeConverter.java:98)
>>        at
>> org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:66)
>>        at
>> org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:51)
>>        at
>> org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:74)
>>        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)
>> Caused by: java.lang.ClassNotFoundException:
>> org.apache.camel.converter.stream.StreamCacheConverter$InputStreamCache
>>        at
>> org.apache.felix.framework.searchpolicy.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:566)
>>        at
>> org.apache.felix.framework.searchpolicy.ModuleImpl.access$100(ModuleImpl.java:59)
>>        at
>> org.apache.felix.framework.searchpolicy.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1371)
>>        at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
>>        at
>> org.apache.felix.framework.searchpolicy.ModuleImpl.getClassByDelegation(ModuleImpl.java:428)
>>        at
>> org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1341)
>>        at
>> org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:737)
>>        at
>> org.springframework.osgi.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:99)
>>        ... 26 more
>>
>> 2) I have a more serious problem. The classes of my model are not loaded.
>> In
>> DEBUG mode, we should see this on the console
>>
>> 2009-03-03 12:28:34,671 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:
>> [org.apache.camel.example.reportincident.model]
>> 2009-03-03 12:28:34,687 DEBUG ResolverUtil - Using only regular
>> classloaders
>> 2009-03-03 12:28:34,687 DEBUG ResolverUtil - Loading from directory:
>> D:\Dvlpt\Java\workspace-ganymede\osgi\reportincident.interfaces\target\classes\org\apache\camel\example\reportincident\model
>> 2009-03-03 12:28:34,703 DEBUG ResolverUtil - Found: [class
>> org.apache.camel.example.reportincident.model.Order, class
>> org.apache.camel.example.reportincident.model.Client]
>> 2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
>> class : org.apache.camel.example.reportincident.model.Order, position :
>> 0,
>> Field :
>> @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
>> pattern=, name=, length=0, pos=0)
>> 2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Class linked  :
>> org.apache.camel.example.reportincident.model.Order, Fieldpublic
>> org.apache.camel.example.reportincident.model.Client
>> org.apache.camel.example.reportincident.model.Order.client
>> 2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
>> class : org.apache.camel.example.reportincident.model.Order, position :
>> 4,
>> Field :
>> @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
>> pattern=, name=, length=0, pos=4)
>> 2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
>> class : org.apache.camel.example.reportincident.model.Order, position :
>> 5,
>> Field :
>> @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
>> pattern=, name=Name, length=0, pos=5)
>> 2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
>> class : org.apache.camel.example.reportincident.model.Order, position :
>> 6,
>> Field :
>> @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
>> pattern=, name=, length=0, pos=6)
>> 2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
>> class : org.apache.camel.example.reportincident.model.Order, position :
>> 7,
>> Field :
>> @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
>> pattern=, name=, length=0, pos=7)
>> 2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
>> class : org.apache.camel.example.reportincident.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-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
>> class : org.apache.camel.example.reportincident.model.Client, position :
>> 1,
>> Field :
>> @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
>> pattern=, name=, length=0, pos=1)
>> 2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
>> class : org.apache.camel.example.reportincident.model.Client, position :
>> 2,
>> Field :
>> @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
>> pattern=, name=, length=0, pos=2)
>> 2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
>> class : org.apache.camel.example.reportincident.model.Client, position :
>> 3,
>> Field :
>> @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
>> pattern=, name=, length=0, pos=3)
>>
>>
>> but nothing is displayed except :
>>
>> 12:11:01,765 | DEBUG | omponent@1d4f279 | ResolverUtil                  
>>   |
>> g.apache.camel.util.ResolverUtil  324 | 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:
>> [org.apache.camel.example.reportincident.model]
>>
>> - Is the error due to the AnnotationModelLoader.java class of camel-bindy
>> ?
>> - Do we have to do something to convert camel-bindy into an OSGI bundle ?
>>
>> Regards,
>>
>>
>> willem.jiang wrote:
>>>
>>> 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 <cm...@gmail.com>
>>>> 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 <cm...@gmail.com>
>>>>>> 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 | omponent@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.GenericFileNoOpProcessStrategy@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.
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>> -----
>> 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-tp22289722p22306918.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> Claus Ibsen
> Apache Camel Committer
> 
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.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-tp22289722p22307302.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: org.apache.camel.NoTypeConversionAvailableException: No type converter available to convert from type: org.apache.camel.component.file.GenericFileMessage to the required type - SMX4 !

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Yeah this resolver needs to be OSGi aware also.

I think we need to provide these resolvers on the CamelContext so
component authors like you can use them to resolve classes and
whatelse, and it would be transparent for you if it was regular or
OSGi platforms.

See ticket 1411 that is about this. Just need to add getResolverUtil
as well, and we should probably rename it as its a bad name to put out
in the open.
We need an API for it as well in the SPI package.

There is a mail on the dev forum about this as well to disucss it there.

The DEBUG logging could maybe be toned down to TRACE


On Tue, Mar 3, 2009 at 12:32 PM, cmoulliard <cm...@gmail.com> wrote:
>
> Hi Willem,
>
> It works (I mean the file can be processed by Camel) but
>
> 1) in DEBUG mode, the log of SMX4 server is polluted by hundreds of line
> like this :
>
> 12:11:01,687 | DEBUG | omponent@1d4f279 | ResolverUtil                     |
> g.apache.camel.util.ResolverUtil  571 | Could not find class
> 'org/apache/camel/converter/stream/StreamCacheConverter$InputStreamCache.class'
> in classloader: BundleDelegatingClassLoader for [Report Incident Interfaces
> Bundle (reportincident.interfaces)]. Reason:
> java.lang.ClassNotFoundException:
> org.apache.camel.converter.stream.StreamCacheConverter$InputStreamCache not
> found from bundle [reportincident.interfaces]
> java.lang.ClassNotFoundException:
> org.apache.camel.converter.stream.StreamCacheConverter$InputStreamCache not
> found from bundle [reportincident.interfaces]
>        at
> org.springframework.osgi.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:103)
>        at
> org.springframework.osgi.util.BundleDelegatingClassLoader.loadClass(BundleDelegatingClassLoader.java:156)
>        at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
>        at org.apache.camel.util.ResolverUtil.addIfMatching(ResolverUtil.java:561)
>        at
> org.apache.camel.osgi.OsgiResolverUtil.loadImplementationsInBundle(OsgiResolverUtil.java:135)
>        at
> org.apache.camel.osgi.OsgiResolverUtil.findInOsgiClassLoader(OsgiResolverUtil.java:92)
>        at org.apache.camel.osgi.OsgiResolverUtil.find(OsgiResolverUtil.java:73)
>        at org.apache.camel.util.ResolverUtil.findAnnotated(ResolverUtil.java:301)
>        at
> org.apache.camel.impl.converter.AnnotationTypeConverterLoader.load(AnnotationTypeConverterLoader.java:73)
>        at
> org.apache.camel.impl.converter.DefaultTypeConverter.checkLoaded(DefaultTypeConverter.java:296)
>        at
> org.apache.camel.impl.converter.DefaultTypeConverter.convertTo(DefaultTypeConverter.java:98)
>        at org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:66)
>        at org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:51)
>        at
> org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:74)
>        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)
> Caused by: java.lang.ClassNotFoundException:
> org.apache.camel.converter.stream.StreamCacheConverter$InputStreamCache
>        at
> org.apache.felix.framework.searchpolicy.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:566)
>        at
> org.apache.felix.framework.searchpolicy.ModuleImpl.access$100(ModuleImpl.java:59)
>        at
> org.apache.felix.framework.searchpolicy.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1371)
>        at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
>        at
> org.apache.felix.framework.searchpolicy.ModuleImpl.getClassByDelegation(ModuleImpl.java:428)
>        at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1341)
>        at org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:737)
>        at
> org.springframework.osgi.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:99)
>        ... 26 more
>
> 2) I have a more serious problem. The classes of my model are not loaded. In
> DEBUG mode, we should see this on the console
>
> 2009-03-03 12:28:34,671 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:
> [org.apache.camel.example.reportincident.model]
> 2009-03-03 12:28:34,687 DEBUG ResolverUtil - Using only regular classloaders
> 2009-03-03 12:28:34,687 DEBUG ResolverUtil - Loading from directory:
> D:\Dvlpt\Java\workspace-ganymede\osgi\reportincident.interfaces\target\classes\org\apache\camel\example\reportincident\model
> 2009-03-03 12:28:34,703 DEBUG ResolverUtil - Found: [class
> org.apache.camel.example.reportincident.model.Order, class
> org.apache.camel.example.reportincident.model.Client]
> 2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
> class : org.apache.camel.example.reportincident.model.Order, position : 0,
> Field : @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
> pattern=, name=, length=0, pos=0)
> 2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Class linked  :
> org.apache.camel.example.reportincident.model.Order, Fieldpublic
> org.apache.camel.example.reportincident.model.Client
> org.apache.camel.example.reportincident.model.Order.client
> 2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
> class : org.apache.camel.example.reportincident.model.Order, position : 4,
> Field : @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
> pattern=, name=, length=0, pos=4)
> 2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
> class : org.apache.camel.example.reportincident.model.Order, position : 5,
> Field : @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
> pattern=, name=Name, length=0, pos=5)
> 2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
> class : org.apache.camel.example.reportincident.model.Order, position : 6,
> Field : @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
> pattern=, name=, length=0, pos=6)
> 2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
> class : org.apache.camel.example.reportincident.model.Order, position : 7,
> Field : @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
> pattern=, name=, length=0, pos=7)
> 2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
> class : org.apache.camel.example.reportincident.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-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
> class : org.apache.camel.example.reportincident.model.Client, position : 1,
> Field : @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
> pattern=, name=, length=0, pos=1)
> 2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
> class : org.apache.camel.example.reportincident.model.Client, position : 2,
> Field : @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
> pattern=, name=, length=0, pos=2)
> 2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
> class : org.apache.camel.example.reportincident.model.Client, position : 3,
> Field : @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
> pattern=, name=, length=0, pos=3)
>
>
> but nothing is displayed except :
>
> 12:11:01,765 | DEBUG | omponent@1d4f279 | ResolverUtil                     |
> g.apache.camel.util.ResolverUtil  324 | 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:
> [org.apache.camel.example.reportincident.model]
>
> - Is the error due to the AnnotationModelLoader.java class of camel-bindy ?
> - Do we have to do something to convert camel-bindy into an OSGI bundle ?
>
> Regards,
>
>
> willem.jiang wrote:
>>
>> 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 <cm...@gmail.com> 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 <cm...@gmail.com>
>>>>> 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 | omponent@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.GenericFileNoOpProcessStrategy@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.
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>>
>
>
> -----
> 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-tp22289722p22306918.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/

Re: org.apache.camel.NoTypeConversionAvailableException: No type converter available to convert from type: org.apache.camel.component.file.GenericFileMessage to the required type - SMX4 !

Posted by cmoulliard <cm...@gmail.com>.
Hi Willem,

It works (I mean the file can be processed by Camel) but 

1) in DEBUG mode, the log of SMX4 server is polluted by hundreds of line
like this :

12:11:01,687 | DEBUG | omponent@1d4f279 | ResolverUtil                     |
g.apache.camel.util.ResolverUtil  571 | Could not find class
'org/apache/camel/converter/stream/StreamCacheConverter$InputStreamCache.class'
in classloader: BundleDelegatingClassLoader for [Report Incident Interfaces
Bundle (reportincident.interfaces)]. Reason:
java.lang.ClassNotFoundException:
org.apache.camel.converter.stream.StreamCacheConverter$InputStreamCache not
found from bundle [reportincident.interfaces]
java.lang.ClassNotFoundException:
org.apache.camel.converter.stream.StreamCacheConverter$InputStreamCache not
found from bundle [reportincident.interfaces]
	at
org.springframework.osgi.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:103)
	at
org.springframework.osgi.util.BundleDelegatingClassLoader.loadClass(BundleDelegatingClassLoader.java:156)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
	at org.apache.camel.util.ResolverUtil.addIfMatching(ResolverUtil.java:561)
	at
org.apache.camel.osgi.OsgiResolverUtil.loadImplementationsInBundle(OsgiResolverUtil.java:135)
	at
org.apache.camel.osgi.OsgiResolverUtil.findInOsgiClassLoader(OsgiResolverUtil.java:92)
	at org.apache.camel.osgi.OsgiResolverUtil.find(OsgiResolverUtil.java:73)
	at org.apache.camel.util.ResolverUtil.findAnnotated(ResolverUtil.java:301)
	at
org.apache.camel.impl.converter.AnnotationTypeConverterLoader.load(AnnotationTypeConverterLoader.java:73)
	at
org.apache.camel.impl.converter.DefaultTypeConverter.checkLoaded(DefaultTypeConverter.java:296)
	at
org.apache.camel.impl.converter.DefaultTypeConverter.convertTo(DefaultTypeConverter.java:98)
	at org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:66)
	at org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:51)
	at
org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:74)
	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)
Caused by: java.lang.ClassNotFoundException:
org.apache.camel.converter.stream.StreamCacheConverter$InputStreamCache
	at
org.apache.felix.framework.searchpolicy.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:566)
	at
org.apache.felix.framework.searchpolicy.ModuleImpl.access$100(ModuleImpl.java:59)
	at
org.apache.felix.framework.searchpolicy.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1371)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
	at
org.apache.felix.framework.searchpolicy.ModuleImpl.getClassByDelegation(ModuleImpl.java:428)
	at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1341)
	at org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:737)
	at
org.springframework.osgi.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:99)
	... 26 more

2) I have a more serious problem. The classes of my model are not loaded. In
DEBUG mode, we should see this on the console 

2009-03-03 12:28:34,671 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:
[org.apache.camel.example.reportincident.model] 
2009-03-03 12:28:34,687 DEBUG ResolverUtil - Using only regular classloaders 
2009-03-03 12:28:34,687 DEBUG ResolverUtil - Loading from directory:
D:\Dvlpt\Java\workspace-ganymede\osgi\reportincident.interfaces\target\classes\org\apache\camel\example\reportincident\model 
2009-03-03 12:28:34,703 DEBUG ResolverUtil - Found: [class
org.apache.camel.example.reportincident.model.Order, class
org.apache.camel.example.reportincident.model.Client] 
2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
class : org.apache.camel.example.reportincident.model.Order, position : 0,
Field : @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
pattern=, name=, length=0, pos=0) 
2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Class linked  :
org.apache.camel.example.reportincident.model.Order, Fieldpublic
org.apache.camel.example.reportincident.model.Client
org.apache.camel.example.reportincident.model.Order.client 
2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
class : org.apache.camel.example.reportincident.model.Order, position : 4,
Field : @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
pattern=, name=, length=0, pos=4) 
2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
class : org.apache.camel.example.reportincident.model.Order, position : 5,
Field : @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
pattern=, name=Name, length=0, pos=5) 
2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
class : org.apache.camel.example.reportincident.model.Order, position : 6,
Field : @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
pattern=, name=, length=0, pos=6) 
2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
class : org.apache.camel.example.reportincident.model.Order, position : 7,
Field : @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
pattern=, name=, length=0, pos=7) 
2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
class : org.apache.camel.example.reportincident.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-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
class : org.apache.camel.example.reportincident.model.Client, position : 1,
Field : @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
pattern=, name=, length=0, pos=1) 
2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
class : org.apache.camel.example.reportincident.model.Client, position : 2,
Field : @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
pattern=, name=, length=0, pos=2) 
2009-03-03 12:28:34,703 DEBUG BindyCsvFactory - Position defined in the
class : org.apache.camel.example.reportincident.model.Client, position : 3,
Field : @org.apache.camel.dataformat.bindy.annotation.DataField(precision=0,
pattern=, name=, length=0, pos=3) 


but nothing is displayed except :

12:11:01,765 | DEBUG | omponent@1d4f279 | ResolverUtil                     |
g.apache.camel.util.ResolverUtil  324 | 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:
[org.apache.camel.example.reportincident.model]

- Is the error due to the AnnotationModelLoader.java class of camel-bindy ?
- Do we have to do something to convert camel-bindy into an OSGI bundle ?

Regards,


willem.jiang wrote:
> 
> 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 <cm...@gmail.com> 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 <cm...@gmail.com>
>>>> 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 | omponent@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.GenericFileNoOpProcessStrategy@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.
>>>
>>>
>> 
>> 
>> 
> 
> 
> 


-----
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-tp22289722p22306918.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: org.apache.camel.NoTypeConversionAvailableException: No type converter available to convert from type: org.apache.camel.component.file.GenericFileMessage to the required type - SMX4 !

Posted by Willem Jiang <wi...@gmail.com>.
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 <cm...@gmail.com> 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 <cm...@gmail.com> 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 | omponent@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.GenericFileNoOpProcessStrategy@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.
>>
>>
> 
> 
> 


Re: org.apache.camel.NoTypeConversionAvailableException: No type converter available to convert from type: org.apache.camel.component.file.GenericFileMessage to the required type - SMX4 !

Posted by cmoulliard <cm...@gmail.com>.
Hi Claus,

As explained in my message, everything works fine when running outside of
SMXKNL4. So, the issue is related to OSGI.

Regards,

Charles


Claus Ibsen-2 wrote:
> 
> Hi Charles
> 
> Can you try it outside OSGi, eg running from a unit test or something.
> Just to get the fact straight whether or not running in OSGi is a
> problem.
> 
> On Mon, Mar 2, 2009 at 5:47 PM, Claus Ibsen <cl...@gmail.com> 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 <cm...@gmail.com> 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 <cm...@gmail.com>
>>>> 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 | omponent@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.GenericFileNoOpProcessStrategy@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.
>>>
>>>
>>
>>
>>
>> --
>> Claus Ibsen
>> Apache Camel Committer
>>
>> Open Source Integration: http://fusesource.com
>> Blog: http://davsclaus.blogspot.com/
>>
> 
> 
> 
> -- 
> Claus Ibsen
> Apache Camel Committer
> 
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.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-tp22289722p22304581.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: org.apache.camel.NoTypeConversionAvailableException: No type converter available to convert from type: org.apache.camel.component.file.GenericFileMessage to the required type - SMX4 !

Posted by Claus Ibsen <cl...@gmail.com>.
Hi Charles

Can you try it outside OSGi, eg running from a unit test or something.
Just to get the fact straight whether or not running in OSGi is a
problem.

On Mon, Mar 2, 2009 at 5:47 PM, Claus Ibsen <cl...@gmail.com> 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 <cm...@gmail.com> 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 <cm...@gmail.com> 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 | omponent@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.GenericFileNoOpProcessStrategy@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.
>>
>>
>
>
>
> --
> Claus Ibsen
> Apache Camel Committer
>
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/

Re: org.apache.camel.NoTypeConversionAvailableException: No type converter available to convert from type: org.apache.camel.component.file.GenericFileMessage to the required type - SMX4 !

Posted by Claus Ibsen <cl...@gmail.com>.
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 <cm...@gmail.com> 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 <cm...@gmail.com> 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 | omponent@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.GenericFileNoOpProcessStrategy@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.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/

Re: org.apache.camel.NoTypeConversionAvailableException: No type converter available to convert from type: org.apache.camel.component.file.GenericFileMessage to the required type - SMX4 !

Posted by cmoulliard <cm...@gmail.com>.
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 <cm...@gmail.com> 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 | omponent@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.GenericFileNoOpProcessStrategy@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.


Re: org.apache.camel.NoTypeConversionAvailableException: No type converter available to convert from type: org.apache.camel.component.file.GenericFileMessage to the required type - SMX4 !

Posted by Willem Jiang <wi...@gmail.com>.
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 <cm...@gmail.com> 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 | omponent@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.GenericFileNoOpProcessStrategy@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.
>
>