-
Bug
-
Resolution: Fixed
-
Normal
-
6.5.7, 7.0.3
-
None
-
Security Level: Jimmy
-
JBoss 5.1.0
-
None
Problem Description:
CometAsyncServlet is installed if the web container is determined as servlet 3.0 compliant. It is done by checking if javax.servlet.annotation.WebServlet can be loaded.
If servlet-api-3.0.jar were put into WEB-INF/lib manually, or via Maven, this mechanism could break even if the web container is only servlet 2.5 compliant.
Suggested Approach:
ServletContext API has methods getMajorVersion() and getMinorVersion(), which checks Servlet API version.
http://docs.oracle.com/javaee/6/api/javax/servlet/ServletContext.html#getMajorVersion()
Stack Trace:
java.lang.AbstractMethodError: org.apache.catalina.core.ApplicationContextFacade.addServlet(Ljava/lang/String;Ljava/lang/Class;)Ljavax/servlet/ServletRegistration$Dynamic;
at org.zkoss.zkmax.ui.comet.CometAsyncServlet.install(CometAsyncServlet.java:54)
at org.zkoss.zkmax.init.WebAppInit.init(WebAppInit.java:32)
at org.zkoss.zk.ui.util.Configuration.invokeWebAppInits(Configuration.java:728)
at org.zkoss.zk.ui.impl.AbstractWebApp.init(AbstractWebApp.java:202)
at org.zkoss.zk.ui.http.SimpleWebApp.init(SimpleWebApp.java:58)
at org.zkoss.zk.ui.http.WebManager.<init>(WebManager.java:226)
at org.zkoss.zk.ui.http.HttpSessionListener23.contextInitialized(HttpSessionListener23.java:140)
... omitted