title: Failed to convert property value of type 'java.lang.String' to required type 'java.util.Date' for property 'start_time'
body: <p>i get this error...</p>
  
  <blockquote>
    <p>Failed to convert property value of type 'java.lang.String' to required type 'java.util.Date' for property 'start_time'</p>
  </blockquote>
  
  <p>please help me solve this..</p>
  
  <p>controller.java</p>
  
  <pre><code>package com.rsmagsys.rs.registration.doctorSchedule;
  
  import java.util.Locale;
  
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.stereotype.Controller;
  import org.springframework.ui.Model;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.RequestMethod;
  import org.springframework.web.bind.annotation.ResponseBody;
  
  import com.rsmagsys.rs.Utility.JsonResponse;
  import com.rsmagsys.rs.registration.model.StaffScheduleForm;
  
  import lombok.extern.slf4j.Slf4j;
  
  @Controller
  public class DoctorScheduleController {
  
  @Autowired
  private DAODoctorScheduleForm dao;
  
  @RequestMapping(value = "registration/doctor-schedule", method = RequestMethod.GET)
  public String registerInPatient(Locale locale, Model model) {
      return "registration/doctorSchedule/doctorScheduleListing";
  }
  
  @RequestMapping(value = "registration/doctor-schedule/save", method = RequestMethod.POST)
  public @ResponseBody JsonResponse save(Model model, StaffScheduleForm ssf) {
      JsonResponse jr = new JsonResponse();
      try {
          StaffScheduleForm staffSchedule = dao.saveDataDoctorSchedule (ssf);
          jr.setStatus("success");
          jr.setResult(staffSchedule);
      } catch (RuntimeException e){
          e.printStackTrace();
          jr.setStatus("error");
      }
      return jr;
  }
  }
  </code></pre>
  
  <p>DAOForm.java</p>
  
  <pre><code>package com.rsmagsys.rs.registration.doctorSchedule;
  
  import java.util.Date;
  
  import javax.sql.DataSource;
  
  import org.jfree.util.Log;
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.jdbc.core.JdbcTemplate;
  import org.springframework.stereotype.Repository;
  
  import com.rsmagsys.rs.registration.model.StaffScheduleForm;
  import com.rsmagsys.rs.registration.outpatient.DAORegOutPatientForm;
  
  import lombok.extern.slf4j.Slf4j;
  
  @Slf4j
  @Repository
  public class DAODoctorScheduleForm {
  
  @Autowired
  private JdbcTemplate jdbcTemplate;
  
  public void setDataSource(DataSource dataSource) {
      this.jdbcTemplate = new JdbcTemplate(dataSource);
  }
  
  public StaffScheduleForm saveDataDoctorSchedule(StaffScheduleForm ssf){
  
      Date start_time = this.jdbcTemplate.queryForObject(
              "SELECT to_char(nextval('rsmagsys.seq_start'))",Date.class);
      Date end_time = this.jdbcTemplate.queryForObject(
              "SELECT to_char(nextval('rsmagsys.seq_end'))",Date.class);
  
      log.info("start_time" + start_time);
      log.info("end_time" + end_time);
  
  
      ssf.setStart_time(start_time);
      ssf.setEnd_time(end_time);
  
      this.jdbcTemplate.update(
              "insert into rsmagsys.staff_schedule(start_time, end_time)  values(?,?)",
              ssf.getStart_time(), ssf.getEnd_time()
      );
  
  
  
  
      return ssf;
  }
  
  }
  </code></pre>
  
  <p>javascript.jsp</p>
  
  <pre><code>$.ajax({url : '${pageContext.request.contextPath}/registration/out-patient/save',
              type : 'POST',
              data : {
                  id_no : id_no,
                  name : name,
                  dob : dob,
                  visit_date_time : visit_date_time
              },
              success : function(data) {
                  toastr.success("Record save successfully!");
  
                  var patient_id = data.result.patient_id;
                  var mrn_no = data.result.mrn_no;
                  var episode_id = data.result.episode_id;
                  var que_no = data.result.que_no;
                  var name_upper = data.result.name;
  
                  console.log(name_upper);
                  console.log(patient_id);
                  console.log(mrn_no);
                  console.log(episode_id);
                  console.log(que_no);
  
                  document.getElementById("patient_name").value = name_upper;
                  document.getElementById("patient_id").value = patient_id;
                  document.getElementById("mrn_no").value = mrn_no;
                  document.getElementById("episode_id").value = episode_id;
                  document.getElementById("que_no").value = que_no;
              },
              failure : function(data) {
                  toastr
                          .error("There's an error while saving your record.");
              }
          });
  </code></pre>
  
  <p>html</p>
  
  <pre><code>&lt;!-- Modal --&gt;
  &lt;div id="doctorSchedulePopup" class="modal fade" role="dialog"&gt;
  &lt;div class="modal-dialog modal-lg"&gt;
  
      &lt;!-- Modal content--&gt;
      &lt;div class="modal-content"&gt;
          &lt;div class="modal-header"&gt;
              &lt;button type="button" class="close" data-dismiss="modal"&gt;&amp;times;&lt;/button&gt;
              &lt;h4 class="modal-title" style="color:white;"&gt;Create Doctor Schedule&lt;/h4&gt;
          &lt;/div&gt;
  
  
          &lt;div class="modal-body"&gt;
              &lt;form class="form-horizontal"&gt;
  
                  &lt;div class="form-group"&gt;
                      &lt;label class="col-md-3 control-label-popup"&gt;Department&lt;/label&gt;
                          &lt;div class="col-sm-4"&gt;
                              &lt;select class="form-control" id="department"&gt;
                                  &lt;option&gt;Please Select&lt;/option&gt;
                              &lt;/select&gt;
                              &lt;span id="department_error" class="error" style="display: none"&gt;*Department Is Required&lt;/span&gt;
                          &lt;/div&gt;
  
                      &lt;label class="col-md-2 control-label-popup"&gt;Date Start&lt;/label&gt;
                          &lt;div class="col-sm-3"&gt;
                              &lt;div class="input-group"&gt;
                                  &lt;span class="input-group-addon"&gt;
                                      &lt;span class="fa fa-calendar"&gt;&lt;/span&gt;
                                  &lt;/span&gt; 
                                  &lt;input type="text" class="form-control datepicker" value="2015-11-01" id="date_start" onSelect=""&gt;
                              &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
  
                  &lt;div class="form-group"&gt;
                      &lt;label class="col-md-3 control-label-popup"&gt;
                          &lt;a href="#" data-toggle="modal" data-target="#"&gt;Doctor Name&lt;/a&gt;
                      &lt;/label&gt;
                      &lt;div class="col-sm-4"&gt;
                          &lt;input type="text" class="form-control" id="doctor_name"&gt;
                          &lt;span id="doctor_name_error" class="error" style="display: none"&gt;*Doctor Name Is Required&lt;/span&gt;
                      &lt;/div&gt;
  
                      &lt;label class="col-md-2 control-label-popup"&gt;Date End&lt;/label&gt;
                          &lt;div class="col-sm-3"&gt;
                              &lt;div class="input-group"&gt;
                                  &lt;span class="input-group-addon"&gt;
                                      &lt;span class="fa fa-calendar"&gt;&lt;/span&gt;
                                  &lt;/span&gt; 
                                  &lt;input type="text" class="form-control datepicker" value="2015-11-01" id="date_end" onSelect=""&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                  &lt;/div&gt;
  
                  &lt;div class="form-group"&gt;
                      &lt;label class="col-md-2 control-label-popup"&gt;&lt;/label&gt;
                          &lt;div class="col-sm-3"&gt;&lt;/div&gt;
  
                      &lt;div class="form-group"&gt;
                          &lt;label class="col-md-3 control-label text-left"&gt;Time Start/End&lt;/label&gt;
                          &lt;div class="col-md-2"&gt;
                              &lt;input type="text" class="form-control" id="start_time"/&gt; 
                                  &lt;span class="help-block"&gt;&lt;/span&gt;
                                  &lt;span id="start_time_error" class="error" style="display: none"&gt;*Time Start Is Required&lt;/span&gt;
                          &lt;/div&gt;
  
                          &lt;div class="col-md-2"&gt;
                              &lt;input type="text" class="form-control" id="end_time"/&gt; 
                                  &lt;span class="help-block"&gt;&lt;/span&gt;
                                  hh:mm
                                  &lt;span id="end_time_error" class="error" style="display: none"&gt;*Time End Is Required&lt;/span&gt;
                          &lt;/div&gt;
  
                      &lt;/div&gt;
                  &lt;/div&gt;
  
                  &lt;div class="form-group"&gt;
                      &lt;label class="col-md-3 control-label-popup"&gt;
                      &lt;/label&gt;
                      &lt;div class="col-sm-4"&gt;
                      &lt;/div&gt;
  
                      &lt;label class="col-md-2 control-label text-left"&gt;New Schedule Date&lt;/label&gt;
                          &lt;div class="col-sm-3"&gt;
                              &lt;div class="input-group"&gt;
                                  &lt;span class="input-group-addon"&gt;
                                      &lt;span class="fa fa-calendar"&gt;&lt;/span&gt;
                                  &lt;/span&gt; 
                                  &lt;input type="text" class="form-control datepicker" value="2015-11-01" id="schedule_date" onSelect=""&gt;
                                  &lt;span id="schedule_date_error" class="error" style="display: none"&gt;*Schedule Date Is Required&lt;/span&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                  &lt;/div&gt;
  
              &lt;/form&gt;
  
  
              &lt;div class="panel panel-default"&gt;
                  &lt;div class="panel-body"&gt;
                          &lt;button class="btn btn-primary pullleft"&gt;Add&lt;/button&gt;
                          &lt;button class="btn btn-primary pullleft"&gt;Remove&lt;/button&gt;
  
                          &lt;button class="btn btn-primary pull-right"  onclick="save()"&gt;Create Schedule&lt;/button&gt;
                          &lt;button class="btn btn-primary pull-right"&gt;Copy from Selected Date&lt;/button&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
  
              &lt;div class="panel panel-default"&gt;
                  &lt;div class="panel-heading" style="background-color:#5F9EA0;color:white;"&gt;Selected records pending
                      creation..&lt;/div&gt;
                  &lt;div class="panel-body"&gt;
                      &lt;div class="row"&gt;
                          &lt;div class="col-md-12"&gt;
                              &lt;div class="table-responsive" style="margin-top: 10px;"&gt;
                                  &lt;table class="table table-striped table-hover table-bordered"&gt;
                                      &lt;thead&gt;
                                          &lt;tr class="success"&gt;
                                              &lt;th class="text-center"&gt;&lt;/th&gt;
                                              &lt;th class="text-center"&gt;&lt;/th&gt;
                                              &lt;th class="text-center"&gt;Date&lt;/th&gt;
                                              &lt;th class="text-center"&gt;Staff ID&lt;/th&gt;
                                              &lt;th class="text-center"&gt;Doctor Name&lt;/th&gt;
                                              &lt;th class="text-center"&gt;Time Start&lt;/th&gt;
                                              &lt;th class="text-center"&gt;Time End&lt;/th&gt;
                                          &lt;/tr&gt;
                                      &lt;/thead&gt;
                                      &lt;tbody&gt;
  
                                          &lt;tr&gt;
                                              &lt;td&gt;1&lt;/td&gt;
                                              &lt;td class="text-center"&gt;  &lt;input type="checkbox" class="icheckbox" value=""&gt;&lt;/td&gt;
                                              &lt;td&gt;&lt;/td&gt;
                                              &lt;td&gt;&lt;/td&gt;
                                              &lt;td&gt;&lt;/td&gt;
                                              &lt;td&gt;&lt;/td&gt;
                                              &lt;td&gt;&lt;/td&gt;
                                          &lt;/tr&gt;
                                      &lt;/tbody&gt;
                                  &lt;/table&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
  
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>