GWT Comet integration help

77 views
Skip to first unread message

Noor

unread,
Nov 26, 2010, 7:20:45 AM11/26/10
to gwt-comet
Hi, I am getting some difficulties with comet on the server

First, I am working with the default configuration of the gwt hosted
mode(i.e. using jetty), do i need to make any change to enable comet

Now, on the server what I want is a client will send a request and
then he will be enrolled in a so-called group. Whenever, any change
happens to all group, all client connected to that group are made
aware.

When initiating a comet connection on the client, I am getting this
error
Error 405 HTTP method GET is not supported by this URL

Can someone help with this??

Noor

unread,
Nov 26, 2010, 5:17:06 PM11/26/10
to gwt-comet
Hi, I am getting this error when trying to gwt-comet

[WARN] 405 - GET /trycomet/greet?t=2UGMNJ&c=45 (127.0.0.1) 1470 bytes
Request headers
Host: 127.0.0.1:8888
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:
1.9.2.12) Gecko/20101026 Firefox/3.6.12
Accept: application/comet
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Referer: http://127.0.0.1:8888/TryComet.html?gwt.codesvr=127.0.0.1:9997
Cookie: JSESSIONID=964bqzlrkbll
Response headers
Content-Type: text/html; charset=iso-8859-1
Content-Length: 1470
com.google.gwt.user.client.rpc.StatusCodeException: 405 <html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1"/>
<title>Error 405 HTTP method GET is not supported by this URL</title>
</head>
<body><h2>HTTP ERROR: 405</h2><pre>HTTP method GET is not supported by
this URL</pre>
<p>RequestURI=/trycomet/greet</p><p><i><small><a href="http://
jetty.mortbay.org/">Powered by Jetty://</a></small></i></p><br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>

</body>
</html>

at
net.zschech.gwt.comet.client.impl.HTTPRequestCometTransport.onReceiving(HTTPRequestCometTransport.java:
150)
at
net.zschech.gwt.comet.client.impl.HTTPRequestCometTransport.onLoaded(HTTPRequestCometTransport.java:
139)
at net.zschech.gwt.comet.client.impl.HTTPRequestCometTransport.access
$1(HTTPRequestCometTransport.java:136)
at net.zschech.gwt.comet.client.impl.HTTPRequestCometTransport
$2.onReadyStateChange(HTTPRequestCometTransport.java:112)
at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:
103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:
71)
at
com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:
157)
at
com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:
326)
at
com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:
207)
at
com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:
126)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:
561)
at
com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:
269)
at
com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:
91)
at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:214)
at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:
103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:
71)
at
com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:
157)
at
com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:
281)
at
com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:
531)
at
com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:
352)
at java.lang.Thread.run(Thread.java:662)

Richard Zschech

unread,
Nov 26, 2010, 6:12:14 PM11/26/10
to gwt-comet
Hi Noor,

You really shouldn't spam all communication channels with the same
questions. I live in Australia and when you posted your initial
question I was at my traditional Friday night drinks at the pub. On
Saturdays I tend to sleep in late as well. Perhaps you should read
this guild on asking forum questions: http://www.catb.org/~esr/faqs/smart-questions.html

What version of GWT are you using?
What version of gwt-comet are you using?
What version of Jetty are you using?

Does the gwt-comet-examples.war work for you?

From your error I would guess you are giving the the CometClient the
wrong url as the CometServlet most definitely does support GET.

Check that your web.xml is consistent with the url you are using for
your CometClient.

From Richard.
> com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChanne lServer.java:
> 281)
>         at
> com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChan nelServer.java:

Richard Zschech

unread,
Nov 28, 2010, 5:40:08 AM11/28/10
to gwt-...@googlegroups.com
Hi Noor,

The "D" example you sent me the other day does a RPC call to the greeting service and then before the RPC call complete calls cometClient.start(). cometClient has not been initialised at this point and calling start() causes a NullPointerException. You need to call start() after the cometClient is initialised in the onSucess() RPC callback.

Also the URL you are using for the comet client is: GWT.getModuleBaseURL() + "greet". This seems to the URL of your RPC service not of the comet servlet. The error you we reporting previously "Error 405 HTTP method GET is not supported by this URL" is evidence of this as the RPC uses POST as opposed to comet using GET.

Make sure your comet servlet is configured on a different URL to your RPC service.

Hope this helps.

From Richard.


On 27/11/2010, at 12:47 PM, Noor wrote:

> Hi, I am very sorry Richard but I think you are the only one who can
> help, here in Mauritius, Hardly anyone know about this, on the forum,
> very little is able to help, I've been trying this for the past 2-3
> days,I've even dropped the idea of using comet but as per my system,
> i've got to use it.
> In my web.xml, l've this part
> <servlet>
> <servlet-name>greetServlet</servlet-name>
> <servlet-class>com.TryComet.server.GreetingServiceImpl</servlet-
> class>
> </servlet>
>
> <servlet-mapping>
> <servlet-name>greetServlet</servlet-name>
> <url-pattern>/trycomet/greet</url-pattern>
> </servlet-mapping>
>
> and I'm setting the CometClient client = new
> CometClient(GWT.getModuleBaseURL()+"greet", listener);
>
> I'm very sorry for that I may be disrupted you. In case you are busy,
> then doesn't matter, just ignore this mail
>
> Thanks
> regards
> Noor
>

Noor

unread,
Nov 28, 2010, 9:42:43 AM11/28/10
to gwt-comet


Thanks
Richard Zschech for the beautiful addon u created for gwt making our
lives much easier. I'm getting some minor error but I will try to
correct it myself

regards
Noor
Reply all
Reply to author
Forward
0 new messages