title: java.lang.IllegalArgumentException: Property 'dataSource' is required Spring JDBC
body: <p>i am not sure what i am doing wrong , i am trying to execute a stored-procedure using jdbc call but when ever i execute its hitting exception 
  java.lang.IllegalArgumentException: Property 'dataSource' is required  .</p>
  
  <p>Controller Class:</p>
  
  <pre><code>    @Controller
      public class GpsController {
  
          @RequestMapping(value="h",method=RequestMethod.POST)    
          public void show(@ModelAttribute("PredefinedPath") PredefinedPath predefinedPath)
  
          { 
  
              PredefinedPathService service=new PredefinedPathService();
              //passing dto obj to service
               boolean res=   service.savePredefinedPath(predefinedPath);
          }
  </code></pre>
  
  <p>DTO CLASS:</p>
  
  <pre><code>    //Entity Class Getters and setters
      public class PredefinedPath {
  
          public int getPredefinedPath_Id() {
              return PredefinedPath_Id;
          }
          public void setPredefinedPath_Id(int predefinedPath_Id) {
              PredefinedPath_Id = predefinedPath_Id;
          }
          public String getPredefinedPath_Name() {
              return PredefinedPath_Name;
          }
          public void setPredefinedPath_Name(String predefinedPath_Name) {
              PredefinedPath_Name = predefinedPath_Name;
          }
          public String getSource() {
              return Source;
          }
          public void setSource(String source) {
              Source = source;
          }
          public String getDestination() {
              return Destination;
          }
          public void setDestination(String destination) {
              Destination = destination;
          }
          public String getEstimate_km() {
              return Estimate_km;
          }
          public void setEstimate_km(String estimate_km) {
              Estimate_km = estimate_km;
          }
          public double getSource_Latitude() {
              return Source_Latitude;
          }
          public void setSource_Latitude(double source_Latitude) {
              Source_Latitude = source_Latitude;
          }
          public double getSource_Longtitude() {
              return Source_Longtitude;
          }
          public void setSource_Longtitude(double source_Longtitude) {
              Source_Longtitude = source_Longtitude;
          }
          public double getDestination_Latitude() {
              return Destination_Latitude;
          }
          public void setDestination_Latitude(double destination_Latitude) {
              Destination_Latitude = destination_Latitude;
          }
          public double getDestination_Longtitude() {
              return Destination_Longtitude;
          }
          public void setDestination_Longtitude(double destination_Longtitude) {
              Destination_Longtitude = destination_Longtitude;
          }
          public String getEffectiveFromDate() {
              return EffectiveFromDate;
          }
          public void setEffectiveFromDate(String effectiveFromDate) {
              EffectiveFromDate = effectiveFromDate;
          }
          public String getEffectiveToDate() {
              return EffectiveToDate;
          }
          public void setEffectiveToDate(String effectiveToDate) {
              EffectiveToDate = effectiveToDate;
          }
          public int getStatus_Id() {
              return Status_Id;
          }
          public void setStatus_Id(int status_Id) {
              Status_Id = status_Id;
          }
          private int PredefinedPath_Id;
          private String PredefinedPath_Name;
          private String Source;
          private String Destination;
          private String Estimate_km;
          private double Source_Latitude;
          private double Source_Longtitude;
          private double Destination_Latitude;
          private double Destination_Longtitude;
          private String EffectiveFromDate;
          private String EffectiveToDate;
          private int Status_Id;
  
  
      }
  </code></pre>
  
  <p>DAO CLASS :</p>
  
  <pre><code>        import javax.sql.DataSource;
  
          import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
          import org.springframework.jdbc.core.namedparam.SqlParameterSource;
          import org.springframework.jdbc.core.simple.SimpleJdbcCall;
          import com.Ss.App.dto.PredefinedPath;
  
          public class PredefinedPathDaoImpl {
  
               private DataSource dataSource;
                 private SimpleJdbcCall jdbcCall;
  
                 public void setDataSource(DataSource dataSource) {
                    this.dataSource = dataSource;
  
                 }
  
  
            public boolean savePredefined(PredefinedPath predefinedPathDto)
              { 
  
  
                      System.out.println("INSIDE DAO");
                      this.jdbcCall =  new SimpleJdbcCall(dataSource).withProcedureName("PredefinedPath_Insert");
                      SqlParameterSource sqlParameterSource = new MapSqlParameterSource()
                      .addValue("PredefinedPath_Name", predefinedPathDto.getPredefinedPath_Name())
                      .addValue("Source", predefinedPathDto.getSource())
                      .addValue("Destination", predefinedPathDto.getDestination())
                      .addValue("Source_Latitude", predefinedPathDto.getSource_Latitude())
                      .addValue("Source_Longtitude", predefinedPathDto.getSource_Longtitude())
                      .addValue("Destination_Latitude", predefinedPathDto.getDestination_Latitude())
                      .addValue("Destination_Longtitude", predefinedPathDto.getDestination_Longtitude())
                      .addValue("EffectiveFromDate",null)
                      .addValue("EffectiveToDate",null)
                      .addValue("Status_Id", 4);
                      jdbcCall.execute(sqlParameterSource);
  
  
  
  
  
  
                  return true;
              }
          }  
  </code></pre>
  
  <p>Service Class:</p>
  
  <pre><code>    import com.Ss.App.dto.PredefinedPath;
  
      import com.Ss.App.model.dao.PredefinedPathDaoImpl;
  
      public class PredefinedPathService {
  
           PredefinedPathDaoImpl predefinedPathDao=new PredefinedPathDaoImpl();
           public boolean savePredefinedPath(PredefinedPath predefinedPathdto)
           {
  
              boolean result=predefinedPathDao.savePredefined(predefinedPathdto);
  
              return result;
  
  
           }
      }
  </code></pre>
  
  <p>Spring Config: </p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
      &lt;beans xmlns="http://www.springframework.org/schema/beans"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
          xmlns:context="http://www.springframework.org/schema/context"
          xmlns:mvc="http://www.springframework.org/schema/mvc"
          xsi:schemaLocation="http://www.springframework.org/schema/mvc 
            http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
            http://www.springframework.org/schema/beans 
            http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
            http://www.springframework.org/schema/context 
            http://www.springframework.org/schema/context/spring-context-3.0.xsd"&gt;
  
  
      &lt;context:component-scan base-package="com.Ss.App"&gt;&lt;/context:component-scan&gt; 
  
              &lt;bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
              &lt;property name="prefix" value="/view/"/&gt;
              &lt;property name="suffix" value=".jsp"/&gt;
  
              &lt;/bean&gt;
               &lt;!-- Definition for studentJDBCTemplate bean --&gt;
         &lt;bean id="PredefinedPathDaoImpl"  class="com.Ss.App.model.dao.PredefinedPathDaoImpl"&gt;
            &lt;property name="DataSource"  ref="dataSource" /&gt;    
         &lt;/bean&gt;
          &lt;bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"&gt;
              &lt;property name="driverClassName"  value="com.microsoft.sqlserver.jdbc.SQLServerDriver"&gt;&lt;/property&gt;
              &lt;property name="url" value="jdbc:sqlserver://localhost:1433;DatabaseName=test"&gt;&lt;/property&gt;
              &lt;property name="username" value="sa"&gt;&lt;/property&gt;
              &lt;property name="password" value="pass"&gt;&lt;/property&gt;
          &lt;/bean&gt;
  
  
  
  
      &lt;mvc:annotation-driven /&gt;
  
  
  
              &lt;/beans&gt;   
  </code></pre>
  
  <p>web.config</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
      &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" version="3.1"&gt;
        &lt;display-name&gt;SpringAngularjs&lt;/display-name&gt;
        &lt;welcome-file-list&gt;
          &lt;welcome-file&gt;page.jsp&lt;/welcome-file&gt;
  
        &lt;/welcome-file-list&gt;
        &lt;servlet&gt;
        &lt;servlet-name&gt;spring&lt;/servlet-name&gt;
        &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
        &lt;/servlet&gt;
  
        &lt;servlet-mapping&gt;
        &lt;servlet-name&gt;spring&lt;/servlet-name&gt;
        &lt;url-pattern&gt;/&lt;/url-pattern&gt;
        &lt;/servlet-mapping&gt;
      &lt;/web-app&gt;       
  </code></pre>