Atmosphere / atmosphere

Event Driven WebSockets Framework with Cross-Browser Fallbacks
http://async-io.org/
3.69k stars 749 forks source link

GWT + GlassFish 3.1.2 + Websockets only #511

Closed jurjenvg closed 12 years ago

jurjenvg commented 12 years ago

I had trouble with websockets using atmosphere-gwt on glassfish. Hence I ran the atmosphere-gwt-demo from github on my system. When connecting with Chrome (latest version) I get below server error, after which the client reconnects successfully using XMLHttpRequest. The browser logs are further down below - sample is unchanged clone from GIT. Websockets are enabled in the admin console, I'm running Java

SEVERE: 666157 [http-thread-pool-8080(2)] WARN org.atmosphere.websocket.WebSocketProcessor - Failed invoking AtmosphereFramework.doCometSupport()

SEVERE: java.lang.NullPointerException at com.sun.grizzly.tcp.http11.GrizzlyRequest.doGetSession(GrizzlyRequest.java:2271) at com.sun.grizzly.tcp.http11.GrizzlyRequest.getSession(GrizzlyRequest.java:2226) at com.sun.grizzly.http.servlet.HttpServletRequestImpl.getSession(HttpServletRequestImpl.java:986) at org.atmosphere.cpr.AtmosphereRequest.getSession(AtmosphereRequest.java:588) at org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:194) at org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:165) at org.atmosphere.container.GlassFishWebSocketSupport.service(GlassFishWebSocketSupport.java:111) at org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:1124) at org.atmosphere.websocket.WebSocketProcessor.dispatch(WebSocketProcessor.java:173) at org.atmosphere.websocket.WebSocketProcessor.dispatch(WebSocketProcessor.java:103) at org.atmosphere.container.GlassFishWebSocketSupport$GrizzlyApplication.onConnect(GlassFishWebSocketSupport.java:164) at com.sun.grizzly.websockets.DefaultWebSocket.onConnect(DefaultWebSocket.java:128) at com.sun.grizzly.websockets.WebSocketEngine.upgrade(WebSocketEngine.java:188) at com.sun.grizzly.websockets.WebSocketAsyncFilter.doFilter(WebSocketAsyncFilter.java:54) at com.sun.grizzly.arp.DefaultAsyncExecutor.invokeFilters(DefaultAsyncExecutor.java:171) at com.sun.grizzly.arp.DefaultAsyncExecutor.interrupt(DefaultAsyncExecutor.java:143) at com.sun.grizzly.arp.AsyncProcessorTask.doTask(AsyncProcessorTask.java:102) at com.sun.grizzly.http.TaskBase.run(TaskBase.java:193) at com.sun.grizzly.http.TaskBase.execute(TaskBase.java:175) at com.sun.grizzly.arp.DefaultAsyncHandler.handle(DefaultAsyncHandler.java:145) at com.sun.grizzly.arp.AsyncProtocolFilter.execute(AsyncProtocolFilter.java:210) 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:722)

