title: Wiring an ExecutorService in with Spring factory-method
body: <p>I have a simple class that has a property called "executor" in which I'd like to wire in an <code>ExecutorService</code>, with spring 3.0. I followed the documentation which states you simply use the factory class (in this case <code>Executors</code>) and supply factory-method to create your service. However, when I try to wire the resulting bean into my class, it seems that spring thinks the class type is java.lang.String instead of ExecutorService.</p>
  
  <p>I have no idea what I'm doing wrong here. I seem to be correct if I look at the documentation, but perhaps I need to somehow indicate the resulting class of calling the factory method?</p>
  
  <p>Here's the error:</p>
  
  <blockquote>
    <p>java.lang.IllegalStateException: Cannot convert value of type [java.lang.String] to required type [java.util.concurrent.ExecutorService] for property 'executor': no matching editors or conversion strategy found</p>
  </blockquote>
  
  <p>With this configuration:</p>
  
  <pre><code>&lt;bean id="taskManager" class="examples.TaskManager"&gt;
      &lt;property name="executor"&gt;
          &lt;idref local="executorService" /&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  &lt;bean id="executorService" class="java.util.concurrent.Executors" 
    factory-method="newSingleThreadExecutor" 
    destroy-method="shutdownNow" /&gt;
  </code></pre>
  
  <p>and this class:</p>
  
  <pre><code>public class TaskManager {
  
      private ExecutorService executor;
  
      public ExecutorService getExecutor() {
          return executor;
      }
  
      public void setExecutor(ExecutorService executor) {
          this.executor = executor;
      }   
  }
  </code></pre>