title: Failed to convert property value of type [$Proxy1] to required type
body: <p>I'm working on a java web application that uses the spring framework.
  The application has a class called ServiceA class as shown below.
  And Interface1Impl implements Interface1 and extends Dao2 class.
  In Servicea.do() method, casting x to Dao2 throws an exception saying "Failed to convert property value of type [$Proxy1] to required type [Dao2]"
  How can I fix this so that x can be cast to Dao2? Thanks.</p>
  
  <pre><code>public class ServiceA 
  {
      private final Interface1 x; // injected
  
      public ServiceA(Interface1 aInterface1Impl)
      {
          x = aInterface1Impl;
      }
  
      public string do()
      {
          // Exception: Failed to convert property value of type [$Proxy1] 
          // to required type [Dao2]
          Dao2 dao = (Dao2)x;  
          return dao.run();
      }
  }
  </code></pre>
  
  <p>Here's the partial spring config file</p>
  
  <pre><code>&lt;bean id="dao-t" class="Interface1Impl"&gt;
      &lt;property name="ibatis"    ref="ibatis-main"/&gt;
  &lt;/bean&gt;
  
  &lt;bean id="proj" class="ServiceA"&gt;
    &lt;constructor-arg ref="dao-t"/&gt;
  &lt;/bean&gt;
  </code></pre>