title: HTTP Status 500 - Request processing failed; nested exception is org.springframework.web.bind.annotation.support.HandlerMethodInvocationException
body: <p>I need you help me for this error in my code</p>
  
  <pre><code>form
  
  &lt;form:form action="user.do" method="POST" commandName="user"&gt;
                      &lt;div class="form-group"&gt;
                          &lt;form:input path="userName" cssClass="form-control "/&gt;
                      &lt;/div&gt;
                      &lt;div class="form-group"&gt;
                          &lt;form:password path="password" cssClass="form-control "/&gt;
                      &lt;/div&gt;
                      &lt;div class="form-group"&gt;
                          &lt;input type="submit" name="action" value="Login" class="btn btn-info col-xs-12"/&gt;
                      &lt;/div&gt;
  
                      &lt;/form:form&gt;
  </code></pre>
  
  <p>Controller</p>
  
  <pre><code>@RequestMapping(value="/user.do", method=RequestMethod.POST)
  public String doAction(@ModelAttribute Users user,Model model, BindingResult result,Map&lt;String, Object&gt; map)
  {
      Users user1 = new Users();
      user1 = userService.userLogin(user);
      user1 = userService!=null ? user1 : new Users();
  
      map.put("user", userService.userLogin(user));
      return "home";
  }
  </code></pre>
  
  <p>Implementation  Dao Clsss</p>
  
  <pre><code>    package com.hmy.Dao.Impl;
  import org.hibernate.SessionFactory;
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.stereotype.Repository;
  
  import com.hmy.Dao.UsersDao;
  import com.hmy.Model.Users;
  
  @Repository
  public class UsersDaoImpl implements UsersDao {
  
      @Autowired
      private SessionFactory session;
  
      @Override
      public Users userLogin(Users user) {
  
          return (Users)session.getCurrentSession().get(Users.class, user.getUserName());
      }
  
  }
  
  
  [Implementation of Service class][1]
  </code></pre>
  
  <p>Error display when try to submit data</p>
  
  <blockquote>
    <p>HTTP Status 500 - Request processing failed; nested exception is
    org.springframework.web.bind.annotation.support.HandlerMethodInvocationException:
    Failed to invoke handler method [public java.lang.String
    com.hmy.Controller.UsersController.doAction(com.hmy.Model.Users,org.springframework.ui.Model,org.springframework.validation.BindingResult,java.util.Map)];
    nested exception is java.lang.IllegalStateException:
    Errors/BindingResult argument declared without preceding model
    attribute. Check your handler method signature!</p>
    
    <p>type Exception report</p>
    
    <p>message Request processing failed; nested exception is
    org.springframework.web.bind.annotation.support.HandlerMethodInvocationException:
    Failed to invoke handler method [public java.lang.String
    com.hmy.Controller.UsersController.doAction(com.hmy.Model.Users,org.springframework.ui.Model,org.springframework.validation.BindingResult,java.util.Map)];
    nested exception is java.lang.IllegalStateException:
    Errors/BindingResult argument declared without preceding model
    attribute. Check your handler method signature!</p>
    
    <p>description The server encountered an internal error that prevented it
    from fulfilling this request.</p>
    
    <p>exception</p>
    
    <p>org.springframework.web.util.NestedServletException: Request
    processing failed; nested exception is
    org.springframework.web.bind.annotation.support.HandlerMethodInvocationException:
    Failed to invoke handler method [public java.lang.String
    com.hmy.Controller.UsersController.doAction(com.hmy.Model.Users,org.springframework.ui.Model,org.springframework.validation.BindingResult,java.util.Map)];
    nested exception is java.lang.IllegalStateException:
    Errors/BindingResult argument declared without preceding model
    attribute. Check your handler method signature!
      org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:656)
      org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
      org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    root cause</p>
    
    <p>org.springframework.web.bind.annotation.support.HandlerMethodInvocationException:
    Failed to invoke handler method [public java.lang.String
    com.hmy.Controller.UsersController.doAction(com.hmy.Model.Users,org.springframework.ui.Model,org.springframework.validation.BindingResult,java.util.Map)];
    nested exception is java.lang.IllegalStateException:
    Errors/BindingResult argument declared without preceding model
    attribute. Check your handler method signature!
      org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:181)
      org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:426)
      org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:414)
      org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
      org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
      org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
      org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
      org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    root cause</p>
    
    <p>java.lang.IllegalStateException: Errors/BindingResult argument
    declared without preceding model attribute. Check your handler method
    signature!
      org.springframework.web.bind.annotation.support.HandlerMethodInvoker.resolveHandlerArguments(HandlerMethodInvoker.java:327)
      org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:171)
      org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:426)
      org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:414)
      org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
      org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
      org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
      org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
      org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    note The full stack trace of the root cause is available in the Apache
    Tomcat/8.0.28 logs.</p>
  </blockquote>
  
  <p>So i need your help to solve this, Because it my fisrt time to try Spring with hibernate</p>