Hi Jean-Francois
I did some further investigations and found the problem. Some classes are twice in the grizzly-optionals.jar. So problem has been solved by switch my import statements to com.sun.grizzly.comet.CometContext and CometEngine instead of com.sun.enterprise.web.connector.grizzly.comet.Foo:
import com.sun.enterprise.web.connector.grizzly.comet.CometContext; ->
import com.sun.grizzly.comet.CometContext;
import com.sun.enterprise.web.connector.grizzly.comet.CometEngine; ->
import com.sun.grizzly.comet.CometEngine;
Seems as if I had imported the wrong classes in a hurry. Many thanks for bring my on the right track.
Cheers
Marc
P.S. Aktuelle Veranstaltungen: www.zuehlke.com/events
____________________________________
Consulting · Development · Integration
Marc Baechinger
Software Architekt
Zühlke Engineering AG
Wiesenstrasse 10a
8952 Schlieren (Zürich)
Schweiz
Phone +41 44 733 6611
Direct +41 44 733 6554
Mobile +41 79 778 80 52
Fax +41 44 733 6612
Marc.Baechinger_at_zuehlke.com
____________________________________
This e-mail is for the addressees only. The information it contains is confidential
and may be legally privileged. If you are not an addressee you must not distribute,
copy, disclose, use or rely on this e-mail or its contents and you must immediately
notify the sender you are in receipt of this e-mail and delete all copies from your
system. Any unauthorised use may be unlawful.
-----Original Message-----
From: Jeanfrancois.Arcand_at_Sun.COM [mailto:Jeanfrancois.Arcand_at_Sun.COM]
Sent: Freitag, 23. Januar 2009 02:21
To: users_at_grizzly.dev.java.net
Subject: Re: BayeuxCometHandler not to be casted to CometHandler?
Salut,
apology for the delay...lllloong day at Sun (riff :-()
Marc Bächinger wrote:
> Hi
>
> I'm currently developing an application for which I would like to use
> the Bayeux protocol of Grizzly/Glassfish. I have the chat application
> of Carol McDonald working. So I can write message from one browser to
> the CometdDervlet which broadcast it to the other clients subscribed
> to that channel.
>
> Based on this I tried to implement my own CometdServlet for which I
> just copied the code out of the Glassfishh source code repository to
> start with. To my surprise the server throws an ClassCastException
> when the servlet is called:
>
> java.lang.ClassCastException:
> com.sun.grizzly.cometd.BayeuxCometHandler
> cannot be cast to
> com.sun.enterprise.web.connector.grizzly.comet.CometHandler
> at
> com.sun.enterprise.web.connector.grizzly.comet.CometContext.getCometHa
> ndler(CometContext.java:95)
> at
> com.sun.enterprise.web.connector.grizzly.comet.CometContext.notify(Com
> etContext.java:150) at
> com.sun.grizzly.cometd.EventRouterImpl.route(EventRouterImpl.java:98)
> [...]
>
> That puzzles my because I checked out the BayeuxCometHandler source.
> It extends the BayeuxBaseHandler (or similar) which does implement the
> CometHandler interface. So I do not understand why there is a
> ClassCasrtException.
>
> Did someone of you guys have similar problems? Do I have a library mismatch?
>
> I'm using Glassfish V3 prelude. In the IDE I added the
> grizzly-optionals.jar linrary to make it compile.
I think it could be a classloader issues with OSGI. Can you file an issue here:
https://grizzly.dev.java.net/issues/
and attach your test case? Where is your implementation class located?
Inside grizzly-optionals?
Thanks
-- jeanfrancois
>
> Any ideas?
>
> many thanks
> marc
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
For additional commands, e-mail: users-help_at_grizzly.dev.java.net