title: ServletException: No adapter for handler just for one service
body: <p>I'm getting this exception for just one service. I have two service in the controller and the other one works perfectly.</p>
  
  <pre><code>@Controller
  @RequestMapping("/document")
  public class DocumentController {
  
  @Autowired
  private PdfService pdfService;
  
  @Autowired
  private MailService mailService;
  
  @Autowired
  private TransaccionService transaccionService;
  
  @Autowired
  private UsuarioService usuarioService;
  
  @RequestMapping(value = "/export", method = RequestMethod.GET)
  public void exportAutorizacion(HttpServletRequest request){
      TicketAutorizacionDto ticket = (TicketAutorizacionDto) request.getSession().getAttribute("ticketAutorizacion");
      this.pdfService.createPdf(ticket);
  
  }
  
  @RequestMapping(value = "/email/{numeroAutorizacion}", method = RequestMethod.PUT)
  public Boolean enviarMail(@PathVariable("numeroAutorizacion") Integer numeroAutorizacion,@ModelAttribute EmailsForm mails){
  
      if(mails.getEmails().isEmpty() || numeroAutorizacion == null){
          return false;
      }
  
      UsuarioForm usuarioForm = null;
      Authentication auth = SecurityContextHolder.getContext().getAuthentication();
      try {
          usuarioForm = this.usuarioService.getUsuarioByNombreUsuario(auth.getName());
          TicketAutorizacionDto ticket = this.transaccionService.getTicketAutorizacion(numeroAutorizacion, usuarioForm.getIdBeneficiario());
          return this.mailService.enviarOrdenMedica(ticket, mails.getEmails().toArray(new String[mails.getEmails().size()]));
      } catch (NoExisteBeneficiarioException e) {
          e.printStackTrace();
      }
  
      return false;
      }
  }
  </code></pre>
  
  <p>And the xml:</p>
  
  <pre><code>&lt;mvc:annotation-driven /&gt;
  &lt;tx:annotation-driven /&gt;
  &lt;!-- &lt;context:property-placeholder --&gt;
  &lt;!-- properties-ref="deployProperties" /&gt; --&gt;
  
  &lt;!-- Activates various annotations to be detected in bean classes --&gt;
  &lt;!-- &lt;context:annotation-config /&gt; --&gt;
  
  &lt;!-- Scans the classpath for annotated components that will be auto-registered 
      as Spring beans. For example @Controller and @Service. Make sure to set the 
      correct base-package --&gt;
  &lt;context:component-scan base-package="ar.com.conexia.salud.*" /&gt;
  
  &lt;jpa:repositories base-package="ar.com.conexia.salud.repository" /&gt;
  &lt;!-- Configures the annotation-driven Spring MVC Controller programming 
      model. Note that, with Spring 3.0, this tag works in Servlet MVC only! --&gt;
  &lt;mvc:annotation-driven /&gt;
  &lt;!-- Imports datasource configuration --&gt;
  &lt;!-- &lt;import resource="spring-data.xml" /&gt; --&gt;
  
  &lt;mvc:resources mapping="/resources/**" location="/resources/" /&gt;
  &lt;!-- Imports logging configuration --&gt;
  &lt;!-- &lt;import resource="trace-context.xml" /&gt; --&gt;
  
  
  &lt;!-- &lt;bean id="deployProperties" --&gt;
  &lt;!-- class="org.springframework.beans.factory.config.PropertiesFactoryBean" --&gt;
  &lt;!-- p:location="/WEB-INF/spring.properties" /&gt; --&gt;
  
  &lt;bean id="multipartResolver"
      class="org.springframework.web.multipart.commons.CommonsMultipartResolver"&gt;
  &lt;/bean&gt;
  
  &lt;bean id="messageSource"
      class="org.springframework.context.support.ResourceBundleMessageSource"&gt;
      &lt;property name="basenames"&gt;
          &lt;list&gt;
              &lt;value&gt;messages&lt;/value&gt;
          &lt;/list&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  &lt;bean id="localeChangeInterceptor" class="ar.com.conexia.salud.interceptors.LanguageInterceptor"&gt;
      &lt;property name="paramName" value="lang" /&gt;
  &lt;/bean&gt;
  &lt;bean id="userDetailsServiceImpl" class="ar.com.conexia.salud.security.UserServiceImpl"&gt;
  
  &lt;/bean&gt;
  &lt;bean id="localeResolver"
      class="org.springframework.web.servlet.i18n.SessionLocaleResolver"&gt;
      &lt;property name="defaultLocale" value="es" /&gt;
  &lt;/bean&gt;
  &lt;mvc:interceptors&gt;
      &lt;bean class="ar.com.conexia.salud.interceptors.LanguageInterceptor"&gt;
          &lt;property name="paramName" value="lang" /&gt;
      &lt;/bean&gt;
  &lt;/mvc:interceptors&gt;
  
  
  &lt;bean id="transactionTrasmitter"
      class="ar.com.conexia.salud.transmitter.COMEITransactionTransmitter"&gt;
      &lt;property name="serverPort" value="2012" /&gt;
      &lt;property name="timeout" value="300000" /&gt;
      &lt;property name="password" value="conexia" /&gt;
      &lt;property name="serverIP" value="192.168.0.97" /&gt;
      &lt;!-- &lt;property name="serverIP" value="localhost"/&gt; --&gt;
      &lt;property name="msjKey" value="C:\\mySrvKeystore" /&gt;
      &lt;!-- &lt;property name="msjKey" value="/usr/local/mySrvKeystore" /&gt; --&gt;
  &lt;/bean&gt;
  
  &lt;bean id="basePath" class="java.lang.String"&gt;
      &lt;constructor-arg
          value="#{systemProperties['catalina.home']}/webapps/COMEI_Beneficiario" /&gt;
  &lt;/bean&gt;
  
  &lt;bean id="pdfGenerator" class="ar.com.conexia.generator.PdfGenerator"&gt;
      &lt;constructor-arg value="/WEB-INF/classes/reports/" /&gt;
      &lt;constructor-arg value="C://reports//" /&gt;
  &lt;/bean&gt;
  
  &lt;bean id="emailConfiguration" class="ar.com.conexia.salud.dto.EmailConfigurationDto"&gt;
      &lt;property name="port" value="25" /&gt;
      &lt;property name="auth" value="true" /&gt;
      &lt;property name="starttls" value="true" /&gt;
      &lt;property name="host" value="192.168.0.10" /&gt;
      &lt;property name="user" value="smtpcomei@conexia.com.ar" /&gt;
      &lt;property name="pass" value="" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p></p>
  
  <p>Any ideas?</p>
  
  <p>Thanks!</p>
  
  <p><strong>EDIT:</strong> here is the complete stack of the exception thrown.</p>
  
  <pre><code>SEVERE: El Servlet.service() para el servlet [dispatcher] en el contexto con ruta [/COMEI_Beneficiario] lanzó la excepción [No adapter for handler [public java.lang.Boolean ar.com.conexia.salud.controller.DocumentController.enviarMail(java.lang.Integer)]: Does your handler implement a supported interface like Controller?] con causa raíz
  javax.servlet.ServletException: No adapter for handler [public java.lang.Boolean ar.com.conexia.salud.controller.DocumentController.enviarMail(java.lang.Integer)]: Does your handler implement a supported interface like Controller?
      at org.springframework.web.servlet.DispatcherServlet.getHandlerAdapter(DispatcherServlet.java:1077)
      at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:870)
      at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:827)
      at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
      at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311)
      at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
      at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
      at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
      at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:101)
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
      at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
      at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
      at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
      at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
      at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:182)
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
      at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
      at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
      at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173)
      at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
      at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      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:241)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(SiteMeshFilter.java:129)
      at com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:77)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
      at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      at java.lang.Thread.run(Thread.java:722)
  </code></pre>