title: getting error of Unable to add listener of type while deploying in glassfish5.0.1
body: <p><strong>Glassfish log</strong></p>
  
  <pre><code>[#|2019-10-22T19:16:12.273+0530|SEVERE|glassfish 5.0|javax.enterprise.web.core|_ThreadID=87 _ThreadName=pool-8-thread-1;_TimeMillis=1571751972273;_LevelValue=1000;_MessageID=AS-WEB-CORE 00108;|
      ContainerBase.addChild: start: 
      org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: Unable to add listener of type: com.ipaccess.nos.service.web.NosContextLoaderListener, because it does not implement any of the required ServletContextListener, ServletContextAttributeListener, ServletRequestListener, ServletRequestAttributeListener, HttpSessionListener, or HttpSessionAttributeListener interfaces
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:5537)
      at com.sun.enterprise.web.WebModule.start(WebModule.java:540)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:877)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:860)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:644)
      at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2044)
      at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1690)
      at com.sun.enterprise.web.WebApplication.start(WebApplication.java:107)
      at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
      at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)
      at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352)
      at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:500)
      at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
      at org.glassfish.osgijavaeebase.OSGiDeploymentRequest.deploy(OSGiDeploymentRequest.java:185)
      at org.glassfish.osgijavaeebase.OSGiDeploymentRequest.execute(OSGiDeploymentRequest.java:120)
      at org.glassfish.osgijavaeebase.AbstractOSGiDeployer.deploy(AbstractOSGiDeployer.java:123)
      at org.glassfish.osgijavaeebase.OSGiContainer.deploy(OSGiContainer.java:154)
      at org.glassfish.osgijavaeebase.JavaEEExtender.deploy(JavaEEExtender.java:109)
      at org.glassfish.osgijavaeebase.JavaEEExtender.access$200(JavaEEExtender.java:61)
      at org.glassfish.osgijavaeebase.JavaEEExtender$HybridBundleTrackerCustomizer$1.call(JavaEEExtender.java:153)
      at org.glassfish.osgijavaeebase.JavaEEExtender$HybridBundleTrackerCustomizer$1.call(JavaEEExtender.java:150)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at java.lang.Thread.run(Thread.java:748)
      Caused by: java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: Unable to add listener of type: com.ipaccess.nos.service.web.NosContextLoaderListener, because it does not implement any of the required ServletContextListener, ServletContextAttributeListener, ServletRequestListener, ServletRequestAttributeListener, HttpSessionListener, or HttpSessionAttributeListener interfaces
      at org.apache.catalina.core.StandardContext.addListener(StandardContext.java:2867)
      at org.apache.catalina.core.StandardContext.addApplicationListener(StandardContext.java:2073)
      at com.sun.enterprise.web.TomcatDeploymentConfig.configureApplicationListener(TomcatDeploymentConfig.java:236)
      at com.sun.enterprise.web.TomcatDeploymentConfig.configureWebModule(TomcatDeploymentConfig.java:95)
      at com.sun.enterprise.web.WebModuleContextConfig.start(WebModuleContextConfig.java:239)
      at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:295)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:122)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:5534)
      ... 24 more
      Caused by: java.lang.IllegalArgumentException: Unable to add listener of type: com.ipaccess.nos.service.web.NosContextLoaderListener, because it does not implement any of the required ServletContextListener, ServletContextAttributeListener, ServletRequestListener, ServletRequestAttributeListener, HttpSessionListener, or HttpSessionAttributeListener interfaces
      at org.apache.catalina.core.StandardContext.createListener(StandardContext.java:2982)
      at org.apache.catalina.core.StandardContext.loadListener(StandardContext.java:5057)
      at com.sun.enterprise.web.WebModule.loadListener(WebModule.java:1637)
      at org.apache.catalina.core.StandardContext.addListener(StandardContext.java:2865)
      ... 31 more
  </code></pre>
  
  <p><strong>MANIFEST.MF</strong></p>
  
  <pre><code>Manifest-Version: 1.0
  Bundle-ManifestVersion: 2
  Bundle-Name: NOS TR69 AP Service
  Bundle-SymbolicName: com.ipaccess.nos.service.tr69ap
  Bundle-Version: 3.0.0
  Bundle-Vendor: ip.access
  Export-Package: com.ipaccess.nos.service.tr69ap.southbound.api
  Bundle-RequiredExecutionEnvironment: JavaSE-1.6
  Import-Package: com.ipaccess.nos.business.cm.api,
  javax.servlet,
  javax.servlet.http,
  org.osgi.framework;version="1.5.0",
  org.slf4j,
  org.springframework.osgi.web.context.support;version="1.2.1",
  org.springframework.remoting.rmi,
  org.springframework.util;version="3.0.5.RELEASE",
  org.springframework.web.bind.annotation;version="3.0.5.RELEASE",
  org.springframework.web.context;version="3.0.5.RELEASE",
  org.springframework.web.context.support;version="3.0.5.RELEASE",
  org.springframework.web.servlet;version="3.0.5.RELEASE",
  org.aspectj.lang,
  org.aspectj.lang.annotation,
  org.aspectj.lang.reflect,
  org.aspectj.runtime.internal,
  org.aspectj.runtime.reflect,
  org.aopalliance.aop,
  org.aopalliance.intercept,
  com.ipaccess.nos.service.web
  Bundle-ClassPath: lib/com.ipaccess.nos.Tr69Stack.jar,
  WEB-INF/classes,.
  Require-Bundle: org.springframework.beans;bundle-version="3.0.5",
  org.springframework.core;bundle-version="3.0.5",
  org.springframework.context,
  org.springframework.osgi.web;bundle-version="1.2.1";bundle-version:=optional,
  org.springframework.osgi.core;bundle-version="1.2.1",
  org.springframework.osgi.extender;bundle-version="1.2.1",
  org.springframework.osgi.io;bundle-version="1.2.1",
  com.ipaccess.nos.business,
  com.springsource.org.aopalliance;bundle-version="1.0.0",
  org.springframework.aop;bundle-version="3.0.5",
  org.springframework.osgi.extender,
  com.springsource.javax.servlet;bundle-version="2.5.0"
  Web-ContextPath: /
  Spring-Context: *;timeout:=600
  </code></pre>
  
  <p><strong>web.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app metadata-complete="false" version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"&gt;
  
  &lt;listener&gt;
    &lt;listener-class&gt;com.ipaccess.nos.service.web.NosContextLoaderListener&lt;/listener-class&gt;
  &lt;/listener&gt;
  
  &lt;context-param&gt;
  &lt;param-name&gt;debug&lt;/param-name&gt;
  &lt;param-value&gt;true&lt;/param-value&gt;
  &lt;/context-param&gt;
  
  &lt;servlet&gt;
    &lt;servlet-name&gt;nos-tr069&lt;/servlet-name&gt;
    &lt;servlet-class&gt;com.ipaccess.nos.service.tr69ap.southbound.AcsController&lt;/servlet-class&gt;
    &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  
  &lt;servlet-mapping&gt;
    &lt;servlet-name&gt;nos-tr069&lt;/servlet-name&gt;
    &lt;url-pattern&gt;/acs&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  
  &lt;filter&gt;
    &lt;filter-name&gt;lockStatusFilter&lt;/filter-name&gt;
    &lt;filter-class&gt;com.ipaccess.nos.service.web.HttpAdminLockStateFilter&lt;/filter-class&gt;
  &lt;/filter&gt;
  
  &lt;filter-mapping&gt;
    &lt;filter-name&gt;lockStatusFilter&lt;/filter-name&gt;
    &lt;servlet-name&gt;nos-tr069&lt;/servlet-name&gt;
  &lt;/filter-mapping&gt;
  
  &lt;/web-app&gt;
  </code></pre>
  
  <p>NosContextLoaderListener (it present in other jar). issue explanation.
      Details are given below </p>
  
  <p>We are using OSGi Felix in Glassfish 5.0.1. We are facing this issue while upgrading our 
      project from Java 6 to Java 8 (Oracle JDK version 1.8.0_221), from Glassfish 3.1.1 to Glassfish
      5.0.1 and OSGi Equinox to OSGi Felix.</p>