title: Parameter value [1] did not match expected type
body: <p>In the Spring-boot project I try to pass as a request parameter a Date object and get this error:</p>
  
  <pre><code>Parameter value [1] did not match expected type [java.util.Date (n/a)]
  </code></pre>
  
  <p>This is the http-requset that i send:</p>
  
  <pre><code>http://localhost:8080/moneyManager/customer/actionBetweenDates?startDate=2019/07/01&amp;endDate=2019/07/30
  </code></pre>
  
  <p>This is the fuction that trigger in the rest:</p>
  
  <pre><code>@RequestMapping(path="actionBetweenDates", method=RequestMethod.GET)
  public Collection&lt;Action&gt; getActionByDate(@RequestParam Date startDate, @RequestParam Date endDate){
      return customerService.getAllActionBetweenDate(getSession().getId(), startDate, endDate);
  }
  </code></pre>
  
  <p>The function in rest trigger the function in service :</p>
  
  <pre><code>public Collection&lt;Action&gt; getAllActionBetweenDate(long customerId, Date startDate, Date endDate) {
          Collection&lt;MethodPayment&gt; customerMethodPayments = methodPaymentRepository.findByCustomerId(customerId);
          Collection&lt;Action&gt; customerActionByDates = new ArrayList&lt;&gt;();
          for (MethodPayment mp : customerMethodPayments) {
              customerActionByDates
                      .addAll(actionRepository.findByDateBetweenAndMethodPaymentId(mp.getId(), startDate, endDate));
          }
          return customerActionByDates;
      }
  </code></pre>
  
  <p>The function in the service trigger the funcion in the repository:</p>
  
  <pre><code>Collection&lt;Action&gt; findByDateBetweenAndMethodPaymentId(long methodPaymentId, Date startDate, Date endDate);
  </code></pre>
  
  <p>What am I doing wrong?</p>
  
  <p><strong>Updating:</strong></p>
  
  <p>I finded the problem.
  the problem was related to the function found in actionRepository.
  The signature of the function first asks for two dates to compare between them and then id and I gave it opposite values.
  It's clear to me that after I got on it I would have had a problem with the date so the answers did help me.
  Thank you all!</p>