title: java.lang.Exception: ServletConfig has not been initialized
body: <p>i have a problem is:</p>
  
  <blockquote>
    <p>java.lang.Exception: ServletConfig has not been initialized</p>
  </blockquote>
  
  <p>I searched for it nearly 2 days but i did not have a solution for me. Every one had said that
  <strong>super.init(config)</strong> must be used. I have tried this, but there is nothing change for me.</p>
  
  <p>My init method;</p>
  
  <pre><code>@Override
  public void init(ServletConfig config) throws ServletException {
  
      super.init(config);
  
      AppServiceServlet service = new AppServiceServlet();
      try {
          service.getir();
      } catch (Exception e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
  
      AutoCheckStatus.autoCheckStatus(600000);
  }
  </code></pre>
  
  <p>and my AppServiceServlet;</p>
  
  <pre><code>    public List&lt;SswAppServiceDto&gt; getir() throws Exception {
      try {
          final WebApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(this
                  .getServletContext());
          setiAppServiceBusinessManager((IAppServiceBusinessManager) context.getBean(BEAN_ADI));
  
          List&lt;SswAppService&gt; result = getiAppServiceBusinessManager().getir();
  
          List&lt;SswAppServiceDto&gt; list = DtoConverter.convertSswAppServiceDto(result);
  
          for (int i = 0; i &lt; result.size(); i++) {
              AppService appService = new AppService();
              appService.setServiceName(result.get(i).getName());
              appService.setUid(result.get(i).getServiceUid());
              appService.setHost(result.get(i).getHost());
              appService.setPort((int) result.get(i).getPort());
              SystemConfiguration.appServiceList.put(appService.getUid(), appService);
          }
          return list;
  
      } catch (RuntimeException e) {
          throw new Exception(e.getMessage(), e.getCause());
      }
  }
  </code></pre>
  
  <p>The exception is thrown in this line;</p>
  
  <pre><code>          final WebApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
  </code></pre>
  
  <p>in AppServiceServlet and says:</p>
  
  <blockquote>
    <p>java.lang.Exception: ServletConfig has not been initialized. </p>
  </blockquote>
  
  <p>Pls help.</p>