title: Injection of resource dependencies failed in Spring 3.1
body: <p>Appreciate any help on Injecting dependencies error. Same thing perfectly works when bean in standalone. During apache 6.0.35 startup, it throws following. Appreciate any help and thanks in advance. I am using Spring 3.1.1</p>
  
  <pre><code>**SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
  org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'appConfigBean': Injection of resource dependencies failed; nested exception is 
  org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'ExtConfigBean' is defined**
  </code></pre>
  
  <p>Complete Code and Configuration are given below</p>
  
  <p>Java Code</p>
  
  <pre><code>    @Configuration
  @PropertySource("classpath:application.properties")
  @Component
  @Service
  public class AppConfig implements ApplicationConstants, ApplicationContextAware {
  
      @Autowired
      private ApplicationContext applicationContext;
  
      /**
       * Main Map Bean
       */
      @Resource(name = "ExtConfigBean")
      private LinkedHashMap&lt;String, String&gt; extConfigBeanMap;
  
          @Override
      public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
          System.out.println("Autowiring Context Ref: " + applicationContext);
          this.applicationContext = applicationContext;
      }
  }
  </code></pre>
  
  <p>application.properties</p>
  
  <pre><code>application=ApplicationTest
  version=1.0.0
  release=July 2012
  </code></pre>
  
  <p>ApplicationContext File is</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:context="http://www.springframework.org/schema/context"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
      xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop"
      xmlns:lang="http://www.springframework.org/schema/lang" xmlns:p="http://www.springframework.org/schema/p"
      xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:beans="http://www.springframework.org/schema/beans"
      xsi:schemaLocation="http://www.springframework.org/schema/beans 
         http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
         http://www.springframework.org/schema/util 
         http://www.springframework.org/schema/util/spring-util-2.0.xsd
         http://www.springframework.org/schema/tx 
         http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
         http://www.springframework.org/schema/aop 
         http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
         http://www.springframework.org/schema/lang 
         http://www.springframework.org/schema/lang/spring-lang-2.0.xsd
         http://www.springframework.org/schema/context
         http://www.springframework.org/schema/context/spring-context-3.1.xsd
         http://www.springframework.org/schema/oxm
         http://www.springframework.org/schema/oxm/spring-oxm-3.0.xsd
         http://www.springframework.org/schema/mvc 
         http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd"&gt;
  
      &lt;!-- Configures the @Controller programming model --&gt;
      &lt;mvc:annotation-driven /&gt;
  
      &lt;!-- Activates scanning of @Autowired --&gt;
      &lt;context:annotation-config /&gt;
      &lt;!-- &lt;bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor" /&gt; --&gt;
  
      &lt;!-- Activates scanning of @Repository and @Service --&gt;
      &lt;context:component-scan
          base-package="com.app.test "&gt;
      &lt;/context:component-scan&gt;
  
      &lt;!-- Application wide Spring Injection --&gt;
      &lt;bean id="contextProvider" class="com.app.test.AppContextProvider" lazy-init="false" /&gt;
  
      &lt;bean id="appConfigBean" class="com.app.test.config.AppConfig" lazy-init="false" /&gt;
  
  
          &lt;!-- Application Configuration --&gt;
      &lt;bean id="ExtConfigBean" class="org.springframework.beans.factory.config.MapFactoryBean"&gt;
          &lt;property name="sourceMap"&gt;
              &lt;map&gt;
                  &lt;entry key="some_key"&gt;
                      &lt;value&gt;Some Key Value&lt;/value&gt;
                  &lt;/entry&gt;
              &lt;/map&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>web.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  </code></pre>
  
  <p>http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"></p>
  
  <pre><code>&lt;!-- Java-based Spring container definition --&gt;
  &lt;context-param&gt;
      &lt;param-name&gt;contextClass&lt;/param-name&gt;
      &lt;param-value&gt;org.springframework.web.context.support.AnnotationConfigWebApplicationContext&lt;/param-value&gt;
  &lt;/context-param&gt;
  
  &lt;!-- Location of Java @Configuration classes that configure the components 
      that makeup this application --&gt;
  &lt;context-param&gt;
      &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
      &lt;param-value&gt;com.xxx.ealert.app.config&lt;/param-value&gt;
  &lt;/context-param&gt;
  
  &lt;!-- Creates the Spring Container shared by all Servlets and Filters --&gt;
  &lt;listener&gt;
      &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
  &lt;/listener&gt;
  
  &lt;!-- Processes application requests --&gt;
  &lt;servlet&gt;
      &lt;servlet-name&gt;Spring MVC Dispatcher Servlet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
          &lt;param-value&gt;&lt;/param-value&gt;
      &lt;/init-param&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;Spring MVC Dispatcher Servlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  
  &lt;!-- Secures the application --&gt;
  &lt;filter&gt;
      &lt;filter-name&gt;securityFilter&lt;/filter-name&gt;
      &lt;filter-class&gt;org.springframework.web.filter.DelegatingFilterProxy&lt;/filter-class&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;targetBeanName&lt;/param-name&gt;
          &lt;param-value&gt;springSecurityFilterChain&lt;/param-value&gt;
      &lt;/init-param&gt;
  &lt;/filter&gt;
  
  &lt;filter-mapping&gt;
      &lt;filter-name&gt;securityFilter&lt;/filter-name&gt;
      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
  &lt;/filter-mapping&gt;
  
  &lt;!-- Reads request input using UTF-8 encoding --&gt;
  &lt;filter&gt;
      &lt;filter-name&gt;characterEncodingFilter&lt;/filter-name&gt;
      &lt;filter-class&gt;org.springframework.web.filter.CharacterEncodingFilter&lt;/filter-class&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;encoding&lt;/param-name&gt;
          &lt;param-value&gt;UTF-8&lt;/param-value&gt;
      &lt;/init-param&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;forceEncoding&lt;/param-name&gt;
          &lt;param-value&gt;true&lt;/param-value&gt;
      &lt;/init-param&gt;
  &lt;/filter&gt;
  
  &lt;filter-mapping&gt;
      &lt;filter-name&gt;characterEncodingFilter&lt;/filter-name&gt;
      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
  &lt;/filter-mapping&gt;
  </code></pre>
  
  <p></p>