title: spring integration-mqtt type converter issue
body: <p>Trying to run the sample spring-integration mqtt project from web. 
  I have imported the mqtt-context in root context. After the war is deployed I am running the RunMqtt.java file. But getting the following issue. If running in standalone mode , the same file does not give any issue.</p>
  
  <p><strong>Stack Trace</strong>
  Creating instance of bean 'startCaseAdapter'
  16:50:54.147 DEBUG [main][org.springframework.beans.BeanUtils] No property editor [org.springframework.integration.mqtt.core.MqttPahoClientFactoryEditor] found for type org.springframework.integration.mqtt.core.MqttPahoClientFactory according to 'Editor' suffix convention
  16:50:54.148 TRACE [main][org.springframework.beans.TypeConverterDelegate] Field [topic] isn't an enum value
  java.lang.NoSuchFieldException: topic
      at java.lang.Class.getField(Class.java:1579)
      at org.springframework.beans.TypeConverterDelegate.attemptToConvertStringToEnum(TypeConverterDelegate.java:336)
      at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:257)
      at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:107)
      at org.springframework.beans.TypeConverterSupport.doConvert(TypeConverterSupport.java:64)
      at org.springframework.beans.TypeConverterSupport.convertIfNecessary(TypeConverterSupport.java:47)
      at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:706)
      at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:185)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1133)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1036)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:505)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:229)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:725)
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)  at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:139)
      at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:83)
      at com.iux.ieg.test.mqtt.RunMqtt.test(RunMqtt.java:24)
      at com.iux.ieg.test.mqtt.RunMqtt.main(RunMqtt.java:46)
  16:50:54.150 TRACE [main][org.springframework.beans.factory.support.DefaultListableBeanFactory] Ignoring constructor [public org.springframework.integration.mqtt.inbound.MqttPahoMessageDrivenChannelAdapter(java.lang.String,java.lang.String,org.springframework.integration.mqtt.core.MqttPahoClientFactory,java.lang.String[])] of bean 'startCaseAdapter': org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'startCaseAdapter': Unsatisfied dependency expressed through constructor argument with index 2 of type [org.springframework.integration.mqtt.core.MqttPahoClientFactory]: Could not convert constructor argument value of type [java.lang.String] to required type [org.springframework.integration.mqtt.core.MqttPahoClientFactory]: Failed to convert value of type 'java.lang.String' to required type 'org.springframework.integration.mqtt.core.MqttPahoClientFactory'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [java.lang.String] to required type [org.springframework.integration.mqtt.core.MqttPahoClientFactory]: no matching editors or conversion strategy found
  16:50:54.150 TRACE [main][org.springframework.beans.TypeConverterDelegate] Converting String to [class [Ljava.lang.String;] using property editor [org.springframework.beans.propertyeditors.StringArrayPropertyEditor@821075]
  16:50:54.150 TRACE [main][org.springframework.beans.TypeConverterDelegate] Field [clientId] isn't an enum value
  java.lang.NoSuchFieldException: clientId
      at java.lang.Class.getField(Class.java:1579)
      at org.springframework.beans.TypeConverterDelegate.attemptToConvertStringToEnum(TypeConverterDelegate.java:336)
      at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:257)
      at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:107)
      at org.springframework.beans.TypeConverterSupport.doConvert(TypeConverterSupport.java:64)
      at org.springframework.beans.TypeConverterSupport.convertIfNecessary(TypeConverterSupport.java:47)
      at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:706)
      at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:185)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1133)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1036)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:505)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:229)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:725)
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
      at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:139)
      at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:83)
      at com.iux.ieg.test.mqtt.RunMqtt.test(RunMqtt.java:24)
      at com.iux.ieg.test.mqtt.RunMqtt.main(RunMqtt.java:46)
  <strong>Configuration</strong>
  <strong>Web-application-config.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:context="http://www.springframework.org/schema/context"
      xsi:schemaLocation="
             http://www.springframework.org/schema/beans
             http://www.springframework.org/schema/beans/spring-beans.xsd
             http://www.springframework.org/schema/context
             http://www.springframework.org/schema/context/spring-context.xsd"&gt;
      &lt;!-- This file will be the root context file for web app. All other context 
          will be imported here --&gt;
      &lt;!-- Security context . Now the spring security with basic authentication 
          implemented. OAuth2 will be implemented --&gt;
      &lt;import resource="security-config.xml" /&gt;
      &lt;!-- rest service call context --&gt;
      &lt;import
          resource="classpath:META-INF/spring/integration/rest/applicationContext-http-int.xml" /&gt;
      &lt;!-- Sftp context --&gt;
      &lt;import
          resource="classpath:META-INF/spring/integration/sftp/SftpInboundReceive-context.xml" /&gt;
      &lt;import
          resource="classpath:META-INF/spring/integration/sftp/SftpOutboundTransfer-poll.xml" /&gt;
      &lt;!-- mqtt context --&gt;
      &lt;import resource="classpath:META-INF/spring/integration/mqtt/mqtt-context.xml" /&gt;
      &lt;!-- Mail Context --&gt;
      &lt;import
          resource="classpath:META-INF/spring/integration/mail/mail-imap-idle-config.xml" /&gt;
      &lt;import
          resource="classpath:META-INF/spring/integration/mail/mail-pop3-config.xml" /&gt;
  
  
      &lt;!--Component scan base package --&gt;
      &lt;context:component-scan base-package="com.iux.ieg" /&gt;
      &lt;!-- All the property configuration moved to parent context file to solve 
          the propert not found exception --&gt;
      &lt;!-- &lt;context:property-placeholder order="1" location="classpath:/sftpuser.properties, 
          classpath:/sftpfile.properties,classpath:/resthttp.properties" ignore-unresolvable="true"/&gt; --&gt;
      &lt;context:property-placeholder order="0"
          location="classpath:/sftpfile.properties" ignore-unresolvable="true" /&gt;
      &lt;context:property-placeholder order="1"
          location="classpath:/sftpuser.properties" ignore-unresolvable="true" /&gt;
      &lt;context:property-placeholder order="2"
          location="classpath:/resthttp.properties" ignore-unresolvable="true" /&gt;
      &lt;context:property-placeholder order="3"
          location="classpath:/mqtt.properties" ignore-unresolvable="true" /&gt;
      &lt;context:property-placeholder order="4"
          location="classpath:/mail.properties" /&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p><strong>mqtt-context.xml</strong></p>
  
  <p>
  http://www.springframework.org/schema/integration <a href="http://www.springframework.org/schema/integration/spring-integration-4.1.xsd" rel="nofollow">http://www.springframework.org/schema/integration/spring-integration-4.1.xsd</a>
          <a href="http://www.springframework.org/schema/beans" rel="nofollow">http://www.springframework.org/schema/beans</a> <a href="http://www.springframework.org/schema/beans/spring-beans-4.1.xsd" rel="nofollow">http://www.springframework.org/schema/beans/spring-beans-4.1.xsd</a>
          <a href="http://www.springframework.org/schema/integration/mqtt" rel="nofollow">http://www.springframework.org/schema/integration/mqtt</a> <a href="http://www.springframework.org/schema/integration/mqtt/spring-integration-mqtt-4.1.xsd" rel="nofollow">http://www.springframework.org/schema/integration/mqtt/spring-integration-mqtt-4.1.xsd</a>
           <a href="http://www.springframework.org/schema/context" rel="nofollow">http://www.springframework.org/schema/context</a>
         <a href="http://www.springframework.org/schema/context/spring-context-4.1.xsd" rel="nofollow">http://www.springframework.org/schema/context/spring-context-4.1.xsd</a>"></p>
  
  <pre><code>&lt;context:property-placeholder 
      location="classpath:/mqtt.properties" ignore-unresolvable="true" /&gt;
  
  
  &lt;!-- intercept and log every message --&gt;
  &lt;int:logging-channel-adapter id="logger"
      level="ERROR" /&gt;
  &lt;int:wire-tap channel="logger" /&gt;
  &lt;!-- Mark the auto-startup="true" for starting MqttPahoMessageDrivenChannelAdapter from configuration  --&gt;
  &lt;int-mqtt:message-driven-channel-adapter
      id="startCaseAdapter" client-id="clientId" url="${mqtt.brokerurl}"
      topics="topic" channel="startCase" auto-startup="true" /&gt;
  &lt;int:channel id="startCase" /&gt;
  
  
  &lt;int:service-activator id="startCaseService"
      input-channel="startCase" ref="mqttCaseService" method="startCase" /&gt;
  
  &lt;bean id="mqttCaseService" class="com.iux.ieg.mqtt.MqttCaseService" /&gt;
  </code></pre>
  
  <p></p>
  
  <p><strong>MqttCaseService.java</strong></p>
  
  <pre><code>import org.apache.log4j.Logger;
  
  
  public class MqttCaseService {
      private static Logger logger = Logger.getLogger(MqttCaseService.class);
  
      public void startCase(String message){
          logger.debug(message);
      }
  
  }
  </code></pre>
  
  <p><strong>RunMqtt.java</strong></p>
  
  <pre><code>public class RunMqtt {
      private static Logger logger = Logger.getLogger(RunMqtt.class);
      //@Test
      public void test() throws MqttException{
          ConfigurableApplicationContext context =
                  new ClassPathXmlApplicationContext("/META-INF/spring/integration/mqtt/mqtt-context.xml");
          logger.debug(context);
          //MqttPahoMessageDrivenChannelAdapter startCaseAdapter = (MqttPahoMessageDrivenChannelAdapter)context.getBean("startCaseAdapter");
          //Uncomment to stop the adapter manually from program
          //startCaseAdapter.start();
          //DefaultMqttPahoClientFactory mqttClient = (DefaultMqttPahoClientFactory)ac.getBean("clientFactory");
          DefaultMqttPahoClientFactory mqttClient = new DefaultMqttPahoClientFactory();
  
          MqttClient mclient = mqttClient.getClientInstance("tcp://*messagebrokerurl*:1883", "JavaSample");
          String data = "This is what I am sending in 2nd attempt";
          MqttMessage mm = new MqttMessage(data.getBytes());
          mm.setQos(1);
          mclient.connect();
          mclient.publish("topic",mm);
          mclient.disconnect();
          //Uncomment to stop the adapter manually from program
          //startCaseAdapter.stop();
      }
  
  
      public static void main(String[] args)  {
          try {
              new RunMqtt().test();
          } catch (MqttException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
  
      }
  </code></pre>