-
-
Notifications
You must be signed in to change notification settings - Fork 756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GWT + GlassFish 3.1.2 + Websockets only #511
Comments
Which version of Atmosphere? There is an issue with GlassFish + Session
Can you try with the latest 1.0.0-SNAPSHOT? |
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 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 SEVERE: at org.atmosphere.cpr.AsynchronousProcessor.map(AsynchronousProcessor.java:355) 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 SEVERE: at org.atmosphere.cpr.AsynchronousProcessor.map(AsynchronousProcessor.java:355) 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 SEVERE: at org.atmosphere.cpr.AsynchronousProcessor.map(AsynchronousProcessor.java:355) |
Are these logs from the unmodified gwt-demo war? It looks like the correct mapping for the handler is missing. |
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 " |
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. |
This sounds like a regression. |
Hum...nothings has changed for weeks in that part. Which version was working? It's maybe a GlassFish fix/regression again. Will look |
Jetty works pretty well. Not looking at GlassFish. |
With 3.1.2, I'm getting the following exception:
|
@jurjenvg Hum, with 3.1.2.2, every things works as expected. You may have a wrong atmosphere dependencies.
|
@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? |
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.
|
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) |
Yes it is there for a good reason ;-) On 20-7-2012 8:57, jurjenvg wrote:
|
You can give it a try by replacing the grizzly-websockets.jar On 20-7-2012 9:06, jurjenvg wrote:
|
I did and it works fine now! On Fri, Jul 20, 2012 at 10:55 AM, Pierre <
|
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]
The text was updated successfully, but these errors were encountered: