FW: Grizzly Comet hasn't been registered

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

FW: Grizzly Comet hasn't been registered

John C. Turnbull
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:[hidden email]]
Sent: Friday, 4 January 2008 11:33
To: '[hidden email]'
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:220)
        at
com.sun.grizzly.comet.CometContext.addCometHandler(CometContext.java:266)
        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(ApplicationFi
lterChain.java:411)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:290)
        at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContext
Valve.java:271)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:202)
        at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632
)
        at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577
)
        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206
)
        at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632
)
        at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java: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.java:632
)
        at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java: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.invokeAdapter(
DefaultProcessorTask.java:637)
        at
com.sun.enterprise.web.connector.grizzly.comet.CometEngine.executeServlet(Co
metEngine.java:547)
        at
com.sun.enterprise.web.connector.grizzly.comet.CometEngine.handle(CometEngin
e.java:299)
        at
com.sun.enterprise.web.connector.grizzly.comet.CometAsyncFilter.doFilter(Com
etAsyncFilter.java:87)
        at
com.sun.enterprise.web.connector.grizzly.async.DefaultAsyncExecutor.invokeFi
lters(DefaultAsyncExecutor.java:175)
        at
com.sun.enterprise.web.connector.grizzly.async.DefaultAsyncExecutor.interrup
t(DefaultAsyncExecutor.java:153)
        at
com.sun.enterprise.web.connector.grizzly.async.AsyncProcessorTask.doTask(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(SSLWorkerTh
read.java:106)

Line 88 of ChatServlet is:

                    cometContext.addCometHandler(handler);

Thanks,

-JCT

> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]]
> Sent: Friday, 4 January 2008 09:57
> To: [hidden email]
> 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: [hidden email]
> For additional commands, e-mail: [hidden email]

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: FW: Grizzly Comet hasn't been registered

Jeanfrancois Arcand-2
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

<a href="http://ip:port/grizzlyComet/">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:[hidden email]]
> Sent: Friday, 4 January 2008 11:33
> To: '[hidden email]'
> 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:220)
>         at
> com.sun.grizzly.comet.CometContext.addCometHandler(CometContext.java:266)
>         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(ApplicationFi
> lterChain.java:411)
>         at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
> va:290)
>         at
> org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContext
> Valve.java:271)
>         at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
> va:202)
>         at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632
> )
>         at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577
> )
>         at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
>         at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206
> )
>         at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632
> )
>         at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java: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.java:632
> )
>         at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java: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.invokeAdapter(
> DefaultProcessorTask.java:637)
>         at
> com.sun.enterprise.web.connector.grizzly.comet.CometEngine.executeServlet(Co
> metEngine.java:547)
>         at
> com.sun.enterprise.web.connector.grizzly.comet.CometEngine.handle(CometEngin
> e.java:299)
>         at
> com.sun.enterprise.web.connector.grizzly.comet.CometAsyncFilter.doFilter(Com
> etAsyncFilter.java:87)
>         at
> com.sun.enterprise.web.connector.grizzly.async.DefaultAsyncExecutor.invokeFi
> lters(DefaultAsyncExecutor.java:175)
>         at
> com.sun.enterprise.web.connector.grizzly.async.DefaultAsyncExecutor.interrup
> t(DefaultAsyncExecutor.java:153)
>         at
> com.sun.enterprise.web.connector.grizzly.async.AsyncProcessorTask.doTask(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(SSLWorkerTh
> read.java:106)
>
> Line 88 of ChatServlet is:
>
>                     cometContext.addCometHandler(handler);
>
> Thanks,
>
> -JCT
>
>> -----Original Message-----
>> From: [hidden email] [mailto:[hidden email]]
>> Sent: Friday, 4 January 2008 09:57
>> To: [hidden email]
>> 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: [hidden email]
>> For additional commands, e-mail: [hidden email]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: FW: Grizzly Comet hasn't been registered

John C. Turnbull
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: [hidden email] [mailto:[hidden email]]
> Sent: Tuesday, 8 January 2008 02:49
> To: [hidden email]
> 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
>
> <a href="http://ip:port/grizzlyComet/">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:[hidden email]]
> > Sent: Friday, 4 January 2008 11:33
> > To: '[hidden email]'
> > 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: [hidden email] [mailto:[hidden email]]
> >> Sent: Friday, 4 January 2008 09:57
> >> To: [hidden email]
> >> 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: [hidden email]
> >> For additional commands, e-mail: [hidden email]
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]