This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Spring and the fly likes Spring-flex messageTemplate blocked Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring-flex messageTemplate blocked" Watch "Spring-flex messageTemplate blocked" New topic

Spring-flex messageTemplate blocked

Alex Armenteros
Ranch Hand

Joined: May 05, 2010
Posts: 75
I'm having trouble with an application that uses StreamingAMFEndpoint on tomcat.

I use the "kill -3 pid" command to see the tomcat stacktrace and I see lots of threads blocked on the class EndpointPushNotifier

Here is the configuration

The customQueueProcessor only prints a message when more than 10000 messages are present on a queue. But this is not the case.

A thread is blocked for almost 2 hours, and don't seem to be unlocked soon....

when I send a message I use this

Where template is the application spring-flex MessageTemplate

Edit: After looking a bit more... I've seen on which object is the thread waiting and which thread has that object locked.

"Thread-5" prio=10 tid=0x000000004f4bf000 nid=0x7717 waiting for monitor entry [0x0000000040d85000]
java.lang.Thread.State: BLOCKED (on object monitor)
at flex.messaging.client.EndpointPushNotifier.pushMessages(
- waiting to lock <0x00002aaab5018890> (a java.lang.Object)
at flex.messaging.client.FlexClient.directFlush(
- locked <0x00002aaab4ff3448> (a java.lang.Object)
at flex.messaging.client.FlexClient.push(
at flex.messaging.MessageBroker.routeMessageToMessageClient(
at flex.messaging.MessageBroker.routeMessageToService(
at org.springframework.flex.messaging.MessageTemplate.send(

The other thread is writing on a socket but it seems to never end that write.

"http-8080-16-in-streaming-mode" daemon prio=10 tid=0x00002aaaf40ef000 nid=0x1762 runnable [0x0000000043d1f000]
java.lang.Thread.State: RUNNABLE
at Method)
at org.apache.coyote.http11.InternalOutputBuffer.realWriteBytes(
at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(
at org.apache.coyote.http11.InternalOutputBuffer.flush(
at org.apache.coyote.http11.Http11Processor.action(
at org.apache.coyote.Response.action(
at org.apache.catalina.connector.OutputBuffer.doFlush(
at org.apache.catalina.connector.OutputBuffer.flush(
at org.apache.catalina.connector.Response.flushBuffer(
at org.apache.catalina.connector.ResponseFacade.flushBuffer(
at flex.messaging.endpoints.BaseStreamingHTTPEndpoint.streamChunk(
at flex.messaging.endpoints.StreamingAMFEndpoint.streamMessages(
at flex.messaging.endpoints.BaseStreamingHTTPEndpoint.handleFlexClientStreamingOpenRequest(
- locked <0x00002aaab50186e8> (a java.lang.Object)
at flex.messaging.endpoints.BaseStreamingHTTPEndpoint.serviceStreamingRequest(
at flex.messaging.endpoints.BaseStreamingHTTPEndpoint.service(
at flex.messaging.endpoints.StreamingAMFEndpoint$$EnhancerByCGLIB$$d6583184.service(<generated>)
at org.springframework.flex.servlet.MessageBrokerHandlerAdapter.handle(
at org.springframework.web.servlet.DispatcherServlet.doDispatch(
at org.springframework.web.servlet.DispatcherServlet.doService(
at org.springframework.web.servlet.FrameworkServlet.processRequest(
at org.springframework.web.servlet.FrameworkServlet.doPost(
at javax.servlet.http.HttpServlet.service(
at javax.servlet.http.HttpServlet.service(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
at org.apache.catalina.core.StandardWrapperValve.invoke(
at org.apache.catalina.core.StandardContextValve.invoke(
at org.apache.catalina.core.StandardHostValve.invoke(
at org.apache.catalina.valves.ErrorReportValve.invoke(
at org.apache.catalina.core.StandardEngineValve.invoke(
at org.apache.catalina.connector.CoyoteAdapter.service(
at org.apache.coyote.http11.Http11Processor.process(
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(

Alex Armenteros
Ranch Hand

Joined: May 05, 2010
Posts: 75
I've already seen that this is caused by a slow browser
I agree. Here's the link:
subject: Spring-flex messageTemplate blocked
It's not a secret anymore!