users@grizzly.java.net

RE: FW: Grizzly Comet hasn't been registered

From: John C. Turnbull <ozemale_at_ozemail.com.au>
Date: Tue, 8 Jan 2008 04:04:06 +1100

Hi Jeanfrancois,

Thanks for replying. I have sent you the files in an email to your Sun
email address. I believe I am registering things correctly but clearly I am
mistaken!

Thanks,

John

> -----Original Message-----
> From: Jeanfrancois.Arcand_at_Sun.COM [mailto:Jeanfrancois.Arcand_at_Sun.COM]
> Sent: Tuesday, 8 January 2008 02:49
> To: users_at_grizzly.dev.java.net
> Subject: Re: FW: Grizzly Comet hasn't been registered
>
> Hi,
>
> sorry for the delay...not sure if you have found your problem. You get
> that exception because your CometContext is not registered correctly,
> meaning when you invoke:
>
> CometEngine.getEngine().register(contextPath);
>
> the contextPath must be the request url that will enable the
> CometEngine:
>
> As an example, if you do:
>
> CometEngine.getEngine().register("/grizzlyComet");
>
> all requests to
>
> http://ip:port/grizzlyComet/
>
> will be considered as a Comet request. Hence you need to make sure the
> Servlet mapped to the url is the one that handle Comet so when you
> invoke:
>
> addCometHandler(..), the CometEngine has been properly started. Just
> send me your web.xml/Servlet so I can take a look.
>
> Thanks!
>
> --Jeanfrancois
>
>
>
>
> John C. Turnbull wrote:
> > I should add that I am using SJSAS 9.1_01 if that is relevant.
> >
> > Also, trying:
> >
> > http://localhost:8080/examples/ChatServlet
> >
> > does not produce the exception... it does absolutely nothing
> instead.
> > What's the correct way to run this example?
> >
> > Thanks,
> >
> > -JCT
> >
> > -----Original Message-----
> > From: John C. Turnbull [mailto:ozemale_at_ozemail.com.au]
> > Sent: Friday, 4 January 2008 11:33
> > To: 'users_at_grizzly.dev.java.net'
> > Subject: RE: Grizzly Comet hasn't been registered
> >
> > Here it is:
> >
> > StandardWrapperValve[ChatServlet]: PWC1406: Servlet.service() for
> servlet
> > ChatServlet threw exception
> > java.lang.IllegalStateException: Grizzly Comet hasn't been registered
> > at
> >
> com.sun.grizzly.comet.CometContext.addCometHandler(CometContext.java:22
> 0)
> > at
> >
> com.sun.grizzly.comet.CometContext.addCometHandler(CometContext.java:26
> 6)
> > at com.john.ChatServlet.doPost(ChatServlet.java:88)
> > at com.john.ChatServlet.doGet(ChatServlet.java:44)
> > at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
> > at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
> > at
> >
> org.apache.catalina.core.ApplicationFilterChain.servletService(Applicat
> ionFi
> > lterChain.java:411)
> > at
> >
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVal
> ve.ja
> > va:290)
> > at
> >
> org.apache.catalina.core.StandardContextValve.invokeInternal(StandardCo
> ntext
> > Valve.java:271)
> > at
> >
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextVal
> ve.ja
> > va:202)
> > at
> >
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.jav
> a:632
> > )
> > at
> >
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.jav
> a:577
> > )
> > at
> com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
> > at
> >
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.jav
> a:206
> > )
> > at
> >
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.jav
> a:632
> > )
> > at
> >
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.jav
> a:577
> > )
> > at
> >
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:
> 571)
> > at
> >
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
> > at
> >
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve
> .java
> > :150)
> > at
> >
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.jav
> a:632
> > )
> > at
> >
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.jav
> a:577
> > )
> > at
> >
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:
> 571)
> > at
> >
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
> > at
> >
> org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
> > at
> >
> com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAda
> pter(
> > DefaultProcessorTask.java:637)
> > at
> >
> com.sun.enterprise.web.connector.grizzly.comet.CometEngine.executeServl
> et(Co
> > metEngine.java:547)
> > at
> >
> com.sun.enterprise.web.connector.grizzly.comet.CometEngine.handle(Comet
> Engin
> > e.java:299)
> > at
> >
> com.sun.enterprise.web.connector.grizzly.comet.CometAsyncFilter.doFilte
> r(Com
> > etAsyncFilter.java:87)
> > at
> >
> com.sun.enterprise.web.connector.grizzly.async.DefaultAsyncExecutor.inv
> okeFi
> > lters(DefaultAsyncExecutor.java:175)
> > at
> >
> com.sun.enterprise.web.connector.grizzly.async.DefaultAsyncExecutor.int
> errup
> > t(DefaultAsyncExecutor.java:153)
> > at
> >
> com.sun.enterprise.web.connector.grizzly.async.AsyncProcessorTask.doTas
> k(Asy
> > ncProcessorTask.java:92)
> > at
> >
> com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265
> )
> > at
> >
> com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWor
> kerTh
> > read.java:106)
> >
> > Line 88 of ChatServlet is:
> >
> > cometContext.addCometHandler(handler);
> >
> > Thanks,
> >
> > -JCT
> >
> >> -----Original Message-----
> >> From: Shing-Wai.Chan_at_Sun.COM [mailto:Shing-Wai.Chan_at_Sun.COM]
> >> Sent: Friday, 4 January 2008 09:57
> >> To: users_at_grizzly.dev.java.net
> >> Subject: Re: Grizzly Comet hasn't been registered
> >>
> >> Do you have stack trace?
> >>
> >> John C. Turnbull wrote:
> >>> I am trying to implement the chat example that Jean-Francois used
> in
> >>> his blog but I get this exception in the same place that other
> people
> >>> have reported it in the past (namely
> >>> cometContext.addCometHandler(handler); in doPost()) only I have
> >>> checked that the context used to invoke the servlet is the same as
> >>> that in its mapping configuration. I am using the latest Grizzly.
> >>>
> >>> Are there other possible reasons for getting this exception? The
> >>> servlet mapping is "/ChatServlet" and the code to register it is:
> >>>
> >>> contextPath = config.getServletContext().getContextPath() +
> >>> "/ChatServlet";
> >>>
> >>> The chat.jsp used to invoke the servlet has:
> >>>
> >>> <frameset>
> >>>
> >>> <iframe src ="/examples/ChatServlet?action=openchat"
> name="CometChat"
> >>> width="100%" scrolling="auto"> </iframe>
> >>>
> >>> <iframe name="post" src="post.jsp" width="100%" scrolling="no"/>
> >>>
> >>> </frameset>
> >>>
> >>> Any ideas?
> >>>
> >>> Thanks,
> >>>
> >>> -JCT
> >>>
> >> --------------------------------------------------------------------
> -
> >> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
> >> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
> > For additional commands, e-mail: users-help_at_grizzly.dev.java.net
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: users-help_at_grizzly.dev.java.net