title: Overriding constructor arguments in Spring
body: <p>Say I have two beans (where <code>BeanA</code> properties are immutable, requiring constructor injection):</p>
  
  <pre><code>&lt;bean id="beanA1" class="BeanA"&gt;
    &lt;constructor-arg type="ServiceA" ref="serviceA" /&gt;
    &lt;constructor-arg type="ServiceB" ref="serviceB" /&gt;
    &lt;constructor-arg type="ServiceC" ref="serviceC" /&gt;
    &lt;constructor-arg type="boolean" value="false" /&gt;
  &lt;/bean&gt;
  
  &lt;bean id="beanA2" class="BeanA"&gt;
    &lt;constructor-arg type="ServiceA" ref="serviceA" /&gt;
    &lt;constructor-arg type="ServiceB" ref="serviceB" /&gt;
    &lt;constructor-arg type="ServiceC" ref="serviceC" /&gt;
    &lt;constructor-arg type="boolean" value="true" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>Since they share everything but the boolean, I wanted to merge them as such:</p>
  
  <pre><code>&lt;bean id="beanA1" class="BeanA"&gt;
    &lt;constructor-arg type="ServiceA" ref="serviceA" /&gt;
    &lt;constructor-arg type="ServiceB" ref="serviceB" /&gt;
    &lt;constructor-arg type="ServiceC" ref="serviceC" /&gt;
    &lt;constructor-arg type="boolean" value="false" /&gt;
  &lt;/bean&gt;
  
  &lt;bean id="beanA2" parent="beanA1"&gt;
    &lt;constructor-arg type="boolean" value="true" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>However, this doesn't seem to be working</p>
  
  <pre><code>Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'beanA2' defined in class path resource [context.xml]: Could not resolve matching constructor (hint: specify index/type/name arguments for simple parameters to avoid type ambiguities)
  </code></pre>
  
  <p>Any way to do this with constructor injection?</p>