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.

Reply via email to