atmosphere-samples icon indicating copy to clipboard operation
atmosphere-samples copied to clipboard

Long-polling: Broadcast to resource in quick succession - resource cannot be acquired

Open LeeDavidMalcolm opened this issue 7 years ago • 0 comments

Originally raised in google group: https://groups.google.com/forum/#!topic/atmosphere-framework/XQ9OUm-y-XA

Hi,

Having this issue using the latest server side Atmosphere 2.4.5 whereby the initial long polling subscribe GET returns the resource Id correctly but then the next GET request for the initial long poll throws the following:

o.atmosphere.cpr.DefaultBroadcaster - Duplicate resource c5c03578-8f8d-431c-b1ac-665cf5ac4912. Could be caused by a dead connection not detected by your server. Replacing the old one with the fresh one
10:45:41.112 [Default Executor-thread-791] ERROR o.a.cpr.AsynchronousProcessor - Interceptor Atmosphere LifeCycle crashed. Processing will continue with other interceptor.
java.lang.ClassCastException: java.lang.String cannot be cast to org.atmosphere.cpr.AtmosphereResource
    at org.atmosphere.cpr.AtmosphereRequestImpl.resource(AtmosphereRequestImpl.java:854)

I am using the default interceptors. Have also tried adding the following: org.atmosphere.interceptor.AtmosphereResourceLifecycleInterceptor, org.atmosphere.interceptor.AtmosphereResourceLifecycleInterceptor, org.atmosphere.interceptor.AtmosphereResourceStateRecovery, org.atmosphere.interceptor.AtmosphereResourceStateRecovery.BroadcasterTracker, org.atmosphere.interceptor.AtmosphereResourceStateRecovery.OnAlwaysSuspend,

But if I manually do the same calls and do a POST for the initial subscribe and the first long poll is still a GET then it connects fine and the open event in the managed service is fired successfully and I can broadcast to that resource.

Also have now tested editing the atmosphere.js to make a POST request initially which also resolves the issue but ideally I don't want to do that.

The setup is long-polling on IBM websphere 8.5.5.4

What could be the cause of this?

Thanks, Lee

LeeDavidMalcolm avatar Aug 04 '16 14:08 LeeDavidMalcolm