Hi Simone -
I am now using the GWT bindings you referred me to, and am able to
handshake from teh GWT/Javascript client.
I have a very simplistic code setup now as I am still debugging/trying
to get a stable setup, so I am not yet even trying to send any
messages between server and client. After making the handshake, I am
now seeing an endless string of errors/exceptions in the Eclipse
console output, like below.
The code I have currently is this:
SERVER - (in GWT RemoteServiceServlet.init() )
// for CometD/Bayeux
if (bayeux == null) {
bayeux =
(BayeuxServer)getServletContext().getAttribute(BayeuxServer.ATTRIBUTE);
}
CLIENT - (in GWT view constructor)
// Set up a cometd/bayeux listener to listen for dashboard
events.
CometDConfiguration config = new CometDConfiguration("http://
127.0.0.1:8080/cometd");
config.setLogLevel(LogLevel.debug);
CometD cometd = new CometD(config);
cometd.handshake();
WEB.XML -
<servlet>
<servlet-name>cometd</servlet-name>
<servlet-class>org.cometd.server.CometdServlet</servlet-class>
<load-on-startup>1</load-on-startup>
<init-param>
<param-name>timeout</param-name>
<param-value>60000</param-value>
</init-param>
<init-param>
<param-name>logLevel</param-name>
<param-value>3</param-value>
</init-param>
</servlet>
I have no other cometd code in either the client or server, so I'm
confused about why anything would be happening after the handshake -
since I'm not explicitly publishing or subscribing anything.
I am using Jetty6, with the Jetty7 continuations.
The exceptions I'm seeing below happen after the handshake(),
immediately following the first client application request. After the
first request, there is a continuous stream of these exceptions.
After the CometdServlet starts, I do see this in the log:
5/23/12 10:51:37 AM EDT [INFO] [org.cometd.server.BayeuxServerImpl.
1395965500] Added channel /meta
5/23/12 10:51:37 AM EDT [INFO] [org.cometd.server.BayeuxServerImpl.
1395965500] Added channel /meta/handshake
5/23/12 10:51:37 AM EDT [INFO] [org.cometd.server.BayeuxServerImpl.
1395965500] Added channel /meta/connect
5/23/12 10:51:37 AM EDT [INFO] [org.cometd.server.BayeuxServerImpl.
1395965500] Added channel /meta/subscribe
5/23/12 10:51:37 AM EDT [INFO] [org.cometd.server.BayeuxServerImpl.
1395965500] Added channel /meta/unsubscribe
5/23/12 10:51:37 AM EDT [INFO] [org.cometd.server.BayeuxServerImpl.
1395965500] Added channel /meta/disconnect
5/23/12 10:51:37 AM EDT [INFO] [org.cometd.server.BayeuxServerImpl.
1395965500] Allowed Transports: [callback-polling, long-polling]
Can you give any explanation or suggestions about this? Let me know
if I can provide any other information.
Thanks again,
Don P.
EXCEPTIONS
----------
5/23/12 10:48:41 AM EDT [ERROR] [org.mortbay.log] /cometd/connect
java.lang.IllegalStateException: STREAM
at org.mortbay.jetty.Response.getWriter(Response.java:616)
at org.cometd.server.transport.JSONTransport.send(JSONTransport.java:
84)
at
org.cometd.server.transport.LongPollingTransport.handle(LongPollingTransport.java:
348)
at org.cometd.server.CometdServlet.service(CometdServlet.java:181)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
511)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1221)
at
com.wily.webserver.filter.RequestLocaleFilter.doFilter(RequestLocaleFilter.java:
46)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1212)
at
com.wily.introscope.webapps.common.filter.WebViewSSOFilter.doFilter(WebViewSSOFilter.java:
105)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1212)
at
com.wily.introscope.webapps.common.filter.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:
151)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1212)
at com.wily.introscope.webview.server.IntroscopeWebView
$ConnectionFilter.doFilter(IntroscopeWebView.java:452)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1212)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:
399)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:
216)
at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:
182)
at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:
766)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
450)
at
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:
230)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
542)
at org.mortbay.jetty.HttpConnection
$RequestHandler.content(HttpConnection.java:945)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.jetty.bio.SocketConnector
$Connection.run(SocketConnector.java:228)
at org.mortbay.thread.BoundedThreadPool
$PoolThread.run(BoundedThreadPool.java:451)
5/23/12 10:48:41 AM EDT [INFO] [org.cometd.server.BayeuxServerImpl.
1165666909] > {id=14873, connectionType=long-polling,
advice={timeout=0}, channel=/meta/connect,
clientId=2p3s016299vb9fnmvpkv4qzid} 2p3s016299vb9fnmvpkv4qzid - last
connect 0 ms ago
5/23/12 10:48:41 AM EDT [INFO] [org.cometd.server.BayeuxServerImpl.
1165666909] >> {id=14873, connectionType=long-polling,
advice={timeout=0}, channel=/meta/connect,
clientId=2p3s016299vb9fnmvpkv4qzid}
5/23/12 10:48:41 AM EDT [INFO] [org.cometd.server.BayeuxServerImpl.
1165666909] << {id=14873, successful=true, advice={interval=0,
reconnect=retry, timeout=60000}, channel=/meta/connect}
5/23/12 10:48:41 AM EDT [INFO] [org.cometd.server.BayeuxServerImpl.
1165666909] < {id=14873, successful=true, advice={interval=0,
reconnect=retry, timeout=60000}, channel=/meta/connect}
5/23/12 10:48:41 AM EDT [INFO] [org.cometd.server.BayeuxServerImpl.
1165666909] > {id=14874, connectionType=long-polling, channel=/meta/
connect, clientId=2p3s016299vb9fnmvpkv4qzid} 2p3s016299vb9fnmvpkv4qzid
- last connect 0 ms ago
5/23/12 10:48:41 AM EDT [INFO] [org.cometd.server.BayeuxServerImpl.
1165666909] >> {id=14874, connectionType=long-polling, channel=/meta/
connect, clientId=2p3s016299vb9fnmvpkv4qzid}
5/23/12 10:48:41 AM EDT [INFO] [org.cometd.server.BayeuxServerImpl.
1165666909] << {id=14874, successful=true, channel=/meta/connect}
5/23/12 10:48:41 AM EDT [INFO] [org.cometd.server.BayeuxServerImpl.
1165666909] > {id=14875, connectionType=long-polling,
advice={timeout=0}, channel=/meta/connect,
clientId=2p3s016299vb9fnmvpkv4qzid} 2p3s016299vb9fnmvpkv4qzid - last
connect 0 ms ago
5/23/12 10:48:41 AM EDT [INFO] [org.cometd.server.BayeuxServerImpl.
1165666909] >> {id=14875, connectionType=long-polling,
advice={timeout=0}, channel=/meta/connect,
clientId=2p3s016299vb9fnmvpkv4qzid}
5/23/12 10:48:41 AM EDT [INFO] [org.cometd.server.BayeuxServerImpl.
1165666909] << {id=14875, successful=true, advice={interval=0,
reconnect=retry, timeout=60000}, channel=/meta/connect}
5/23/12 10:48:41 AM EDT [INFO] [org.cometd.server.BayeuxServerImpl.
1165666909] < {id=14875, successful=true, advice={interval=0,
reconnect=retry, timeout=60000}, channel=/meta/connect}
----------