SEVERE: at com.sun.grizzly.tcp.http11.GrizzlyRequest.doGetSession(GrizzlyRequest.java:2271) SEVERE: at com.sun.grizzly.tcp.http11.GrizzlyRequest.getSession(GrizzlyRequest.java:2226) SEVERE: at com.sun.grizzly.http.servlet.HttpServletRequestImpl.getSession(HttpServletRequestImpl.java:986) SEVERE: at org.atmosphere.cpr.AtmosphereRequest.getSession(AtmosphereRequest.java:588) SEVERE: at org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:194) SEVERE: at org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:165) SEVERE: at org.atmosphere.container.GlassFishWebSocketSupport.service(GlassFishWebSocketSupport.java:111) SEVERE: at org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:1124) SEVERE: at org.atmosphere.websocket.WebSocketProcessor.dispatch(WebSocketProcessor.java:173) SEVERE: at org.atmosphere.websocket.WebSocketProcessor.dispatch(WebSocketProcessor.java:103) SEVERE: at org.atmosphere.container.GlassFishWebSocketSupport$GrizzlyApplication.onConnect(GlassFishWebSocketSupport.java:164) SEVERE: at com.sun.grizzly.websockets.DefaultWebSocket.onConnect(DefaultWebSocket.java:128) SEVERE: at com.sun.grizzly.websockets.WebSocketEngine.upgrade(WebSocketEngine.java:188) SEVERE: at com.sun.grizzly.websockets.WebSocketAsyncFilter.doFilter(WebSocketAsyncFilter.java:54) SEVERE: at com.sun.grizzly.arp.DefaultAsyncExecutor.invokeFilters(DefaultAsyncExecutor.java:171) SEVERE: at com.sun.grizzly.arp.DefaultAsyncExecutor.interrupt(DefaultAsyncExecutor.java:143) SEVERE: at com.sun.grizzly.arp.AsyncProcessorTask.doTask(AsyncProcessorTask.java:102) SEVERE: at com.sun.grizzly.http.TaskBase.run(TaskBase.java:193) SEVERE: at com.sun.grizzly.http.TaskBase.execute(TaskBase.java:175) SEVERE: at com.sun.grizzly.arp.DefaultAsyncHandler.handle(DefaultAsyncHandler.java:145) SEVERE: at com.sun.grizzly.arp.AsyncProtocolFilter.execute(AsyncProtocolFilter.java:210) SEVERE: at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137) SEVERE: at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104) SEVERE: at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90) SEVERE: at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79) SEVERE: at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54) SEVERE: at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59) SEVERE: at com.sun.grizzly.ContextTask.run(ContextTask.java:71) SEVERE: at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532) SEVERE: at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513) SEVERE: at java.lang.Thread.run(Thread.java:722) SEVERE: 666513 [http-thread-pool-8080(2)] WARN org.atmosphere.websocket.protocol.SimpleHttpProtocol - java.lang.NullPointerException Status 500 Message Server Error

SEVERE: 666513 [http-thread-pool-8080(2)] WARN org.atmosphere.websocket.WebSocketProcessor - AtmosphereResource was null

SEVERE: 676153 [http-thread-pool-8080(3)] ERROR org.atmosphere.websocket.protocol.SimpleHttpProtocol - Invalid state. No AtmosphereResource has been suspended

SEVERE: 676155 [http-thread-pool-8080(1)] WARN org.atmosphere.websocket.WebSocketProcessor - Unable to retrieve AtmosphereResource for org.atmosphere.container.version.GrizzlyWebSocket@7e01ebdc

The logs I get in the browser are as follows: Sun Jul 15 17:56:30 GMT+200 2012 org.atmosphere.gwt.client.AtmosphereClient INFO: Created transport: org.atmosphere.gwt.client.impl.WebSocketCometTransport Sun Jul 15 17:56:30 GMT+200 2012 org.atmosphere.gwt.client.impl.WebSocketCometTransport FINE: Creating websocket with url: ws://localhost:8080/atmosphere-gwt-demo/gwtDemo/gwtComet?dsm=RPC&sm=RPC&t=35FAZ6&c=1&tr=WebSocket Sun Jul 15 17:56:30 GMT+200 2012 org.atmosphere.gwt.client.impl.WebSocketCometTransport FINE: Websocket connection opened Sun Jul 15 17:56:40 GMT+200 2012 org.atmosphere.samples.client.GWTDemo INFO: comet.beforeDisconnected Sun Jul 15 17:56:40 GMT+200 2012 org.atmosphere.gwt.client.impl.ServerTransportProtocol FINEST: Send succesfull Sun Jul 15 17:56:40 GMT+200 2012 org.atmosphere.samples.client.GWTDemo SEVERE: comet.error connected=false org.atmosphere.gwt.client.TimeoutException: http://localhost:8080/atmosphere-gwt-demo/gwtDemo/gwtComet timeout has expired after 10000ms at Unknown.Exception_0(Unknown Source) at Unknown.TimeoutException_0(Unknown Source) at Unknown.run_1(Unknown Source) at Unknown.fire(Unknown Source) at Unknown.anonymous(Unknown Source) at Unknown.apply(Unknown Source) at Unknown.entry0(Unknown Source) Sun Jul 15 17:56:40 GMT+200 2012 org.atmosphere.gwt.client.impl.WebSocketCometTransport FINE: Websocket connection closed Sun Jul 15 17:56:40 GMT+200 2012 org.atmosphere.gwt.client.AtmosphereClient INFO: Server does not support WebSockets Sun Jul 15 17:56:40 GMT+200 2012 org.atmosphere.samples.client.GWTDemo INFO: comet.connected [20000, 1]

