camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: XML file input - NoTypeConversionAvailableException
Date Wed, 24 Feb 2010 06:48:22 GMT
Hi,

I think you need to turn the Generic File into InputStream first, just 
like this
from("file:../../../data/notice?noop=true").convertBodyTo(InputStream.class).convertBodyTo(Notice.class).to("jpa:au.com.interlated.server.domain.Notice");

Willem

john robens wrote:
> Claus
> 
> Java is java version "1.6.0_17" - macos. Was getting the same result on
> linux.
> 
> Thanks
> John
> 
> 
> On 23 February 2010 04:10, Claus Ibsen <claus.ibsen@gmail.com> wrote:
> 
>> Hi
>>
>> No I have not seen this before. Are you using jdk 1.5 or 1.6?
>> If 1.5 are you sure all the JAXB classes is included in the classpath?
>>
>>
>>
>> On Mon, Feb 22, 2010 at 1:46 PM, john robens <jrobens@interlated.com.au>
>> wrote:
>>> Hi
>>>
>>> I have this error - which seems relatively common except that my twist
>> seems
>>> to happen when am running camel from a jar file not from the mvn:camel
>>> target.
>>>
>>>> Works fine when run under "mvn camel:run"
>>>> Fails when run java -jar
>>> target/server-1.0-SNAPSHOT-jar-with-dependencies.jar
>>>
>>> Is this a known thing, or do I need debugging hints to delve into a
>>> classpath? Look at the camel converters?
>>>
>>>
>>> Caused by: [org.apache.camel.NoTypeConversionAvailableException - No type
>>> converter available to convert from type:
>>> org.apache.camel.component.file.GenericFile to the required type:
>>> au.com.hearing.server.domain.Client with value GenericFile[pclient99981]]
>>>
>>> a) XML file is defined in directory
>>> b) Bean defined with @XmlRootElement(name = "notice")
>>> c) POM file has camel-jaxb (camel 2.2.0)
>>> d) route is as per ETL
>>> example:
>> from("file:../../../data/notice?noop=true").convertBodyTo(Notice.class).to("jpa:au.com.interlated.server.domain.Notice");
>>> e) camel-maven-plugin has no particular arguments
>>> f) maven-assembly-plugin used to build a jar file:
>>>
>>>
>>>            <plugin>
>>>                <artifactId>maven-assembly-plugin</artifactId>
>>>                <configuration>
>>>                    <descriptorRefs>
>>>
>>  <descriptorRef>jar-with-dependencies</descriptorRef>
>>>                    </descriptorRefs>
>>>                    <archive>
>>>                        <manifest>
>>>                            <!--
>>>
>>>  <mainClass>org.apache.camel.spring.Main</mainClass>
>>>                            -->
>>>
>>>  <mainClass>au.com.interlated.server.AhsMessageRouter</mainClass>
>>>                        </manifest>
>>>                    </archive>
>>>                </configuration>
>>>                <executions>
>>>                    <execution>
>>>                        <phase>package</phase>
>>>                        <goals>
>>>                            <goal>single</goal>
>>>                        </goals>
>>>                    </execution>
>>>                </executions>
>>>            </plugin>
>>>
>>>
>>> g) I can see jaxb in the resulting jar file:    0  02-10-10 23:25
>>> org/apache/camel/converter/jaxb/
>>>
>>>
>>>
>>> Thanks
>>> John
>>>
>>>
>>>
>>> --
>>> http://interlated.com.au
>>> 0434 996 607
>>>
>>
>>
>> --
>> Claus Ibsen
>> Apache Camel Committer
>>
>> Author of Camel in Action: http://www.manning.com/ibsen/
>> Open Source Integration: http://fusesource.com
>> Blog: http://davsclaus.blogspot.com/
>> Twitter: http://twitter.com/davsclaus
>>
> 
> 
> 


Mime
View raw message