title: Getting error "Target object of type ...has no eligible methods for handling Messages"
body: <p>I am using spring integration in my project. 
  I have recently added the below  method for my service activator <code>PQMessageHandler</code>:</p>
  
  <pre><code>@SuppressWarnings("unchecked")
      public Message&lt;?&gt; getDatabaseProductName(Message&lt;?&gt; inMessage){
          Message&lt;?&gt; outMessage = null;
          String databaseProductName = null;
          try {
              //get the database name. 
              databaseProductName = DataSourceUtils.getConnection(rd).getMetaData().getDatabaseProductName();
          } catch (SQLException e) {
              throw new RuntimeException(e);
          }
          Document mainDom = XmlParserUtil.convertString2Document((String)inMessage.getPayload());
          //include database name in the response xml
          Element databaseName = mainDom.getRootElement().addElement("databaseName");
          databaseName.setText(databaseProductName);
          MessageHeaders inMsgHdrs = inMessage.getHeaders();
  
          MessageBuilder&lt;?&gt; msgBuilder = MessageBuilder.withPayload(mainDom.asXML()).copyHeaders(inMsgHdrs);
          outMessage= msgBuilder.build();
          logger.debug("\n ************************** External System Request Message ********************* \n");
          logger.debug(outMessage);
          logger.debug("\n ******************************************************************************** \n");
  
          return outMessage;      
  
      }
  </code></pre>
  
  <p>I have configured the code that calls the above service activator is as follows:</p>
  
  <pre><code>&lt;int:channel id="PQPutUserBAInformation-Add-DatabaseProductName" /&gt;
      &lt;int:service-activator input-channel="PQPutUserBAInformation-Add-DatabaseProductName"
                             output-channel="PQPutUserBAInformation-Database-Router"
                             ref="msgHandler" 
                             method="getDatabaseProductName" /&gt;
  
      &lt;int:router input-channel="PQPutUserBAInformation-Database-Router" default-output-channel="PQPutUserBAInformation-Default-InsertUserId-Channel" resolution-required="false" expression="#xpath(payload, '//databaseName').toLowerCase().contains('db2')"&gt;
          &lt;int:mapping value="true" channel="PQPutUserBAInformation-DB2-Request"/&gt;
      &lt;/int:router&gt;
  </code></pre>
  
  <p>The above code works fine without any issues in the development environment. Weirdly when I deploy my application in client environment, I am getting the following error:</p>
  
  <blockquote>
    <p>2017-04-10 10:41:50,525 INFO  [org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler] (ServerService Thread Pool -- 65) Shutting down ExecutorService 'taskScheduler'</p>
    
    <p>2017-04-10 10:41:50,526 ERROR [org.springframework.web.context.ContextLoader] (ServerService Thread Pool -- 65) Context initialization failed: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.config.ConsumerEndpointFactoryBean#345': Cannot resolve reference to bean 'org.springframework.integration.config.ServiceActivatorFactoryBean#61' while setting bean property 'handler'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.config.ServiceActivatorFactoryBean#61': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalArgumentException: Target object of type [class com.dsths.cs.awd.jobs.PQMessageHandler] has no eligible methods for handling Messages.
                at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:329) [spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]</p>
  </blockquote>
  
  <p>I am assuming that the recent changes are causing the issue. The log message is not clearly saying which service activator is causing the issue.</p>
  
  <p>I googled about the error and confirmed that 
  1) There is no misspelled method attribute in the  
  configuration
  2)The method is public 
  3)I haven't defined <code>requires-reply="true"</code> attribute in the configuration.</p>
  
  <p>Any thoughts on troubleshooting the issue?</p>