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

         Key: BPM-301
         URL: http://jira.andromda.org/browse/BPM-301
     Project: Bpm4Struts Cartridge
        Type: Bug

    Versions: 3.2, 3.3    
 Environment: 3.3-SNAPSHOT but was also in the 3.2 release.
    Reporter: Jean-Marc Collin
 Assigned to: Wouter Zoons 


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.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.andromda.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

Reply via email to