I'm trying to get cometd working with Felix. I believe that I have it mostly working but I'm getting a ClassCastException on cometd requests, specifically "can not cast org.mortbay.jetty.nio.SelectChannelConnector$RetryContinuation to org.mortbay.util.ajax.Continuation" (this is from memory so it may be a bit off). I think that this is a classloader issue since the RetryContinuation class implements the Continuation interface. I know that split packages can cause ClassCastExceptions due to different classloaders but I'm not sure this is the problem.

I'm using the following bundles:
- org.apache.felix:org.apache.felix.http.jetty:0.9.0-SNAPSHOT (modified to use jetty 6.1.11)
- org.mortbay.jetty:jetty:6.1.11
- org.mortbay.jetty:jetty-util:6.1.11
- org.mortbay.jetty:servlet-api-2.5:6.1.11
- a custom comet bundle that
- inlines org.mortbay.jetty:cometd-api:0.9.20080221and org.mortbay.jetty:cometd-bayeux:6.1.11 - maps org.mortbay.cometd.continuation.ContinuationCometdServlet to /cometd

jetty-util exports org.mortbay.util but cometd-bayeux has org.mortbay.util.ArrayQueue. I managed to get my custom comet bundle to compile by making org.mortbay.util a private package. However, this duplicates all of org.mortbay.util in my bundle which I think is causing the ClassCastException.

What is the best way to handle the split package and avoid ClassCastExceptions?

Tim

Reply via email to