title: why is my form throwing a No Bean Specified error in Struts on submit?
body: <p>I have a dynaAction form setup that is submitted to a lookupDispatchAction. The problem is that the page loads fine but on submit the application throws a <strong>[BeanUtils.populate] with root cause java.lang.IllegalArgumentException: No bean specified</strong> that for the moment I cannot seem to catch the stack dump doesn't indicate where in code this is being caused. It was only through undoing the modified code that I was able to identify the cause as the part of code in the jsp printed below. At the moment I am trying to see if I can get more info from the debugger but so far research has hinted at probable causes none of which has helped.
  Below are the relevant parts of code (with the stack trace skipped to keep this post reasonable:
  struts-config.xml:</p>
  
  <pre><code> &lt;form-bean name="MonthlyInvoiceForm" type="com.myapp.form.accounting.MonthlyInvoiceForm"&gt;
                  &lt;form-property name="idMonthInvoice" type="java.lang.Long"/&gt;
                  &lt;form-property name="creationDate" type="java.util.Date"/&gt;
                  &lt;form-property name="adresse" type="com.myapp.model.component.CustomerAddress"/&gt;
                  &lt;form-property name="extras" type="com.myapp.accounting.customer.ExtraInvoiceForm[]"/&gt;
                  &lt;form-property name="creationLoc" initial="Home" type="java.lang.String"/&gt;
                  &lt;form-property name="totalHT" type="java.math.BigDecimal"/&gt;
                  &lt;form-property name="totalTTC" type="java.math.BigDecimal"/&gt;
                  &lt;form-property name="prefix" type="java.lang.Integer"/&gt;
                  &lt;form-property name="number" type="java.lang.String"/&gt;
                  &lt;form-property name="person" type="java.lang.String"/&gt;
                  &lt;form-property name="strTotalHT" type="java.lang.String"/&gt;
                  &lt;form-property name="strTotalTTC" type="java.lang.String"/&gt;
                  &lt;form-property name="customerName" type="java.lang.String"/&gt;
                  &lt;form-property name="strIdCustomer" type="java.lang.String"/&gt;
                  &lt;form-property name="strCreationDate" type="java.lang.String"/&gt;
          &lt;/form-bean&gt; 
  </code></pre>
  
  <p>And the form itself has the following setup:</p>
  
  <pre><code>public class MonthlyInvoiceForm extends BaseDynaForm implements ModelForm&lt;MonthlyInvoice&gt;{
  
  @Override
  public void reset(ActionMapping mapping, HttpServletRequest request) {
      ExtraInvoiceForm[] extraForms = new ExtraInvoiceForm[1];
      this.set("extras", extraForms);
  
      CustomerAddress caddress = new CustomerAddress();
      this.set("adresse", caddress);
  
      BigDecimal tmpTRD = new BigDecimal(BigInteger.ZERO);
      this.set("totalHT", tmpTRD);
  
  
      BigDecimal tmpTRM = new BigDecimal(BigInteger.ZERO);
      this.set("totalTTC", tmpTRM);
  }
  
  @Override
  public ActionErrors validate(ActionMapping actionMapping, HttpServletRequest request) {
      ActionErrors errors = new ActionErrors();
  
      ExtraInvoiceForm[] extraInvoiceForms = (ExtraInvoiceForm[]) this.get("extras");
      LinkedList&lt;String&gt; credits = new LinkedList&lt;String&gt;(); 
      LinkedList&lt;String&gt; reductions = new LinkedList&lt;String&gt;(); 
  
      for(ExtraInvoiceForm eif: extraInvoiceForms) {
          eif.validate(errors);
  
          if(!eif.isBlank()) {
              if(eif.getOperation().equals(ExtraCostInvoice.CREDITOPERATION)) {
                  if(credits.contains(eif.getDescription()))
                      errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("invoice.duplicate.credit", eif.getDescription()));
                  else
                      credits.add(eif.getDescription());
              } else {
                  if(reductions.contains(eif.getDescription()))
                      errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("invoice.duplicate.reduction", eif.getDescription()));
                  else
                      reductions.add(eif.getDescription());
              }
          }
      }
  
  
      if (StringUtils.isEmpty(this.get("strCreationDate").toString()))
          errors.add("strCreationDate",new ActionError("field.required"));
  
      if (StringUtils.isEmpty(this.get("creationLoc").toString()))
          errors.add("creationLoc",new ActionError("field.required"));
  
  
  
      return errors;
  }
  
  @Override
  public void populateModel(MonthlyInvoice model) throws Exception {
      DateTimeFormatter fmt = DateTimeFormat.forPattern("dd MMMM yyyy");
      DateTime crDate;
  
  
      crDate = new DateTime(fmt.withLocale(Locale.FRENCH).parseDateTime(this.get("strCreationDate").toString()));
      this.set("creationDate",BaseForm.jodaToSqlDate(crDate));
  
      PropertyUtils.copyProperties(model, this);
  }
  </code></pre>
  
  <p>The jsp:</p>
  
  <pre><code>&lt;html:form action="/toInvoiceCustomerMissions"&gt; 
  /*This is the part of code in the jsp which causes the error*/
  &lt;c:forEach var="extras" items="${MonthlyInvoiceForm.map.extras}" varStatus="vs"&gt;
                      &lt;tr&gt;
                          &lt;td align="center"&gt;
                                                      &lt;html:text indexed="true" name="extras" property="description" size="40" maxlength="100" /&gt;&lt;/td&gt;
                          &lt;td align="center"&gt;
                                                      &lt;html-el:radio indexed="true" name="extras" property="operation"
                              value="&lt;%= ExtraCostInvoice.CREDITOPERATION %&gt;"
                              onclick="setPercentSymbol(${vs.index}, false); calcCustomerAmount();" /&gt;Déduction
                                                      &lt;html-el:radio indexed="true" name="extras" property="operation"
                              value="&lt;%= ExtraCostInvoice.REDUCTIONOPERATION %&gt;"
                              onclick="setPercentSymbol(${vs.index}, true); calcCustomerAmount();" /&gt;Réduction
                                                      &lt;html-el:radio indexed="true" name="extras" property="operation"
                              value="&lt;%= ExtraCostInvoice.SUPPLEMENTOPERATION %&gt;"
                              onclick="setPercentSymbol(${vs.index}, false); calcCustomerAmount();" /&gt;Supplément
                          &lt;/td&gt;
                          &lt;td align="center"&gt;
                                                      &lt;html:text indexed="true" name="extras"
                              property="strAmount" size="7" maxlength="6" onchange="calcCustomerAmount();" /&gt;
                                                      &lt;input type="text" id="extraSymbol&lt;c:out value='${vs.index}'/&gt;" value="&amp;euro;"
                              readonly="readonly" size="1" style="border: none"&gt;
                                                  &lt;/td&gt;
                      &lt;/tr&gt;
                  &lt;/c:forEach&gt;
  &lt;/html:form&gt;
  </code></pre>
  
  <p>Thanks in advance</p>