jfarcand commented 12 years ago

Which version of Atmosphere? There is an issue with GlassFish + Session

http://java.net/jira/browse/GLASSFISH-18856

Can you try with the latest 1.0.0-SNAPSHOT?

jurjenvg commented 12 years ago

Please disregard my last post. I ran a new test with GF3.1.2.2 (websockets+comet enabled), atmo 1.0.0-SNAPSHOT and try connecting to the sample project's http://localhost:8080/atmosphere-gwt-demo/gwtDemo/gwtDemo.jsp with Google Chrome 22.0.1207.1 dev-m and FireFox 14. I set a breakpoint on first line of AtmosphereHandler#doComet, its never hit. Instead I get below exceptions with both browsers. From what I read in client logs the initial websocket connect is OK but something goes wrong immedeately after. Connecting with IE9 works fine (no websockets) and breakpoint is hit.


Client LOGS:


Thu Jul 19 09:00:36 GMT+200 2012 org.atmosphere.gwt.client.AtmosphereClient INFO: Created transport: org.atmosphere.gwt.client.impl.WebSocketCometTransport Thu Jul 19 09:00:36 GMT+200 2012 org.atmosphere.gwt.client.impl.WebSocketCometTransport FINE: Creating websocket with url: ws://localhost:8080/atmosphere-gwt-demo/gwtDemo/gwtComet?dsm=RPC&sm=RPC&t=8C1JT1&c=1&tr=WebSocket Thu Jul 19 09:00:36 GMT+200 2012 org.atmosphere.gwt.client.impl.WebSocketCometTransport FINE: Websocket connection opened Thu Jul 19 09:00:46 GMT+200 2012 org.atmosphere.samples.client.GWTDemo INFO: comet.beforeDisconnected Thu Jul 19 09:00:46 GMT+200 2012 org.atmosphere.gwt.client.impl.ServerTransportProtocol FINEST: Send succesfull Thu Jul 19 09:00:46 GMT+200 2012 org.atmosphere.samples.client.GWTDemo SEVERE: comet.error connected=false org.atmosphere.gwt.client.TimeoutException: http://localhost:8080/atmosphere-gwt-demo/gwtDemo/gwtComet timeout has expired after 10000ms


GF Logs


SEVERE: 111499 [http-thread-pool-8080(4)] WARN org.atmosphere.websocket.WebSocketProcessor - Failed invoking AtmosphereFramework.doCometSupport()

SEVERE: org.atmosphere.cpr.AtmosphereMappingException: No AtmosphereHandler maps request for /gwtDemo/gwtComet at org.atmosphere.cpr.AsynchronousProcessor.map(AsynchronousProcessor.java:355) at org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:206) at org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:166) at org.atmosphere.container.GlassFishWebSocketSupport.service(GlassFishWebSocketSupport.java:111) at org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:1222) at org.atmosphere.websocket.WebSocketProcessor.dispatch(WebSocketProcessor.java:187) at org.atmosphere.websocket.WebSocketProcessor$2.run(WebSocketProcessor.java:162) at org.atmosphere.util.VoidExecutorService.execute(VoidExecutorService.java:101) at org.atmosphere.websocket.WebSocketProcessor.dispatch(WebSocketProcessor.java:157) at org.atmosphere.websocket.WebSocketProcessor.invokeWebSocketProtocol(WebSocketProcessor.java:145) at org.atmosphere.container.GlassFishWebSocketSupport$GrizzlyApplication.onMessage(GlassFishWebSocketSupport.java:186) at com.sun.grizzly.websockets.DefaultWebSocket.onMessage(DefaultWebSocket.java:164) at com.sun.grizzly.websockets.frametypes.TextFrameType.respond(TextFrameType.java:75) at com.sun.grizzly.websockets.DataFrame.respond(DataFrame.java:102) at com.sun.grizzly.websockets.ProtocolHandler.readFrame(ProtocolHandler.java:151) at com.sun.grizzly.websockets.WebSocketSelectionKeyAttachment.run(WebSocketSelectionKeyAttachment.java:88) 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:722)

