History | Log In     View a printable version of the current page. Get help!  
Issue Details [XML]

Key: BPM-301
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Wouter Zoons
Reporter: Jean-Marc Collin
Votes: (View)
Watchers: (View)
Operations

If you were logged in you would be able to see more operations.
Bpm4Struts Cartridge

Exception when calling an Action issued from a table which element has got id of type Integer

Created: 17/Nov/07 10:18 AM   Updated: 17/Nov/07 10:18 AM
Component/s: None
Affects Version/s: 3.2, 3.3
Fix Version/s: None

Environment: 3.3-SNAPSHOT but was also in the 3.2 release.


 Description   
I've got an ValueObject (VO) with an "id" of type Integer,
I've got a table in a FrontEndView (FEV) displaying a Collection of these VO,
On this FEV I've got several links forwarding to Struts Actions,
Some of these links are issued from the table and applied to selected VO elements :
    - @andromda.presentation.web.action.tablelink="myTable",
    - @andromda.presentation.web.action.type=table,
    - the link between the FEV and the Action has a parameter called "id" of type Integer which represent the selected VO's id.

So with this configuration, Andromda 3.3 generates a Struts validation to verify that "id" is an integer. Here is an extract of the validation.xml file :
    <formset>
        <form name="myForm">
            <field property="id" depends="integer">
                <arg position="0" key="ucgerer.dossier.pret.afficher.lst.dossier.pret.detailler.param.id" />
            </field>
        </form>
    ...

This cause an exception because the Struts validation is searching for a field named "id" which does not exists. The error is the following :
2007-11-15 23:21:05,656 ERROR [org.apache.commons.validator.util.ValidatorUtils] Unknown property 'id'
java.lang.NoSuchMethodException: Unknown property 'id'
at org.apache.commons.beanutils.PropertyUtilsBean.getSimpleProperty(PropertyUtilsBean.java:1122)
at org.apache.commons.beanutils.PropertyUtilsBean.getNestedProperty(PropertyUtilsBean.java:686)
at org.apache.commons.beanutils.PropertyUtilsBean.getProperty(PropertyUtilsBean.java:715)
at org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:290)
at org.apache.commons.validator.util.ValidatorUtils.getValueAsString(ValidatorUtils.java:105)
at org.apache.struts.validator.FieldChecks.validateInteger(FieldChecks.java:363)
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:585)
at org.apache.commons.validator.ValidatorAction.executeValidationMethod(ValidatorAction.java:567)
at org.apache.commons.validator.Field.validateForRule(Field.java:827)
at org.apache.commons.validator.Field.validate(Field.java:906)
at org.apache.commons.validator.Form.validate(Form.java:174)
at org.apache.commons.validator.Validator.validate(Validator.java:367)
at org.apache.struts.validator.ValidatorForm.validate(ValidatorForm.java:110)
at jmcnet.atipa.ksoft.presentation.gererDossierPret.AfficherLstDossierPretGenererAttestationFormImpl.validate(AfficherLstDossierPretGenererAttestationFormImpl.java:162)
at org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:928)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:204)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at org.andromda.presentation.bpm4struts.ActionServlet.doPost(ActionServlet.java:48)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

If the id is a String attribute, the problem disappear.

The solution could be not to generate form validation in the validation.xml file for this kind of action (action on a table).

Thank's in advance.


 All   Comments   Change History      Sort Order:
There are no comments yet on this issue.