commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "MantissaHotmail" <freddd...@hotmail.com>
Subject [BeanUtils] BeanUtils.populate is not working
Date Tue, 02 Nov 2004 00:07:23 GMT
I'm using the beanUtils in an application.
When I try to populate a bean via "BeanUtil.populate"
I receive an error (the error is in the end of the mail) when the 
application tries to set a specific property:

private java.util.Date date;

public void setDate(Date date)
{
    this.date = date;
}

The value I'm rying to set is a java.sql.Timestamp (that extends 
java.util.Date).
If I change the set method to receive an Objet instead of a Date the 
application works (If I change to timesatamp I still receive the same 
error).


Caused by: java.lang.IllegalArgumentException: argument type mismatch
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at 
org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(PropertyUtils.java:1789)
	at 
org.apache.commons.beanutils.PropertyUtils.setNestedProperty(PropertyUtils.java:1684)
	at 
org.apache.commons.beanutils.PropertyUtils.setProperty(PropertyUtils.java:1713)
	at org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:1019)
	at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808)
	at 
br.com.db.bean.DBBeanInfo$DBBeanResultSetParser.parse(DBBeanInfo.java:125)


[]s
Freddy
----------------------------------------------------------------
Frederico Silva GuimarĂ£es
Tel: (21) 9952-1717
ICQ: 127277403
Email: kid@teccomm.les.inf.puc-rio.br
----------------------------------------------------------------

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


Mime
View raw message