title: Spring java Configuration
body: <p>The following is my code:</p>
  
  <pre><code>@EnableAutoConfiguration
  @ComponentScan(basePackages = "com.datastore")
  public class ABC {
  
      @Autowired
      B b;
  
      public static void main(String[] args) {
          ApplicationContext ctx = new AnnotationConfigApplicationContext(Config.class);
          C c= ctx.getBean(C.class);
          String s = b.getObject();
      }
  }
  </code></pre>
  
  <p>The problem with above code is that my <code>@Autowired</code> b object is coming<br>
     null. But c is not null. 
  Could anyone tell me how to to get B b object too. 
     So that, I can have B Object. Also there is a Config.java file in my 
     application which is configured with @Bean annotations.
   Please help me regarding the same.</p>