title: Spring Test / JUnit problem - unable to load application context
body: <p>I am using Spring for the first time and must be doing something wrong.  I have a project with several Bean implementations and now I am trying to create a test class with Spring Test and JUnit.  I am trying to use Spring Test to inject a customized bean into the test class.</p>
  
  <p>Here is my test-applicationContext.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="............."&gt;
    &lt;bean
      id="MyUuidFactory"
          class="com.myapp.UuidFactory" 
          scope="singleton" &gt;
      &lt;property name="typeIdentifier" value="CLS" /&gt;
    &lt;/bean&gt;
  
    &lt;bean id="ThingyImplTest"
          class="com.myapp.ThingyImplTest"
            scope="singleton"&gt;
       &lt;property name="uuidFactory"&gt;
          &lt;idref local="MyUuidFactory"   /&gt;
       &lt;/property&gt;
  &lt;/bean&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>The injection of MyUuidFactory instance goes along with the following code from within the test class:</p>
  
  <pre><code>private UuidFactory uuidFactory;
  
  public void setUuidFactory(UuidFactory uuidFactory) {
      this.uuidFactory = uuidFactory;
  }
  </code></pre>
  
  <p>However, when I go to run the test (in Eclipse or command line) I get the following error (stack trace omitted for brevity):</p>
  
  <pre><code>Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'MyImplTest' defined in class path resource [test-applicationContext.xml]:
  Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: 
  Failed to convert property value of type 'java.lang.String' to required type 'com.myapp.UuidFactory' for property 'uuidFactory'; 
  nested exception is java.lang.IllegalStateException: 
  Cannot convert value of type [java.lang.String] to required type [com.myapp.UuidFactory] for property 'uuidFactory': 
  no matching editors or conversion strategy found
  </code></pre>
  
  <p>Funny thing is, the Eclipse/Spring XML editor shows errors of I misspell any of the types or idrefs.  If I leave the bean in, but comment out the dependency injection, everything work until I get a NullPointerException while running the test...which makes sense.</p>