Hi Nathan,
I had this (or a similar) problem when I tried to populate a date field. It seems that a null or empty String is not a valid value for conversion to a Date. I remember the issue having something to do with BeanUtils' converter not having a default value for Date. Any chance this is the case?
Colin
Nathan Maves wrote:
I am getting this error...
java.lang.IllegalArgumentException: argument type mismatch
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(PropertyUti ls.java:1789)
at org.apache.commons.beanutils.BeanUtils.copyProperty(BeanUtils.java:450)
at org.apache.commons.beanutils.BeanUtils.copyProperties(BeanUtils.java: 239)
at reporting.viewer.presentation.actions.ReportDispatch.update(ReportDispat ch.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39)
...
When I copy a DynaActionForm to my class. Strange thing is that I just did the reverse and it worked.
Code that works ...
Report report = (Report) tree.findNode(node); DynaActionForm dForm = (DynaActionForm)form; BeanUtils.copyProperties(dForm, report);
Code that breaks ...
DynaActionForm dForm = (DynaActionForm) form; Report report = new Report(); BeanUtils.copyProperties(report, dForm);
Here is the form bean ...
<form-bean name="reportForm" type="org.apache.struts.action.DynaActionForm">
<form-property name="name" type="java.lang.String"/>
<form-property name="id" type="java.lang.String"/>
<form-property name="description" type="java.lang.String"/>
<form-property name="archive" type="java.lang.Boolean" initial="false"/>
<form-property name="brioJobId" type="java.lang.String"/>
<form-property name="type" type="java.lang.String"/>
<form-property name="postedDate" type="java.lang.String"/>
<form-property name="frequency" type="java.lang.String"/>
</form-bean>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]