Return-Path: X-Original-To: apmail-camel-dev-archive@www.apache.org Delivered-To: apmail-camel-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 85560F22D for ; Wed, 24 Apr 2013 05:51:33 +0000 (UTC) Received: (qmail 19065 invoked by uid 500); 24 Apr 2013 05:51:33 -0000 Delivered-To: apmail-camel-dev-archive@camel.apache.org Received: (qmail 18700 invoked by uid 500); 24 Apr 2013 05:51:29 -0000 Mailing-List: contact dev-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list dev@camel.apache.org Received: (qmail 18678 invoked by uid 99); 24 Apr 2013 05:51:28 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Apr 2013 05:51:28 +0000 X-ASF-Spam-Status: No, hits=2.8 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ch007m@gmail.com designates 209.85.160.51 as permitted sender) Received: from [209.85.160.51] (HELO mail-pb0-f51.google.com) (209.85.160.51) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Apr 2013 05:51:23 +0000 Received: by mail-pb0-f51.google.com with SMTP id rr4so352462pbb.24 for ; Tue, 23 Apr 2013 22:51:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=WBW8d7AYcJvVLwEe312WsdTwWbiQQTVWn+VH/YXk/KI=; b=zzVO9ejoBAsC9ZM+kkZZ3tcP/BmeyFYLzoRaDruCLQX9y2Qvqp+/W5GEnB7ki3mFzi r7MK8GxMpG5iO41nGHE4CXqcCaYLIMxxAXoT7hfZEsv5cgyGOJGzs/x8rpVfBfKOrB3v TIZwV9MhoCy8dkoCUmiTAf/5emdLbj2cgIHOVHqWR6+WrVSlqWwB4YJPQ++wM0JYkXWz 7ZvBdzAhcNhJ+JQ9CENydAC5rYp5yMvlBkFqdkBIjTrLWR5EVJr0ThbyoOPKs4y6ppWL uMKXE1syFnhLza37bXHJOM2pjwcUxX4etYJU466t9J9M1b0/rG0/amEPByln43KpTobW YgTg== MIME-Version: 1.0 X-Received: by 10.68.209.162 with SMTP id mn2mr45112359pbc.190.1366782661562; Tue, 23 Apr 2013 22:51:01 -0700 (PDT) Received: by 10.70.73.66 with HTTP; Tue, 23 Apr 2013 22:51:01 -0700 (PDT) In-Reply-To: <1366731193994-5731369.post@n5.nabble.com> References: <1366731193994-5731369.post@n5.nabble.com> Date: Wed, 24 Apr 2013 07:51:01 +0200 Message-ID: Subject: Re: when two Pojo class annotated with @CsvRecord in same package, camel goes wrong From: Charles Moulliard To: "dev@camel.apache.org" Content-Type: multipart/alternative; boundary=047d7b111b9b071e1604db14e37d X-Virus-Checked: Checked by ClamAV on apache.org --047d7b111b9b071e1604db14e37d Content-Type: text/plain; charset=ISO-8859-1 I have tested the example project that you provide and it works (test passed) ;-) On Tue, Apr 23, 2013 at 5:33 PM, lost_in wrote: > i follow <>'s chapter3/order demo, i confused with > following situation: > > > 1) i create simple Pojo class in same package with PurchaseOrder.java > > //content as follows: > > @CsvRecord(separator = ",", crlf = "UNIX") > public class Person { > @DataField(pos = 1) //because this field's pos ==1, it make > PurchaseOrder.name ==null > private String name2; > > public String getName2() { > return name2; > } > > public void setName(String name2) { > this.name2 = name2; > } > > @Override > public String toString() { > return String.format("%s", name2); > } > > } > > 2)this is my RouteBuilder defination: > > public class MainEntry extends CamelTestSupport { > > public static class MyBean { > public void convert(Exchange exchange) { > Object object = exchange.getIn().getBody(); > //at this point,Object isInstanceOf PurchaseOrder > but object.name ==null > System.out.println("==============="); > } > } > > @EndpointInject(uri = "mock:end") > protected MockEndpoint toEndpoint; > > @Produce(uri = "direct:start") > protected ProducerTemplate template; > > @Test > public void test_marshal() throws Exception { > // must set expect before call template.sendBody() > toEndpoint.expectedMessageCount(1); > template.sendBody("Camel in Action,39.95,1"); > toEndpoint.assertIsSatisfied(); > } > > @Override > protected RouteBuilder createRouteBuilder() throws Exception { > // return super.createRouteBuilder(); > return new RouteBuilder() { > > @Override > public void configure() throws Exception { > from("direct:start").unmarshal() > .bindy(BindyType.Csv, PurchaseOrder.class) > //use class instead of > package name > .bean(new MyBean()) > .to("mock:end"); > } > }; > } > } > > my question is in MyBean.convert method, object.name ==null ????? > 3)attachment is my test project. > > is it a bug or there is some thing wrong with my code? > how to workaround it? > any answer is appreciate camelbug.zip > > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/when-two-Pojo-class-annotated-with-CsvRecord-in-same-package-camel-goes-wrong-tp5731369.html > Sent from the Camel Development mailing list archive at Nabble.com. > -- Charles Moulliard Apache Committer / Sr. Enterprise Architect (RedHat) Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com --047d7b111b9b071e1604db14e37d--