SEVERE: at org.atmosphere.cpr.AsynchronousProcessor.map(AsynchronousProcessor.java:355) SEVERE: at org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:206) SEVERE: at org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:166) SEVERE: at org.atmosphere.container.GlassFishWebSocketSupport.service(GlassFishWebSocketSupport.java:111) SEVERE: at org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:1222) SEVERE: at org.atmosphere.websocket.WebSocketProcessor.dispatch(WebSocketProcessor.java:187) SEVERE: at org.atmosphere.websocket.WebSocketProcessor$2.run(WebSocketProcessor.java:162) SEVERE: at org.atmosphere.util.VoidExecutorService.execute(VoidExecutorService.java:101) SEVERE: at org.atmosphere.websocket.WebSocketProcessor.dispatch(WebSocketProcessor.java:157) SEVERE: at org.atmosphere.websocket.WebSocketProcessor.invokeWebSocketProtocol(WebSocketProcessor.java:145) SEVERE: at org.atmosphere.container.GlassFishWebSocketSupport$GrizzlyApplication.onMessage(GlassFishWebSocketSupport.java:186) SEVERE: at com.sun.grizzly.websockets.DefaultWebSocket.onMessage(DefaultWebSocket.java:164) SEVERE: at com.sun.grizzly.websockets.frametypes.TextFrameType.respond(TextFrameType.java:75) SEVERE: at com.sun.grizzly.websockets.DataFrame.respond(DataFrame.java:102) SEVERE: at com.sun.grizzly.websockets.ProtocolHandler.readFrame(ProtocolHandler.java:151) SEVERE: at com.sun.grizzly.websockets.WebSocketSelectionKeyAttachment.run(WebSocketSelectionKeyAttachment.java:88) SEVERE: at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532) SEVERE: at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513) SEVERE: at java.lang.Thread.run(Thread.java:722) SEVERE: 111505 [http-thread-pool-8080(4)] WARN org.atmosphere.websocket.protocol.SimpleHttpProtocol - org.atmosphere.cpr.AtmosphereMappingException: No AtmosphereHandler maps request for /gwtDemo/gwtComet Status 500 Message Server Error

SEVERE: 111640 [http-thread-pool-8080(3)] WARN org.atmosphere.websocket.WebSocketProcessor - Failed invoking AtmosphereFramework.doCometSupport()

SEVERE: org.atmosphere.cpr.AtmosphereMappingException: No AtmosphereHandler maps request for /gwtDemo/gwtComet at org.atmosphere.cpr.AsynchronousProcessor.map(AsynchronousProcessor.java:355) at org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:206) at org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:166) at org.atmosphere.container.GlassFishWebSocketSupport.service(GlassFishWebSocketSupport.java:111) at org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:1222) at org.atmosphere.websocket.WebSocketProcessor.dispatch(WebSocketProcessor.java:187) at org.atmosphere.websocket.WebSocketProcessor.dispatch(WebSocketProcessor.java:116) at org.atmosphere.container.GlassFishWebSocketSupport$GrizzlyApplication.onConnect(GlassFishWebSocketSupport.java:158) at com.sun.grizzly.websockets.DefaultWebSocket.onConnect(DefaultWebSocket.java:140) at com.sun.grizzly.websockets.WebSocketEngine.upgrade(WebSocketEngine.java:189) at com.sun.grizzly.websockets.WebSocketAsyncFilter.doFilter(WebSocketAsyncFilter.java:54) at com.sun.grizzly.arp.DefaultAsyncExecutor.invokeFilters(DefaultAsyncExecutor.java:171) at com.sun.grizzly.arp.DefaultAsyncExecutor.interrupt(DefaultAsyncExecutor.java:143) at com.sun.grizzly.arp.AsyncProcessorTask.doTask(AsyncProcessorTask.java:102) at com.sun.grizzly.http.TaskBase.run(TaskBase.java:193) at com.sun.grizzly.http.TaskBase.execute(TaskBase.java:175) at com.sun.grizzly.arp.DefaultAsyncHandler.handle(DefaultAsyncHandler.java:145) at com.sun.grizzly.arp.AsyncProtocolFilter.execute(AsyncProtocolFilter.java:210) 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:722)

