0
votes

I followed the this tutorial to deploy Zk on Jboss 6 but on server start up I am getting the error below:

ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/stream-zk]] (ServerService Thread Pool -- 92) JBWEB000289: Servlet zkLoader threw load() exception: java.lang.ClassCastException: org.zkoss.zk.ui.http.DHtmlLayoutServlet cannot be cast to javax.servlet.Servlet at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1154) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1] at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1100) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1] at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3593) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1] at org.apache.catalina.core.StandardContext.start(StandardContext.java:3802) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1] at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:163) [jboss-as-web-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21] at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:61) [jboss-as-web-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21] at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:96) [jboss-as-web-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [rt.jar:1.8.0_261] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_261] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [rt.jar:1.8.0_261] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [rt.jar:1.8.0_261] at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_261] at org.jboss.threads.JBossThread.run(JBossThread.java:122)

Any help is appreciated.

1

1 Answers

0
votes

Such error "...cannot be cast to javax.servlet.Servlet..." is mostly caused by a class that doesn't extend HttpServlet, but ZK really extends HttpServlet.

So the root cause is probably from Jboss. According to this thread you might load 2 different versions of the servlet API jar.

According to the documentation:

This is a flat namespace and there should not be multiple instances of a class in different deployment JARs. If there are, only the first loaded will be used and the results may not be as expected

Please check this first.