title: Spring: NotWritablePropertyException
body: <p><em>applicationContext</em></p>
  
  <pre><code>&lt;bean id="contentRegisteringBean" parent="abstractRegisteringBean" lazy-init="false"&gt;
      &lt;property name="processor"&gt;
          &lt;bean class="com.somepackage.ContentService$Processor"/&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  
  &lt;bean id="abstractRegisteringBean" class="test.spring.MockFactoryBean"&gt;
      &lt;property name="type" value="com.somepackage.ProcessorRegisteringBeanImpl"/&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p><em>ProcessorRegisteringBeanImpl</em></p>
  
  <pre><code>public class ProcessorRegisteringBeanImpl {
      private Processor mProcessor;
  
  
      public Processor getProcessor() {
          return mProcessor;
      }
  
      public void setProcessor(final Processor processor) {
          mProcessor = processor;
      }
  }
  </code></pre>
  
  <p><em>MockFactoryBean.java</em></p>
  
  <pre><code>public class MockFactoryBean&lt;T&gt; implements FactoryBean&lt;T&gt; {
      private Class&lt;T&gt; type;
  
      public void setType(Class&lt;T&gt; type) {
          this.type = type;
      }
  
      @Override
      public T getObject() throws Exception {
          return Mockito.mock(type);
      }
  
      @Override
      public Class&lt;T&gt; getObjectType() {
          return type;
      }
  
      @Override
      public boolean isSingleton() {
          return true;
      }
  
  }
  </code></pre>
  
  <p><strong>Exception:</strong></p>
  
  <blockquote>
    <p>org.springframework.beans.NotWritablePropertyException: Invalid
    property 'processor' of bean class
    [test.spring.MockFactoryBean]: Bean property 'processor' is
    not writable or has an invalid setter method. Does the parameter type
    of the setter match the return type of the getter?</p>
  </blockquote>