title: Spring 3 Request processing failed; nested exception is java.lang.NullPointerException
body: <p>I am having difficulties while trying to launch my app, i looked for my mistake for a couple of days but i am stuck somewhere in the code and asking for your assistance
  Thanks</p>
  
  <p><strong>SingleTransactionsController</strong></p>
  
  <pre><code>@Controller
  public class SingleTransactionsController {
  private SingleTransactionsService singleTransactionsService;
  
  
  @RequestMapping(value="/disableUser/{sicil}", method=RequestMethod.GET)
  public String disableUser(@PathVariable String sicil, Model model){
      singleTransactionsService.disableUser(sicil);
      model.addAttribute("message", sicil);
      return "hello";
  }
  
  }
  </code></pre>
  
  <p><strong>SingleTransactionsDAO</strong></p>
  
  <pre><code>public interface SingleTransactionsDAO {
  
  public void disableUser(String sicil);
  
  }
  </code></pre>
  
  <p><strong>SingleTransactionsDAOImpl</strong></p>
  
  <pre><code>@Repository
  public class SingleTransactionsDAOImpl implements SingleTransactionsDAO{
  
  @Override
  public void disableUser(String sicil) {
      System.out.println(sicil);
  }
  }
  </code></pre>
  
  <p><strong>SingleTransactionsService</strong></p>
  
  <pre><code>public interface SingleTransactionsService {
  public void disableUser(String sicil);
  }
  </code></pre>
  
  <p><strong>SingleTransactionsServiceImpl</strong></p>
  
  <pre><code>@Service
  public class SingleTransactionsServiceImpl implements SingleTransactionsService{
  
  @Autowired
  private SingleTransactionsDAO singleTransactionsDAO;
  
  
  public void disableUser(String sicil) {
      singleTransactionsDAO.disableUser(sicil);
  
  }
  
  
  public SingleTransactionsDAO getSingleTransactionsDAO() {
      return singleTransactionsDAO;
  }
  
  
  public void setSingleTransactionsDAO(SingleTransactionsDAO singleTransactionsDAO) {
      this.singleTransactionsDAO = singleTransactionsDAO;
  }
  </code></pre>
  
  <p><strong>mvc-dispatcher-servlet.xml</strong></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:p="http://www.springframework.org/schema/p"
     xmlns:context="http://www.springframework.org/schema/context"
     xmlns:mvc="http://www.springframework.org/schema/mvc"
     xmlns:aop="http://www.springframework.org/schema/aop"
     xmlns:tx="http://www.springframework.org/schema/tx"
     xsi:schemaLocation="
     http://www.springframework.org/schema/beans
     http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
     http://www.springframework.org/schema/context
     http://www.springframework.org/schema/context/spring-context-3.2.xsd
     http://www.springframework.org/schema/mvc
     http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
     http://www.springframework.org/schema/aop
     http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
     http://www.springframework.org/schema/tx
     http://www.springframework.org/schema/tx/spring-tx-3.2.xsd"&gt;
  
  &lt;context:annotation-config /&gt;
  &lt;mvc:resources mapping="/css/**" location="/css/" /&gt;
  &lt;mvc:resources mapping="/images/**" location="/images/" /&gt;
  &lt;!-- Load only @Controller annotated controllers --&gt;
  &lt;context:component-scan base-package="com.akbank.controller"
      use-default-filters="false"&gt;
      &lt;context:include-filter expression="org.springframework.stereotype.Controller"
          type="annotation" /&gt;
  &lt;/context:component-scan&gt;
  &lt;mvc:annotation-driven /&gt;
  
          &lt;bean     class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"&gt;&lt;/bean&gt;
  &lt;bean     class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"&gt;    &lt;/bean&gt;
  
  &lt;bean
      class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
      &lt;property name="prefix"&gt;
          &lt;value&gt;/WEB-INF/pages/&lt;/value&gt;
      &lt;/property&gt;
      &lt;property name="suffix"&gt;
          &lt;value&gt;.jsp&lt;/value&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  &lt;bean id="singleTransactionsDAO" class="com.akbank.dao.SingleTransactionsDAOImpl"&gt;    &lt;/bean&gt;
  &lt;bean id="singleTransactionsService" class="com.akbank.service.SingleTransactionsServiceImpl"&gt;&lt;/bean&gt;
  </code></pre>
  
  <p> </p>
  
  <p>when I try to navigate for instance /disableUser/Tugrul  I get the following error:</p>
  
  <pre><code>HTTP Status 500 - Request processing failed; nested exception is     java.lang.NullPointerException
  
  type Exception report
  
  message Request processing failed; nested exception is java.lang.NullPointerException
  
  description The server encountered an internal error that prevented it from fulfilling     this request.
  
  exception
  
  org.springframework.web.util.NestedServletException: Request processing failed; nested     exception is java.lang.NullPointerException
  org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.jav    a:948)
  org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:827)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
  org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
  root cause
  
  java.lang.NullPointerException
  com.akbank.controller.SingleTransactionsController.disableUser(SingleTransactionsCon    troller.java:24)
  sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25    )
  java.lang.reflect.Method.invoke(Method.java:597)
  org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandle    rMethod.java:219)
  org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(Invoc    ableHandlerMethod.java:132)
  org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.    invokeAndHandle(ServletInvocableHandlerMethod.java:104)
  org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.i    nvokeHandleMethod(RequestMappingHandlerAdapter.java:745)
  org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.h    andleInternal(RequestMappingHandlerAdapter.java:686)
  org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(Abstr    actHandlerMethodAdapter.java:80)
  org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:    925)
  org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:8    56)
  org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.jav    a:936)
  org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:827)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
  org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
  note The full stack trace of the root cause is available in the Apache Tomcat/7.0.50     logs.
  </code></pre>
  
  <p>I am using 3.2.6.RELEASE version</p>