ActiveMQ Websphere 8.5 long polling

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

ActiveMQ Websphere 8.5 long polling

tony
Dear All

The activemq long polling (using the reverse ajax + servlet3 continuation + asynchronous context) is working correctly under tomcat and weblogic. when deploying under websphere 8.5 we are getting an error with long polling ajax request : java.lang.IllegalStateException: called setTimeout after the container-initiated dispatch which called startAsync has returned

Caused by: java.lang.IllegalStateException: called setTimeout after the container-initiated dispatch which called startAsync has returned
        at com.ibm.ws.webcontainer.async.AsyncContextImpl.setTimeout(AsyncContextImpl.java:640)
        at org.eclipse.jetty.continuation.Servlet3Continuation.setTimeout(Servlet3Continuation.java:179)
        at org.apache.activemq.web.MessageListenerServlet.doMessages(MessageListenerServlet.java:325)

Please any advise? is there a specific configuration to be done for websphere 8.5?
Thank you
Reply | Threaded
Open this post in threaded view
|

Re: ActiveMQ Websphere 8.5 long polling

zmhassan
Hi,

I'm learning push technology and what I've learned is when doing reverse
ajax using push technology on the serverside you will need to use servlet
modified using NIO. Probably the reason why it works on Tomcat is because
it implements the Comet API. To get a client to be notified through push
notification you will need an event listener which must be linked to the
Comet API. Every time events occur it sends back information from the
server to the browser. Some interesting technologies you can try is DWR,
Google Gears, or a new one called
Atmosphere<https://github.com/Atmosphere/atmosphere>.


Please correct me if im wrong. This error seems to be coming from the
serverside. Since it works in tomcat, weblogic.

I have not used websphere but I want to make sure your request is
processed. Can you login to jira and open a ticket for this so it is not
forgotten.

Thanks,
Zak




On Mon, May 19, 2014 at 4:37 AM, tony <[hidden email]> wrote:

> Dear All
>
> The activemq long polling (using the reverse ajax + servlet3 continuation +
> asynchronous context) is working correctly under tomcat and weblogic. when
> deploying under websphere 8.5 we are getting an error with long polling
> ajax
> request : java.lang.IllegalStateException: called setTimeout after the
> container-initiated dispatch which called startAsync has returned
>
> Caused by: java.lang.IllegalStateException: called setTimeout after the
> container-initiated dispatch which called startAsync has returned
>         at
>
> com.ibm.ws.webcontainer.async.AsyncContextImpl.setTimeout(AsyncContextImpl.java:640)
>         at
>
> org.eclipse.jetty.continuation.Servlet3Continuation.setTimeout(Servlet3Continuation.java:179)
>         at
>
> org.apache.activemq.web.MessageListenerServlet.doMessages(MessageListenerServlet.java:325)
>
> Please any advise? is there a specific configuration to be done for
> websphere 8.5?
> Thank you
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-Websphere-8-5-long-polling-tp4681242.html
> Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: ActiveMQ Websphere 8.5 long polling

tony
Dear All,

I found a solution under websphere 8.5 by setting the timeout to 0 in amq.js. Then everything start working correctly except an error that appear in websphere logs inside SystemOut.log :

[6/3/14 15:42:22:305 EEST] 000000a4 AjaxListener  E org.apache.activemq.web.AjaxListener onMessageAvailable Error receiving message java.lang.NullPointerException
                                 java.lang.NullPointerException
        at com.ibm.ws.webcontainer.srt.SRTServletRequest$SRTServletRequestHelper.access$2600(SRTServletRequest.java:3193)
        at com.ibm.ws.webcontainer.srt.SRTServletRequest.isAsyncStarted(SRTServletRequest.java:3379)
        at org.eclipse.jetty.continuation.Servlet3Continuation.isSuspended(Servlet3Continuation.java:155)
        at org.apache.activemq.web.AjaxListener.onMessageAvailable(AjaxListener.java:71)
        at org.apache.activemq.ActiveMQMessageConsumer.dispatch(ActiveMQMessageConsumer.java:1343)
        at org.apache.activemq.ActiveMQSessionExecutor.dispatch(ActiveMQSessionExecutor.java:131)
        at org.apache.activemq.ActiveMQSessionExecutor.iterate(ActiveMQSessionExecutor.java:202)
        at org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:129)
        at org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:47)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1156)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:626)
        at java.lang.Thread.run(Thread.java:780)

Also note that in web.xml all servlets and filters has the property <async-supported>true</async-supported>.
Please any advise ?
Thank you