commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Syed Muhammad Humayun" <smhuma...@iblgrp.com>
Subject Unknown property 'property1'?
Date Fri, 13 Nov 2009 05:38:22 GMT
Hi,

I defined a bean:

public class MyBean {
	private String property1;
	public String getProperty1 () { return this.property1; }
	public void setProperty1 (String property1) { this.property1 =
property1; } }

And, when I call following on 'MyBean';

...
MyBean mybean = new MyBean();
PropertyUtils.getProperty(mybean, "property1"); ...

I get following exception :

java.lang.NoSuchMethodException: Unknown property 'property1'
	at
org.apache.commons.beanutils.PropertyUtilsBean.getSimpleProperty(PropertyUti
lsBean.java:1122)
	at
org.apache.commons.beanutils.PropertyUtilsBean.getNestedProperty(PropertyUti
lsBean.java:686)
	at
org.apache.commons.beanutils.PropertyUtilsBean.getProperty(PropertyUtilsBean
.java:715)
	at
org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:29
0)

Why is this so? Why PropertyUtils is unable to see getter/setters for this
property?


-----------------------------------------------
S M Humayun
Software Architect, IBL Group
-----------------------------------------------
Cell : 92.321.8707783
Email (Official) : smhumayun@iblgrp.com
Email (Personal) : smhumayun@gmail.com
Google Talk : smhumayun@gmail.com
MSN : smhumayun2001@hotmail.com
Yahoo : humayun_reports@yahoo.com
Skype : smhumayun
AIM : syedmohdhumayun
Blog : http://smhumayun.blogspot.com
LinkedIn : http://www.linkedin.com/in/smhumayun
Facebook : http://www.facebook.com/smhumayun 
Twitter : http://twitter.com/smhumayun
-----------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message