SEVERE: at org.atmosphere.cpr.AsynchronousProcessor.map(AsynchronousProcessor.java:355) SEVERE: at org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:206) SEVERE: at org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:166) SEVERE: at org.atmosphere.container.GlassFishWebSocketSupport.service(GlassFishWebSocketSupport.java:111) SEVERE: at org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:1222) SEVERE: at org.atmosphere.websocket.WebSocketProcessor.dispatch(WebSocketProcessor.java:187) SEVERE: at org.atmosphere.websocket.WebSocketProcessor.dispatch(WebSocketProcessor.java:116) SEVERE: at org.atmosphere.container.GlassFishWebSocketSupport$GrizzlyApplication.onConnect(GlassFishWebSocketSupport.java:158) SEVERE: at com.sun.grizzly.websockets.DefaultWebSocket.onConnect(DefaultWebSocket.java:140) SEVERE: at com.sun.grizzly.websockets.WebSocketEngine.upgrade(WebSocketEngine.java:189) SEVERE: at com.sun.grizzly.websockets.WebSocketAsyncFilter.doFilter(WebSocketAsyncFilter.java:54) SEVERE: at com.sun.grizzly.arp.DefaultAsyncExecutor.invokeFilters(DefaultAsyncExecutor.java:171) SEVERE: at com.sun.grizzly.arp.DefaultAsyncExecutor.interrupt(DefaultAsyncExecutor.java:143) SEVERE: at com.sun.grizzly.arp.AsyncProcessorTask.doTask(AsyncProcessorTask.java:102) SEVERE: at com.sun.grizzly.http.TaskBase.run(TaskBase.java:193) SEVERE: at com.sun.grizzly.http.TaskBase.execute(TaskBase.java:175) SEVERE: at com.sun.grizzly.arp.DefaultAsyncHandler.handle(DefaultAsyncHandler.java:145) SEVERE: at com.sun.grizzly.arp.AsyncProtocolFilter.execute(AsyncProtocolFilter.java:210) SEVERE: at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137) SEVERE: at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104) SEVERE: at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90) SEVERE: at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79) SEVERE: at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54) SEVERE: at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59) SEVERE: at com.sun.grizzly.ContextTask.run(ContextTask.java:71) SEVERE: at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532) SEVERE: at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513) SEVERE: at java.lang.Thread.run(Thread.java:722) SEVERE: 111662 [http-thread-pool-8080(3)] WARN org.atmosphere.websocket.protocol.SimpleHttpProtocol - org.atmosphere.cpr.AtmosphereMappingException: No AtmosphereHandler maps request for /gwtDemo/gwtComet Status 500 Message Server Error

SEVERE: 121633 [http-thread-pool-8080(3)] WARN org.atmosphere.websocket.WebSocketProcessor - Failed invoking AtmosphereFramework.doCometSupport()

