title: Custom ContextLoaderListener class is not working in Websphere
body: <p>Custom ContextLoaderListener class is not working in Websphere and it is throwing the below error. The same is working fine in Tomcat, JBoss, Weblogic.</p>
  
  <pre><code>java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered?
  </code></pre>
  
  <p>My custom context loader class looks like below:</p>
  
  <pre><code>public class CustomContextListener extends ContextLoaderListener {
       //implemented contextInitized() and contextDestroyed() methods
  }
  </code></pre>
  
  <p>In web.xml, added as below:</p>
  
  <pre><code>&lt;listener&gt;
    &lt;listener-class&gt;com.comp.app.context.CustomContextListener&lt;/listener-class&gt;
  &lt;/listener&gt;
  </code></pre>
  
  <p>Can anybody help me to resolve this error?</p>
  
  <p>Update: Found the below error in logs.</p>
  
  <pre><code> 00000026 DispatcherSer E org.springframework.web.servlet.FrameworkServlet initServletBean Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name configMgr: Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: xxxx; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [xxxxxx] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
  </code></pre>