You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Efftinge, Sven" <SE...@lohndirekt.de> on 2002/07/05 13:31:33 UTC
IllegalArgumentException: argument type mismatch
Hi,
i have an ActionForm wich has only one Attribute. This Attribute is a
DataObject (a serializable Bean wich presents the Data of an EntityBean).
// ActionForm
public class AccountGruppeForm extends ActionForm {
private AccountGruppeData accountGruppe = new AccountGruppeData();
public AccountGruppeData getAccountGruppe() {
return this.accountGruppe;
}
public void setAccountGruppe(AccountGruppeData accountGruppe) {
this.accountGruppe = accountGruppe;
}
}
The Dataobject AccountGruppeData has 9 fields with a getter and a setter
method.
My Struts-config.xml looks like this (I am using Struts 1.1-b1):
<struts-config>
<!-- ============ Form-Beans ============================== -->
<form-beans>
<form-bean name="AccountGruppeForm"
type="de.lohndirekt.ikarus.web.formbeans.billing.AccountGruppeForm" />
</form-beans>
<!-- ========== Global Forward Definitions ==============================
-->
<global-forwards>
<forward name = "error" path = "/global/error.jsp" />
</global-forwards>
<!-- ========== Action Mapping Definitions ==============================
-->
<action-mappings>
<!-- ========== FibuAccountGruppeEditieren
============================== -->
<action path="/billing/FibuAccountGruppeSuchAction"
type="de.lohndirekt.ikarus.web.actions.billing.FibuAccountGruppeSuchAction"
name="AccountGruppeForm"
scope="request"
validate="false" >
<forward name="failure" path="/AccountGruppeSuchFormular.jsp" />
<forward name="success" path="/FibuAccountGruppeAnsicht.jsp" />
</action>
<action path="/billing/FibuAccountGruppeUpdateAction"
type="de.lohndirekt.ikarus.web.actions.billing.FibuAccountGruppeUpdateAction
"
name="AccountGruppeForm"
scope="request"
validate="true" >
<forward name="failure" path="/FibuAccountGruppeAnsicht.jsp" />
<forward name="success" path="/FibuAccountGruppeAnsicht.jsp" />
</action>
</action-mappings>
</struts-config>
My Problem:
the first Action ("/billing/FibuAccountGruppeSuchAction") works, but when i
send a request to <html:form
action="/billing/FibuAccountGruppeUpdateAction"> I get the following:
javax.servlet.ServletException: BeanUtils.populate
at
org.apache.struts.util.RequestUtils.populate(RequestUtils.java:954)
at
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.j
ava:795)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:244)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1109)
at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:470) ...
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.j
ava:1574)
at
org.apache.commons.beanutils.PropertyUtils.setNestedProperty(PropertyUtils.j
ava:1468)
at
org.apache.commons.beanutils.PropertyUtils.setProperty(PropertyUtils.java:14
98)
at
org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:613)
at
org.apache.struts.util.RequestUtils.populate(RequestUtils.java:952)
at
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.j
ava:795)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:244)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1109)
at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:470) ...
First I open a formular to search for an AccountGruppe by an Id:
without formats AccountGruppeSuchFormular.jsp looks like this:
<html:form action="billing/FibuAccountGruppeSuchAction">
<html:text property="accountGruppe.id"/>
<html:submit/>
</html:form>
the ActionServlet fetches the Data of the AccountGruppe from the EJBServer.
The presentation of the Data is in /FibuAccountGruppeAnsicht.jsp:
<html:form action="billing/FibuAccountGruppeUpdateAction">
<html:text property="accountGruppe.name"/>
<html:text property="accountGruppe.notiz"/>
<html:text property="accountGruppe.guthaben"/>
<html:text property="accountGruppe.datum"/>
<html:text property="accountGruppe.mwStInProzent"/>
<html:text property="accountGruppe.rabattInProzent"/>
<html:submit/>
</html:form>
this works all fine, the error apears when i press the submit button.
I have no Idea where the error could be.
thanks for helping,
Sven
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>