SEVERE: org.atmosphere.cpr.AtmosphereMappingException: No AtmosphereHandler maps request for /gwtDemo/gwtComet at org.atmosphere.cpr.AsynchronousProcessor.map(AsynchronousProcessor.java:355) at org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:206) at org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:166) at org.atmosphere.container.GlassFishWebSocketSupport.service(GlassFishWebSocketSupport.java:111) at org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:1222) at org.atmosphere.websocket.WebSocketProcessor.dispatch(WebSocketProcessor.java:187) at org.atmosphere.websocket.WebSocketProcessor$2.run(WebSocketProcessor.java:162) at org.atmosphere.util.VoidExecutorService.execute(VoidExecutorService.java:101) at org.atmosphere.websocket.WebSocketProcessor.dispatch(WebSocketProcessor.java:157) at org.atmosphere.websocket.WebSocketProcessor.invokeWebSocketProtocol(WebSocketProcessor.java:145) at org.atmosphere.container.GlassFishWebSocketSupport$GrizzlyApplication.onMessage(GlassFishWebSocketSupport.java:186) at com.sun.grizzly.websockets.DefaultWebSocket.onMessage(DefaultWebSocket.java:164) at com.sun.grizzly.websockets.frametypes.TextFrameType.respond(TextFrameType.java:75) at com.sun.grizzly.websockets.DataFrame.respond(DataFrame.java:102) at com.sun.grizzly.websockets.ProtocolHandler.readFrame(ProtocolHandler.java:151) at com.sun.grizzly.websockets.WebSocketSelectionKeyAttachment.run(WebSocketSelectionKeyAttachment.java:88) 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:722)

SEVERE: at org.atmosphere.cpr.AsynchronousProcessor.map(AsynchronousProcessor.java:355) SEVERE: at org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:206) SEVERE: at org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:166) SEVERE: at org.atmosphere.container.GlassFishWebSocketSupport.service(GlassFishWebSocketSupport.java:111) SEVERE: at org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:1222) SEVERE: at org.atmosphere.websocket.WebSocketProcessor.dispatch(WebSocketProcessor.java:187) SEVERE: at org.atmosphere.websocket.WebSocketProcessor$2.run(WebSocketProcessor.java:162) SEVERE: at org.atmosphere.util.VoidExecutorService.execute(VoidExecutorService.java:101) SEVERE: at org.atmosphere.websocket.WebSocketProcessor.dispatch(WebSocketProcessor.java:157) SEVERE: at org.atmosphere.websocket.WebSocketProcessor.invokeWebSocketProtocol(WebSocketProcessor.java:145) SEVERE: at org.atmosphere.container.GlassFishWebSocketSupport$GrizzlyApplication.onMessage(GlassFishWebSocketSupport.java:186) SEVERE: at com.sun.grizzly.websockets.DefaultWebSocket.onMessage(DefaultWebSocket.java:164) SEVERE: at com.sun.grizzly.websockets.frametypes.TextFrameType.respond(TextFrameType.java:75) SEVERE: at com.sun.grizzly.websockets.DataFrame.respond(DataFrame.java:102) SEVERE: at com.sun.grizzly.websockets.ProtocolHandler.readFrame(ProtocolHandler.java:151) SEVERE: at com.sun.grizzly.websockets.WebSocketSelectionKeyAttachment.run(WebSocketSelectionKeyAttachment.java:88) SEVERE: at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532) SEVERE: at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513) SEVERE: at java.lang.Thread.run(Thread.java:722) SEVERE: 121647 [http-thread-pool-8080(3)] WARN org.atmosphere.websocket.protocol.SimpleHttpProtocol - org.atmosphere.cpr.AtmosphereMappingException: No AtmosphereHandler maps request for /gwtDemo/gwtComet Status 500 Message Server Error

pierreh commented 12 years ago

Are these logs from the unmodified gwt-demo war? It looks like the correct mapping for the handler is missing.

pierreh commented 12 years ago

From "Thu Jul 19 09:00:36 GMT+200 2012 org.atmosphere.gwt.client.impl.WebSocketCometTransport FINE: Websocket connection opened" it shows that the actual websocket connection is established, but the SimpleHttpProtocol cannot find a matching handler "[http-thread-pool-8080(4)] WARN org.atmosphere.websocket.protocol.SimpleHttpProtocol - org.atmosphere.cpr.AtmosphereMappingException: No AtmosphereHandler maps request for /gwtDemo/gwtComet Status "

jurjenvg commented 12 years ago

I compiled it from github project atomosphere-gwt-demo 1.0.0-SNAPSHOT (only added javaee6-api provided dependency), so all latest version. The mappings are there and work fine with none-websocket browsers such as ie9: the logged error of not finding the handler only occurs with websocket enabled browsers.

