title: Spring Bean is not initializing on Application startup
body: <p>In my application i want to initialize the bean before hitting application url, and store the common values for drop-down. here it is declaration for bean</p>
  
  <pre><code>&lt;beans:bean id="listService" class="com.system.beans.DropDownList"
          init-method="populateMasterList" scope="application"/&gt;
  </code></pre>
  
  <blockquote>
    <p>Bean:</p>
  </blockquote>
  
  <pre><code>public class DropDownList implements InitializingBean
  {
      private static final Logger                     logger  = LoggerFactory.getLogger(DropDownList.class);
      public static Map&lt;String, Map&lt;Integer, String&gt;&gt; listMap = new HashMap&lt;String, Map&lt;Integer, String&gt;&gt;();
      @Autowired
      private static SystemService                    systemService;
  
      @Autowired(required = true)
      @Qualifier(value = "systemService")
      public void setSystemService(SystemService systemService)
      {
          this.systemService = systemService;
      }
  
      @PostConstruct
      public static Map&lt;String, Map&lt;Integer, String&gt;&gt; populateMasterList()
      {
          logger.debug("Calling Institute Info Masters");
          List&lt;InstituteInfoMaster&gt; masterList = systemService.listInstituteInfoMasters();
          Map&lt;Integer, String&gt; masterMap = new HashMap&lt;Integer, String&gt;();
          masterMap.put(0, "---Select---");
          masterList.forEach((master) -&gt;
          {
              masterMap.put(master.getListId(), master.getValue());
          });
          logger.debug("Created Map for List Masters");
          listMap.put("infoList", masterMap);
          return listMap;
      }
  
      public Map&lt;String, Map&lt;Integer, String&gt;&gt; getListMap()
      {
          return listMap;
      }
  
      public static void setListMap()
      {
          listMap = populateMasterList();
      }
  
      @Override
      public void afterPropertiesSet() throws Exception
      {
          populateMasterList();
  
      }
  }
  </code></pre>
  
  <p>I observed that it does not initializes on Application startup. when i try to update the master by calling <code>DropDownList.setListMap();</code> it gives <code>NullPointerException</code>. but if i calls the jsp page where i am calling the Map as <code>${listService.listMap['infoList']}</code> it displays the Drop-down on jsp after  it if i tries to save master it executes successfully. </p>
  
  <p>it means when i calls the jsp page where i am showing drop-down that time only it initializing the bean not on Application startup.</p>