camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Newbie Pls help: ETL Example Modification Doesn't work
Date Sat, 25 Sep 2010 08:06:05 GMT
Hi

I have attached a modified example which works. Take a look at it.


On Fri, Sep 24, 2010 at 7:50 PM, Claus Ibsen <claus.ibsen@gmail.com> wrote:
> Use the method option on the class endpoint to tell Camel which method to invoke
> http://camel.apache.org/class
>
> class:xxx?method=foo
>
>
> On Fri, Sep 24, 2010 at 7:22 PM, shaun.barker@rulefinancial.com
> <shaun.barker@rulefinancial.com> wrote:
>>
>>
>> Ok - done some more experimentation and am more confused than ever if I try
>> to convert from a person to the jpa endpoint it works fine (and uses the
>> customertransformer @Converter annotated method. However if you try to
>> convert it to the class end point (the 2nd example below) the transformer is
>> ignored and you get a weird exception stating the method call was ambiguous
>> .
>>
>> BTW - you cannot run the routes below at the same time - you need to comment
>> out one and then swap it around ;)
>>
>>
>> //this works
>>        from("file:src/data?noop=true")
>>            .convertBodyTo(PersonDocument.class)
>>            .to("jpa:org.apache.camel.example.etl.CustomerEntity");
>> //this doesn't work
>>        from("file:src/data?noop=true")
>>        .convertBodyTo(PersonDocument.class)
>>        .to("class:org.apache.camel.example.etl.CustomerEntity");
>>
>>
>> Exception if you use the class endpoint:
>>
>> mel Thread 0 - file://src/data] GenericFileOnCompletion        ERROR Caused
>> by: [org.apache.camel.component.bean.AmbiguousMethodCallException -
>> Ambiguous method invocations possible: [public void
>> org.apache.camel.example.etl.CustomerEntity.pcCopyKeyFieldsFromObjectId(java.lang.Object),
>> public void
>> org.apache.camel.example.etl.CustomerEntity.pcCopyKeyFieldsToObjectId(java.lang.Object)].
>> Exchange[GenericFileMessage with body: Person[user: james]]]
>> org.apache.camel.component.bean.AmbiguousMethodCallException: Ambiguous
>> method invocations possible: [public void
>> org.apache.camel.example.etl.CustomerEntity.pcCopyKeyFieldsFromObjectId(java.lang.Object),
>> public void
>> org.apache.camel.example.etl.CustomerEntity.pcCopyKeyFieldsToObjectId(java.lang.Object)].
>> Exchange[GenericFileMessage with body: Person[user: james]]
>>
>> --
>> View this message in context: http://camel.465427.n5.nabble.com/Newbie-Pls-help-ETL-Example-Modification-Doesn-t-work-tp2852839p2853007.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>
>
>
> --
> 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
>



-- 
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