pierreh commented 12 years ago

This sounds like a regression. @jfarcand can you look at this?

jfarcand commented 12 years ago

Hum...nothings has changed for weeks in that part. Which version was working? It's maybe a GlassFish fix/regression again. Will look

jfarcand commented 12 years ago

Jetty works pretty well. Not looking at GlassFish.

jfarcand commented 12 years ago

With 3.1.2, I'm getting the following exception:

[#|2012-07-19T08:53:12.105-0400|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=19;_ThreadName=http-thread-pool-8080(1);|java.lang.IllegalStateException: Request path not in servlet context.
    at com.sun.grizzly.http.servlet.HttpServletRequestImpl.getPathInfo(HttpServletRequestImpl.java:828)
    at com.sun.grizzly.websockets.ServerNetworkHandler$WSServletRequestImpl.getPathInfo(ServerNetworkHandler.java:211)
    at org.atmosphere.cpr.AtmosphereRequest.getPathInfo(AtmosphereRequest.java:120)
    at org.atmosphere.cpr.AsynchronousProcessor.map(AsynchronousProcessor.java:318)
    at org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:206)
    at org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:166)
    at org.atmosphere.container.GlassFishWebSocketSupport.service(GlassFishWebSocketSupport.java:112)
    at org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:1257)
    at org.atmosphere.websocket.DefaultWebSocketProcessor.dispatch(DefaultWebSocketProcessor.java:196)
    at org.atmosphere.websocket.DefaultWebSocketProcessor.open(DefaultWebSocketProcessor.java:117)
    at org.atmosphere.container.GlassFishWebSocketSupport$GrizzlyApplication.onConnect(GlassFishWebSocketSupport.java:159)
    at com.sun.grizzly.websockets.DefaultWebSocket.onConnect(DefaultWebSocket.java:128)
    at com.sun.grizzly.websockets.WebSocketEngine.upgrade(WebSocketEngine.java:188)
    at com.sun.grizzly.websockets.WebSocketAsyncFilter.doFilter(WebSocketAsyncFilter.java:54)
    at com.sun.grizzly.arp.DefaultAsyncExecutor.invokeFilters(DefaultAsyncExecutor.java:171)
    at com.sun.grizzly.arp.DefaultAsyncExecutor.interrupt(DefaultAsyncExecutor.java:143)
    at com.sun.grizzly.arp.AsyncProcessorTask.doTask(AsyncProcessorTask.java:102)
    at com.sun.grizzly.http.TaskBase.run(TaskBase.java:193)
    at com.sun.grizzly.http.TaskBase.execute(TaskBase.java:175)
    at com.sun.grizzly.arp.DefaultAsyncHandler.handle(DefaultAsyncHandler.java:145)
    at com.sun.grizzly.arp.AsyncProtocolFilter.execute(AsyncProtocolFilter.java:210)
    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:680)
|#]
``1
Looks like GlassFish has a bug. Will now try with 3.1.2.2.
jfarcand commented 12 years ago

@jurjenvg Hum, with 3.1.2.2, every things works as expected. You may have a wrong atmosphere dependencies.

T 127.0.0.1:8080 -> 127.0.0.1:54504 [AP]
HTTP/1.1 101 Switching Protocols.
Upgrade: websocket.
Connection: Upgrade.
Sec-WebSocket-Accept: OsAsAMyLQqhLjdkda6u/z4X1DCw=.
.

T 127.0.0.1:8080 -> 127.0.0.1:54504 [AP]
..c;c;20000;1#@@#

