title: SEVERE: Servlet.service() for servlet Spring MVC Dispatcher Servlet threw exception
body: <p><strong>&lt;--My Console Output-></strong></p>
  
  <pre><code>  09:04:10,286 DEBUG SessionBindingConversationManager:99 - Unlocking conversation 1
    09:04:11,479 DEBUG FlowHandlerMapping:108 - Mapping request with URI   '/arcindex/app/main' to flow with id 'main'
    09:04:11,481 DEBUG FlowExecutorImpl:161 - Resuming flow execution with key 'e1s2
    09:04:11,481 DEBUG SessionBindingConversationManager:67 - Locking conversation 1
    09:04:11,482 DEBUG DefaultFlowExecutionRepository:106 - Getting flow execution with  key 'e1s2'
    09:04:11,482 DEBUG FlowDefinitionRegistryImpl:59 - Getting FlowDefinition with id 'main'
    09:04:11,487 DEBUG ConditionalFlowExecutionListenerLoader:87 - Loaded [2] of possible      2 listeners for this execution request for flow 'main', the listeners to attach are    list[org.springframework.webflow.persistence.JpaFlowExecutionListener@4145582,  org.springframework.faces.webflow.FlowFacesContextLifecycleListener@52f9cbe5]
    09:04:11,488 DEBUG FlowExecutionImpl:249 - Resuming in  org.springframework.webflow.mvc.servlet.MvcExternalContext@4614ac54
    09:04:11,489 DEBUG Flow:636 - Restoring [FlowVariable@450ae3fb name = 'user', valueFactory = [BeanFactoryVariableValueFactory@4dfd9726 type = UserEntity]]
  
  
   ez09:04:11,581 DEBUG FlowExecutionImpl:590 - Attempting to handle   [org.springframework.webflow.execution.FlowExecutionException: Exception thrown in state 'SignUp' of flow 'main'] with root cause [java.lang.NullPointerException]
     09:04:11,582 DEBUG FlowExecutionImpl:611 - Rethrowing unhandled flow execution exception
  
     09:04:11,582 DEBUG SessionBindingConversationManager:99 - Unlocking conversation 1
      16.Ara.2013 09:04:11 org.apache.catalina.core.StandardWrapperValve invoke
      16.Ara.2013 05:02:56 org.apache.catalina.core.StandardWrapperValve invoke
      SEVERE: Servlet.service() for servlet Spring MVC Dispatcher Servlet threw exception
      java.lang.NullPointerException
  at
      com.gen.spring.services.imp.userServiceImp.checkAvailable(userServiceImp.java:65)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  at
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  at java.lang.reflect.Method.invoke(Method.java:597)
  at org.apache.el.parser.AstValue.invoke(AstValue.java:191)
  at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
  at org.primefaces.component.behavior.ajax.AjaxBehaviorListenerImpl.processAjaxBehavior(AjaxBehaviorListenerImpl.java:47)
  at javax.faces.event.AjaxBehaviorEvent.processListener(AjaxBehaviorEvent.java:113)
  at javax.faces.component.behavior.BehaviorBase.broadcast(BehaviorBase.java:106)
  at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:760)
  at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
  at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
  at org.springframework.faces.webflow.FlowLifecycle.invokePhase(FlowLifecycle.java:127)
  at org.springframework.faces.webflow.FlowLifecycle.execute(FlowLifecycle.java:70)
  at org.springframework.faces.webflow.JsfView.processUserEvent(JsfView.java:120)
  at org.springframework.webflow.engine.ViewState.handleEvent(ViewState.java:226)
  at org.springframework.webflow.engine.ViewState.resume(ViewState.java:196)
  at org.springframework.webflow.engine.Flow.resume(Flow.java:545)
  at org.springframework.webflow.engine.impl.FlowExecutionImpl.resume(FlowExecutionImpl.java:258)
  at org.springframework.webflow.executor.FlowExecutorImpl.resumeExecution(FlowExecutorImpl.java:169)
  at org.springframework.webflow.mvc.servlet.FlowHandlerAdapter.handle(FlowHandlerAdapter.java:183)
  at org.springframework.faces.webflow.JsfFlowHandlerAdapter.handle(JsfFlowHandlerAdapter.java:48)
  at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
  at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
  at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
  at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:643)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
  at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
  at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
  at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
  at java.lang.Thread.run(Thread.java:662)
      05:03:09,792 DEBUG FlowHandlerMapping:108 - Mapping request with URI '/arcindex/app/main' to flow with id 'main'
      05:03:09,793 DEBUG FlowExecutorImpl:161 - Resuming flow execution with key 'e1s2
      05:03:09,793 DEBUG SessionBindingConversationManager:67 - Locking conversation 1
      05:03:09,794 DEBUG DefaultFlowExecutionRepository:106 - Getting flow execution with key 'e1s2'
      05:03:09,794 DEBUG FlowDefinitionRegistryImpl:59 - Getting FlowDefinition with id 'main'
      05:03:09,800 DEBUG ConditionalFlowExecutionListenerLoader:87 - Loaded [2] of possible 2 listeners for this execution request for flow 'main', the listeners to attach are list[org.springframework.webflow.persistence.JpaFlowExecutionListener@10bfb545, org.springframework.faces.webflow.FlowFacesContextLifecycleListener@1a15cd9a]
      05:03:09,800 DEBUG FlowExecutionImpl:249 - Resuming in org.springframework.webflow.mvc.servlet.MvcExternalContext@5ab04589
      05:03:09,801 DEBUG Flow:636 - Restoring [FlowVariable@3157457b name = 'user', valueFactory = [BeanFactoryVariableValueFactory@5892a78b type = UserEntity]]mgk
      05:03:09,846 DEBUG FlowExecutionImpl:590 - Attempting to handle [org.springframework.webflow.execution.FlowExecutionException: Exception thrown in state 'SignUp' of flow 'main'] with root cause [java.lang.NullPointerException]
      05:03:09,846 DEBUG FlowExecutionImpl:611 - Rethrowing unhandled flow execution exception
      05:03:09,847 DEBUG SessionBindingConversationManager:99 - Unlocking conversation 1
  </code></pre>
  
  <p><strong>&lt;-My SignUp.xhtml Username input and check with error-></strong></p>
  
  <pre><code>    &lt;h:panelGroup&gt;
  &lt;h:outputText value="Kullanıcı Adı:" /&gt;
  &lt;h:outputText style="color:red" value="*  " /&gt;
  &lt;/h:panelGroup&gt;
  &lt;p:inputText id="kad" label="Kullanıcı Adı" value="#{user.kad}"
  required="true" title="Kullanıcı Adını giriniz!"&gt;
  &lt;f:validateLength minimum="2" /&gt;
  &lt;p:ajax event="keyup" update="kadMsj" global="false" listener="#
      {userService.checkAvailable}" /&gt;
  &lt;/p:inputText&gt;
  &lt;h:panelGroup&gt;
  </code></pre>
  
  <p><strong>&lt;- Check Available -></strong></p>
  
  <pre><code>    public boolean checkAvailable(AjaxBehaviorEvent event) {
  
              InputText inputText = (InputText) event.getSource();
              String value = (String) inputText.getValue();
              System.out.print(value);
              boolean available = userDao.checkAvailable(value);
  
              if (!available) {
                      FacesMessage message = constructErrorMessage(null, String.format(getMessageBundle().getString("userExistsMsg"), value));
                      getFacesContext().addMessage(event.getComponent().getClientId(), message);
              } else {
                      FacesMessage message = constructInfoMessage(null, String.format(getMessageBundle().getString("userAvailableMsg"), value));
                      getFacesContext().addMessage(event.getComponent().getClientId(), message);
              }
  
              return available;
      }
  </code></pre>
  
  <p><strong>&lt;- WEB.XML -></strong></p>
  
  <pre><code>     &lt;servlet&gt;
              &lt;servlet-name&gt;Resources Servlet&lt;/servlet-name&gt;
              &lt;servlet-class&gt;org.springframework.js.resource.ResourceServlet&lt;/servlet-class&gt;
              &lt;load-on-startup&gt;0&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
  
      &lt;servlet-mapping&gt;
              &lt;servlet-name&gt;Resources Servlet&lt;/servlet-name&gt;
              &lt;url-pattern&gt;/resources/*&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;servlet&gt;
              &lt;servlet-name&gt;Spring MVC Dispatcher Servlet&lt;/servlet-name&gt;
              &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
              &lt;init-param&gt;
                      &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
                      &lt;param-value&gt;&lt;/param-value&gt;
              &lt;/init-param&gt;
              &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
  
      &lt;servlet-mapping&gt;
              &lt;servlet-name&gt;Spring MVC Dispatcher Servlet&lt;/servlet-name&gt;
              &lt;url-pattern&gt;/app/*&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;servlet&gt;
              &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
              &lt;servlet-class&gt;javax.faces.webapp.FacesServlet&lt;/servlet-class&gt;
              &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
  
      &lt;servlet-mapping&gt;
              &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
              &lt;url-pattern&gt;*.jsf&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>I'm trying to make a signup page. I want to get primefaces input values and write them  database . When I enter a value  there was no exception until one character,but also still doesn't worked. With increasing number characters,the error refreshes itself. How do I resolve this error?</p>