commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Néstor Boscán <>
Subject BeanUtils setProperty IllegalArgumentException: Null property value for property
Date Sat, 15 Sep 2007 01:38:09 GMT
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) { = city; }
public class City {
  private String name;
  public String getName ( return name; }
  public void setName (String name) { = name; }
And I'm trying to set the city's name like this:
PropertyUtils.setProperty (address, "", "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 class
anywhere. Is this something that BeanUtils does?. If not does anybody knows
another technology that can do this?
Néstor Boscán

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message