title: Spring bean with runtime constructor arguments
body: <p>I want to create a Spring bean in <strong>Spring Java configuration</strong> with some constructor arguments passed at runtime. I have created the following Java config, in which there is a bean <strong>fixedLengthReport</strong> that expects some arguments in constructor.</p>
  
  <pre><code>@Configuration
  public class AppConfig {
  
      @Autowrire
      Dao dao;
  
      @Bean
      @Scope(value = "prototype")
      **//SourceSystem can change at runtime**
      public FixedLengthReport fixedLengthReport(String sourceSystem) {
           return new TdctFixedLengthReport(sourceSystem, dao);
      }
  }
  </code></pre>
  
  <p>But i am getting error that <strong>sourceSystem</strong> couldn't wire because no bean found. How can I create bean with runtime constructor arguments?</p>
  
  <p>I am using Spring 4.2</p>