Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 85522 invoked from network); 17 Sep 2007 22:21:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Sep 2007 22:21:32 -0000 Received: (qmail 19650 invoked by uid 500); 17 Sep 2007 22:21:20 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 19595 invoked by uid 500); 17 Sep 2007 22:21:20 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 19585 invoked by uid 99); 17 Sep 2007 22:21:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Sep 2007 15:21:20 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [64.233.162.235] (HELO nz-out-0506.google.com) (64.233.162.235) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Sep 2007 22:21:20 +0000 Received: by nz-out-0506.google.com with SMTP id m22so995979nzf for ; Mon, 17 Sep 2007 15:20:58 -0700 (PDT) Received: by 10.142.213.9 with SMTP id l9mr1273085wfg.1190067657073; Mon, 17 Sep 2007 15:20:57 -0700 (PDT) Received: by 10.142.79.2 with HTTP; Mon, 17 Sep 2007 15:20:57 -0700 (PDT) Message-ID: Date: Mon, 17 Sep 2007 18:20:57 -0400 From: "James Carman" Sender: jcarman@carmanconsulting.com To: "Jakarta Commons Users List" Subject: Re: BeanUtils setProperty IllegalArgumentException: Null property value for property In-Reply-To: <001201c7f970$c3962980$6803a8c0@tcs.com.ve> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <7777616F99DFD94BB454020F2BB70B300555940F@EXNJMB70.nam.nsroot.net> <001201c7f970$c3962980$6803a8c0@tcs.com.ve> X-Google-Sender-Auth: 40f1ab29d9b24d14 X-Virus-Checked: Checked by ClamAV on apache.org So, I'd say you need to do this... public class Address { private City city =3D new City(); ... } On 9/17/07, N=E9stor Bosc=E1n wrote: > I don't see anywhere in the code that PropertyUtils access a Digester. In > the code it clearly shoes that it access an attribute, if it's null an > exception is thrown. It does not check or tries to instantiate the object= . > > Regards, > > N=E9stor Bosc=E1n > > -----Mensaje original----- > De: jcarman@carmanconsulting.com [mailto:jcarman@carmanconsulting.com] En > nombre de James Carman > Enviado el: Lunes, 17 de Septiembre de 2007 03:25 p.m. > Para: Jakarta Commons Users List > Asunto: Re: BeanUtils setProperty IllegalArgumentException: Null property > value for property > > Who said anything about Digester? > > On 9/17/07, Madisetti, Sumesh wrote: > > Your digester rules files should be as follows - > > > > The following digester file will parse the content below and return you= an > Address object with a City object inside it and the name of it set to NYC= . > > > > > > > > > > > > > > propertyname=3D"name" /> > > > > > > > > > > > > Content- > >
> > NYC > >
> > > > > > -----Original Message----- > > From: N=E9stor Bosc=E1n [mailto:nestor.boscan@tcs.com.ve] > > Sent: Friday, September 14, 2007 9:38 PM > > To: user@commons.apache.org > > Subject: BeanUtils setProperty IllegalArgumentException: Null property > > value for property > > > > Hi > > > > I suppose that this has been asked and answered before but I can't find > the solution. I have some classes like this: > > > > public class Address { > > private City city; > > > > public City getCity () { return city; } > > > > public void setCity (City city) { this.city =3D city; } } > > > > public class City { > > private String name; > > > > public String getName ( return name; } > > > > public void setName (String name) { this.name =3D name; } } > > > > And I'm trying to set the city's name like this: > > > > PropertyUtils.setProperty (address, "city.name", "Toronto"); > > > > And I'm getting IllegalArgumentException: Null property value for 'name= '. > > > > Now I checked the 1.6 BeanUtils code and it doesn't instantiate the cla= ss > anywhere. Is this something that BeanUtils does?. If not does anybody kno= ws > another technology that can do this? > > > > Regards, > > > > N=E9stor Bosc=E1n > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org > > For additional commands, e-mail: user-help@commons.apache.org > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org > For additional commands, e-mail: user-help@commons.apache.org > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org > For additional commands, e-mail: user-help@commons.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org