users@grizzly.java.net

Re: OSGi HttpService & comet

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Mon, 01 Jun 2009 10:47:20 -0700

Salut,

jonathan wrote:
> Hi,
>
> I am trying to use comet with the OSGi version of grizzly 1.9.16.
> I would like to know if there is a way to activate the comet support on
> this version ? (if it's needed ?)
>
> Actually, the following Exception is raised: (I am using the Cometd servlet)
> and i am wondering if I only need to activate the 'comet support' or if
> it's due to an obscure Class loading ;D
>
> SEVERE: service exception:
> *java.lang.IllegalStateException: Make sure you have enabled Comet or
> make sure the Thread invoking that method is the same as the
> Servlet.service() Thread.*
> at com.sun.grizzly.comet.CometContext.<clinit>(CometContext.java:183)
> at com.sun.grizzly.comet.CometEngine.register(CometEngine.java:300)
> at com.sun.grizzly.comet.CometEngine.register(CometEngine.java:275)
> at com.sun.grizzly.comet.CometEngine.register(CometEngine.java:260)
> at
> com.sun.grizzly.cometd.BayeuxParser.createCometContext(BayeuxParser.java:504)
> at
> com.sun.grizzly.cometd.BayeuxParser.getCometContext(BayeuxParser.java:496)
> at com.sun.grizzly.cometd.BayeuxParser.onConnect(BayeuxParser.java:205)
> at com.sun.grizzly.cometd.BayeuxParser.parse(BayeuxParser.java:139)
> at
> com.sun.grizzly.cometd.EventRouterImpl.route(EventRouterImpl.java:110)
> at
> com.sun.grizzly.cometd.servlet.*CometdServlet*.doPost(CometdServlet.java:128)
>

Comet is not enabled by default. Hubert, take a look at:

https://grizzly.dev.java.net/nonav/xref/com/sun/grizzly/standalone/comet/Comet.html#67

This is how Comet gets enabled. We might want to honor the -D property
(-Dcom.sun.grizzly.cometSupport=true) or turn it on by default.

A+

-- Jeanfrancois

>
> Best Regards,
>
> ---
> Jonathan Bardin
>