title: BeanCreationException: No factory method found
body: <p>I have a Java class which I'm using to instantiate multiple objects for use in test cases.
  In my spring configuration for invoking this class I have something like the following:</p>
  
  <pre><code>&lt;bean id="myClass" class="com.foo.MyClass"&gt;
     &lt;constructor-arg ref="myBean" /&gt;
  &lt;/bean&gt;
  
  &lt;bean id="myBeanA" factory-bean="myClass" factory-method="getA" /&gt;
  &lt;bean id="myBeanB" factory-bean="myClass" factory-method="getB" /&gt;
  &lt;bean id="myBeanC" factory-bean="myClass" factory-method="getC" /&gt;
  </code></pre>
  
  <p>MyClass does not extend anything. 
  My issue is that calling methods <code>MyClass.getA()</code> and <code>MyClass.getB()</code> works but <code>MyClass.getC()</code> does not and always throws a <code>BeanCreationException: No factory method found getC()</code></p>
  
  <p>None of the methods are static and all of them are public. Debugging through Spring jars I can see that when the bean for <code>MyClass.getC()</code> is created it doesn't pick up the method when it does <code>getLeafMethods()</code>, but will find methods <code>getA()</code> and <code>getB()</code> and Object methods but none of the other methods in the class. Has anyone encountered a issue like this before or know why its unable to find all the methods in the class?</p>
  
  <p>I cannot post the actual code but here is simpler version of it:</p>
  
  <pre><code>public class MyClass {
          private A a;
          private int i;
          public MyClass(D param) {
             //initialize here
          }
  
          public A getA() {
              return a;
          }
  
          public B getB() {
              return new B(i++);
          }
  
          //I could invoke this in a static way
          //however the same issue occurs either way.
          public C getC() {
              return new C();
          }
  }
  </code></pre>