You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by sdwcn <sd...@hotmail.com> on 2011/09/04 18:11:51 UTC

amq5.5 + ajax + glassfish

Hi All,

I embedded amq5.50 to glassfish v3, and successfully deployed
activemq-web-demo-5.5.0.war into glassfish, when i run the example from demo
(i.e. ajax client - chat.html, after click 'join'), it seems everything work
as expected, however when i open up glassfish server.log, i found it throws
the same exceptions every second as shown below (guessing the frequency that
the exceptions triggered is same as long polling that you get an empty
ajax-response when ur client listening)

/[#|2011-09-04T21:46:54.250+0800|WARNING|glassfish3.1.1|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=28;_ThreadName=Thread-2;|StandardWrapperValve[AjaxServlet]:
PWC1406: Servlet.service() for servlet AjaxServlet threw exception
java.lang.IllegalStateException: Request is within the scope of a filter or
servlet that does not support asynchronous operations
	at org.apache.catalina.connector.Request.startAsync(Request.java:3865)
	at org.apache.catalina.connector.Request.startAsync(Request.java:3817)
	at
org.apache.catalina.connector.RequestFacade.startAsync(RequestFacade.java:1040)
	at
org.eclipse.jetty.continuation.Servlet3Continuation.suspend(Servlet3Continuation.java:184)
	at
org.apache.activemq.web.MessageListenerServlet.doMessages(MessageListenerServlet.java:321)
	at
org.apache.activemq.web.MessageListenerServlet.doGet(MessageListenerServlet.java:241)
	at org.apache.activemq.web.AjaxServlet.doGet(AjaxServlet.java:47)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:734)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
	at
org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1539)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
	at org.apache.activemq.web.SessionFilter.doFilter(SessionFilter.java:45)
..../

*by googling for a possible solution to this issue, i found some clues and
added "<async-supported>true</async-supported>" into web.xml (certainly
required to change root tag 'web-app' to version 3.0) for the AjaxServlet,
MessageServlet  and SessionFilter.

The above exceptions vanished, but there are new exceptions thrown:*


/[#|2011-09-05T00:03:04.218+0800|INFO|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=25;_ThreadName=Thread-2;|2011-09-05
00:03:04,218 [ Session Task-1] ERROR AjaxListener                  
- Error receiving message java.lang.IllegalStateException: Asynchronous
dispatch already in progress, must call ServletRequest.startAsync first
java.lang.IllegalStateException: Asynchronous dispatch already in progress,
must call ServletRequest.startAsync first
	at
org.apache.catalina.connector.AsyncContextImpl.dispatch(AsyncContextImpl.java:183)
	at
org.eclipse.jetty.continuation.Servlet3Continuation.resume(Servlet3Continuation.java:153)
	at
org.apache.activemq.web.AjaxListener.onMessageAvailable(AjaxListener.java:74)
	at
org.apache.activemq.ActiveMQMessageConsumer.dispatch(ActiveMQMessageConsumer.java:1252)
	at
org.apache.activemq.ActiveMQSessionExecutor.dispatch(ActiveMQSessionExecutor.java:134)
	at
org.apache.activemq.ActiveMQSessionExecutor.iterate(ActiveMQSessionExecutor.java:205)
	at
org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:127)
	at
org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:48)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:662)
|#]/

Anyone got any ideas on this? Is there anything we can configure in GF3?

Regards,
David

--
View this message in context: http://activemq.2283324.n4.nabble.com/amq5-5-ajax-glassfish-tp3789511p3789511.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.