title: How to stop DefaultListableBeanFactory from implicitly creating LocalValidatorFactoryBean instance
body: <p>I am using Spring 3.1 and have the following spring config where I explicitly create <code>LocalValidatorFactoryBean</code> using my own <code>ValidationMessageSource</code>. I have Hibernate Validator 4.1 in my class path.</p>
  
  <pre><code>&lt;bean id="messageSource"
        class="org.springframework.context.support.ResourceBundleMessageSource"&gt;
      &lt;property name="basenames"&gt;
          &lt;list&gt;
              &lt;value&gt;ValidatorMsgID&lt;/value&gt;
          &lt;/list&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  
  &lt;bean id="validator"
        class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean"&gt;
      &lt;property name="validationMessageSource" ref="messageSource"/&gt;
  &lt;/bean&gt;
  
  &lt;bean class="org.springframework.validation.beanvalidation.MethodValidationPostProcessor"/&gt;
  </code></pre>
  
  <p>However I noticed that the <code>LocalValidatorFactoryBean</code> is being created twice by hitting a debug in classes <code>afterPropertiesSet</code> method. The first time is for the explicite bean that I defined in the spring config, however following that the same class is instantiated implicitly again by <code>DefaultListableBeanFactory</code> class - obviously this time with no <code>validationMessageSource</code>. Therefore it seems that when Spring does make use of the <code>LocalValidatorFactoryBean</code> its using the one with the default Hibernates <code>messagesource</code> rather than the one I have specified.</p>
  
  <p><strong>Ok, looking into this a bit further its seems that this is caused by <code>mvc:annotation-driven</code> I have in the spring config.
  Any pointers would still help</strong></p>