users@grizzly.java.net

Re: Unable to get Comet working on Amazon EC2 - getting "Make sure you have enabled Comet or make sure the Thread invoking that method is the same as the Servlet.service() Thread."

From: Oleksiy Stashok <oleksiy.stashok_at_oracle.com>
Date: Tue, 14 Jun 2011 12:23:44 +0200

Hi,

please use

asadmin set
configs.config.server-config.network-config.protocols.protocol.http-listener-1.http.comet-support-enabled=true

to enable comet for http-listener-1.

WBR,
Alexey.

On 06/13/2011 07:08 PM, Srinivasan Ramachandran wrote:
>
> I'm trying to execute a simple Comet example on my Amazon EC2 (running
> Ubuntu 10.10).
>
> Some data points:
>
> 1. My war file is deployed fine but the issue happens when a client
> tries to connect.
>
> 2. Glassfish itself seems to run fine ( I was able to deploy and run a
> sample "HelloClient" war).
>
> 3. I was able to get the SAME example (as in point 1) to run fine on
> my desktop Ubuntu (which runs Ubuntu 10.04 LTS - The Lucid Lynx).
>
> 4. This is the error is see in the server log:
>
> [#|2011-06-13T16:14:25.758+0000|WARNING|glassfish3.1|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=42;_ThreadName=Thread-1;|StandardWrapperValve[Comet4JavaClientBroadcast]:
> PWC1406: Servlet.service() for servlet Comet4JavaClientBroadcast threw
> 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.addCometHandler(CometContext.java:288)
>
> at
> com.sun.grizzly.comet.CometContext.addCometHandler(CometContext.java:307)
>
> at
> Comet4JavaClientBroadcast.doPost(Comet4JavaClientBroadcast.java:169)
>
> at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
>
> at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
>
> at
> org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1534)
>
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
>
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
>
> at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
>
> at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
>
> at
> com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
>
> at
> com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
>
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
>
> at
> org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:326)
>
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:227)
>
> at
> com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:170)
>
> at
> com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822)
>
> at
> com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719)
>
> at
> com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013)
>
> at
> com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
>
> at
> com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
>
> at
> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
>
> at
> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
>
> at
> com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
>
> at
> com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
>
> at
> com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
>
> at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
>
> at
> com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
>
> at
> com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
>
> at java.lang.Thread.run(Thread.java:636)
>
> |#]
>
> 5. For my desktop Ubuntu, I believe, I just installed glassfish from
> http://download.java.net/glassfish/3.1/release/glassfish-3.1-web-ml.zip and
> Comet was enabled, by default (as far as I remember). I used the same
> version for my Amazon EC2 image but Comet is not enabled, looks like.
>
> 6. I tried following
> http://jfarcand.wordpress.com/2008/02/22/comet-support-in-glassfish/
> to tweak the domain.xml to enable Comet support but was not successful.
>
> 7. Unfortunately, I don't have access to Glassfish Admin console (port
> 4848), even though the initial message says that this aspect is fine.
> So, I have to rely on modifying the domain.xml rather that using the GUI.
>
> Any ideas to help enable Comet support in my Amazon EC2 glassfish
> would be highly appeciated ! Please let me know if you need more data.
>
> Regards,
>
> Srini
>
>
> ***************************************************************************************
> This e-mail and its attachments are private and may contain
> confidential and proprietary information that is protected.
> If you are not the intended recipient, you are hereby notified that
> any disclosure, copying, distribution or use of the
> information contained in or attached to this message is strictly
> prohibited. If you have received this e-mail in error,
> please notify the sender by replying to this message, and then delete
> it from your system. Thank you.