title: Spring dependency injection in external jar
body: <p>I have a project A which is consuming a jar lets say <code>B.jar</code> (where B is another project used as a dependency in our project A), now there is a <code>Bean</code> (kind of a <code>Spring-gemfire</code> cache), which holds all the required data in a map. 
  This map bean is being used by project (included as <code>jar</code> in my project) i.e B to read the cache properties , but i am unable to do so any help ?</p>
  
  <p>my webapp-config.xml for project B</p>
  
  <pre><code>    &lt;!-- Injecting bean in our A application --&gt;
      &lt;bean id="foo" class="com.abc.solutions.Foo" init-method="loadFoo"&gt;
               &lt;property name="bar1" ref="gemFireBean"/&gt;
               &lt;property name="bar2" ref="commonBean"/&gt;
      &lt;/bean&gt;
  
      &lt;bean id="b2" class="java.util.HashMap"
         factory-bean="foo" factory-method="createB2" autowire="byName"&gt;
      &lt;/bean&gt;
  </code></pre>
  
  <p>the above bean b2  has to be used in external project B (included as jar in my project A).</p>
  
  <p>part of clas sin project B2</p>
  
  <pre><code>@Autowired
      @Qualifier("b2")
      private Map&lt;String, String&gt; mapFromA;
  </code></pre>
  
  <p>but i am getting </p>
  
  <pre><code>org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [java.lang.String] found for dependency
  </code></pre>
  
  <p>any help will be appreciated.</p>