title: Spring Integration @Autowired not working
body: <p>I am using @Autowired to get create the Bean. But i am getting NullPointer and the Bean is not getting created.</p>
  
  <p>Spprinng Stater</p>
  
  <pre><code>@ComponentScan("com.api")
  public class DoseManagementApplication {
  
  public static void main(String[] args) {
      SpringApplication.run(DoseManagementApplication.class, args);
      AbstractApplicationContext context = new ClassPathXmlApplicationContext("/integration.xml");
      DoseManager doseManager = (DoseManager) context.getBean(DoseManager.class);
  
      doseManager.doseMangement("");
  
      context.close();
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Integration.xml</p>
  
  <pre><code>&lt;int:gateway id="doseManager" service-interface="com.cerner.api.gateway.DoseManager"/&gt;
  
  &lt;int:channel id="requestChannnel"&gt;&lt;/int:channel&gt;
  
  &lt;int:service-activator ref="doseManagerServiceActivator" input-channel="requestChannnel" method="buildDoseMedRelation"&gt; 
  &lt;/int:service-activator&gt;
  &lt;bean id="doseManagerServiceActivator" class="com.cerner.api.activator.DoseManagerServiceActivator"&gt;&lt;/bean&gt;
  </code></pre>
  
  <p>DoseManager Interface</p>
  
  <pre><code>package com.api.service;    
  @Component
  public interface DoseManager {
  
  @Gateway(requestChannel="requestChannnel")
  public void doseMangement(String startMsg);
  }
  </code></pre>
  
  <p>Service Activator Class</p>
  
  <pre><code>package com.api.service;
  @Component
  public class DoseManagerServiceActivator {
  
  @Autowired
  private DoseManagerService doseManage;
  
  public void buildDoseMedRelation(Message&lt;?&gt; msg) {
      System.out.println("doseManage== "+doseManage);
  }
  }
  </code></pre>
  
  <p>Service Class</p>
  
  <pre><code>package com.api.service;
  @Service
  public class DoseManagerService {
  
  }
  </code></pre>
  
  <p>I am trying to figure out why the @Autowired is not working. but didn't get any success. There is nothing the Service class.</p>