T 127.0.0.1:54504 -> 127.0.0.1:8080 [AP]
......6...T...........^.......................[...^...........Y...B...Y.......s.......u...................Y...W...E...D...W...S...Z...B...S...............S...P.......S...C...Q...Y...W.............

T 127.0.0.1:8080 -> 127.0.0.1:54504 [AP]
.io;[2,'A',1,["org.atmosphere.samples.client.Event/2334579035","Send from client using broadcast"],0,7]#@@#

T 127.0.0.1:54504 -> 127.0.0.1:8080 [AP]
..........^.!:..'q..$qF.d}..?<..>=..><.. 5..qyC.c}F.bh..gy..u`A.wzZ.u`A.l8..%:k.&5..&Im.&L.. I..V?..)5..SqA.w#O.}b].xh\.>~O.`aK.>nB.ucZ.U{K.d"..#9..)=..l^K.t-H..`..|dK.d-[.ycI.`b].l<R.l>R.l9R

T 127.0.0.1:8080 -> 127.0.0.1:54504 [AP]
.do;[2,'B',1,["org.atmosphere.samples.client.Event/2334579035","Send from client using post"],0,7]#@@#

T 127.0.0.1:8080 -> 127.0.0.1:54504 [AP]
..c;h#@@#

T 127.0.0.1:8080 -> 127.0.0.1:54504 [AP]
..c;h#@@#

T 127.0.0.1:8080 -> 127.0.0.1:54504 [AP]
..c;h#@@#

T 127.0.0.1:8080 -> 127.0.0.1:54504 [AP]
..c;h#@@#

T 127.0.0.1:8080 -> 127.0.0.1:54504 [AP]
..c;h#@@#
jfarcand commented 12 years ago

@pierreh Ok I've fixed the 3.1.2 exception above (added workaround). Now the demo doesn't have any exception but I don't see the notification bar like in 3.1.2.2. Can you take a look once you have a chance?

jurjenvg commented 12 years ago

I finally managed to get the example working on a GF upgraded from 3.1.2->3.1.2.2, the glassfish bundled with the latest netbeans dev (which was also 3.1.2.2 build 5) didn't play and had other issues too unrelated to Atmosphere. However, in our own app, the atmo comet servlet is protected by a security constraint. In the doComet(), I do a resource.getAtmosphereResource().getRequest().getUserPrincipal() to get the username of the user making the request. When using Grizzly comet (e.g. connecting with IE9), I get the Principal as expected, using websockets I don't. I ran the debugger and it seems that upon connecting to comet, I get a different session-id than the one of the session created upon logon of the user, which explains the user not having logged on.

BTW it seems that below init param on the atmo servlet is required, I copied it from the example and it solved problems in our own app.

    <init-param>
        <param-name>org.atmosphere.disableOnStateEvent</param-name>
        <param-value>true</param-value>
    </init-param>
jurjenvg commented 12 years ago

Gosh it seems I'm hit by http://java.net/jira/browse/GRIZZLY-1289 as the patched version 1.9.51 is not included in GF 3.1.2.2 (it uses 1.9.5.50)

pierreh commented 12 years ago

Yes it is there for a good reason ;-)

On 20-7-2012 8:57, jurjenvg wrote:

BTW it seems that below init param on the atmo servlet is required, I copied it from the example and it solved problems in our own app.

     <init-param>
         <param-name>org.atmosphere.disableOnStateEvent</param-name>
         <param-value>true</param-value>
     </init-param>
pierreh commented 12 years ago

You can give it a try by replacing the grizzly-websockets.jar

On 20-7-2012 9:06, jurjenvg wrote:

Gosh it seems I'm hit by http://java.net/jira/browse/GRIZZLY-1289 as the patched version 1.9.51 is not included in GF 3.1.2.2 (it uses 1.9.5.50)


Reply to this email directly or view it on GitHub: https://github.com/Atmosphere/atmosphere/issues/511#issuecomment-7123799

jurjenvg commented 12 years ago

I did and it works fine now!

On Fri, Jul 20, 2012 at 10:55 AM, Pierre < reply@reply.github.com

wrote:

You can give it a try by replacing the grizzly-websockets.jar

On 20-7-2012 9:06, jurjenvg wrote:

Gosh it seems I'm hit by http://java.net/jira/browse/GRIZZLY-1289 as the patched version 1.9.51 is not included in GF 3.1.2.2 (it uses 1.9.5.50)


Reply to this email directly or view it on GitHub: https://github.com/Atmosphere/atmosphere/issues/511#issuecomment-7123799


Reply to this email directly or view it on GitHub: https://github.com/Atmosphere/atmosphere/issues/511#issuecomment-7125444