из-за ошибки Невозможно добавить прослушиватель типа при развертывании в glassfish5.0.1 - PullRequest
0 голосов
/ 23 октября 2019

Журнал Glassfish

[#|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

MANIFEST.MF

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

web.xml

<?xml version="1.0" encoding="UTF-8"?>
<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">

<listener>
  <listener-class>com.ipaccess.nos.service.web.NosContextLoaderListener</listener-class>
</listener>

<context-param>
<param-name>debug</param-name>
<param-value>true</param-value>
</context-param>

<servlet>
  <servlet-name>nos-tr069</servlet-name>
  <servlet-class>com.ipaccess.nos.service.tr69ap.southbound.AcsController</servlet-class>
  <load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
  <servlet-name>nos-tr069</servlet-name>
  <url-pattern>/acs</url-pattern>
</servlet-mapping>

<filter>
  <filter-name>lockStatusFilter</filter-name>
  <filter-class>com.ipaccess.nos.service.web.HttpAdminLockStateFilter</filter-class>
</filter>

<filter-mapping>
  <filter-name>lockStatusFilter</filter-name>
  <servlet-name>nos-tr069</servlet-name>
</filter-mapping>

</web-app>

NosContextLoaderListener (он присутствует в другом фляге). объяснение проблемы. Подробности приведены ниже

Мы используем OSGi Felix в Glassfish 5.0.1. Мы столкнулись с этой проблемой при обновлении нашего проекта с Java 6 до Java 8 (Oracle JDK версия 1.8.0_221), с Glassfish 3.1.1 до Glassfish 5.0.1 и OSGi Equinox до OSGi Felix.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...