File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring-flex messageTemplate blocked" Watch "Spring-flex messageTemplate blocked" New topic
Author

Spring-flex messageTemplate blocked

Alex Armenteros
Ranch Hand

Joined: May 05, 2010
Posts: 73
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(EndpointPushNotifier.java:339)
- waiting to lock <0x00002aaab5018890> (a java.lang.Object)
at flex.messaging.client.FlexClient.directFlush(FlexClient.java:1505)
- locked <0x00002aaab4ff3448> (a java.lang.Object)
at flex.messaging.client.FlexClient.push(FlexClient.java:1080)
at flex.messaging.MessageBroker.routeMessageToMessageClient(MessageBroker.java:1624)
at flex.messaging.services.MessageService.pushMessageToClient(MessageService.java:670)
at flex.messaging.services.MessageService.pushMessageToClients(MessageService.java:598)
at flex.messaging.services.messaging.adapters.ActionScriptAdapter.invoke(ActionScriptAdapter.java:90)
at flex.messaging.services.MessageService.serviceMessage(MessageService.java:318)
at flex.messaging.services.MessageService.serviceMessage(MessageService.java:233)
at flex.messaging.services.MessageService.serviceMessage(MessageService.java:224)
at flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:1400)
at org.springframework.flex.messaging.MessageTemplate.send(MessageTemplate.java:137)
at dbms.ThreadMonitorV2.run(ThreadMonitorV2.java:169)

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 java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at org.apache.coyote.http11.InternalOutputBuffer.realWriteBytes(InternalOutputBuffer.java:756)
at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:448)
at org.apache.coyote.http11.InternalOutputBuffer.flush(InternalOutputBuffer.java:318)
at org.apache.coyote.http11.Http11Processor.action(Http11Processor.java:985)
at org.apache.coyote.Response.action(Response.java:183)
at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:325)
at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:296)
at org.apache.catalina.connector.Response.flushBuffer(Response.java:549)
at org.apache.catalina.connector.ResponseFacade.flushBuffer(ResponseFacade.java:279)
at flex.messaging.endpoints.BaseStreamingHTTPEndpoint.streamChunk(BaseStreamingHTTPEndpoint.java:1083)
at flex.messaging.endpoints.StreamingAMFEndpoint.streamMessages(StreamingAMFEndpoint.java:238)
at flex.messaging.endpoints.BaseStreamingHTTPEndpoint.handleFlexClientStreamingOpenRequest(BaseStreamingHTTPEndpoint.java:836)
- locked <0x00002aaab50186e8> (a java.lang.Object)
at flex.messaging.endpoints.BaseStreamingHTTPEndpoint.serviceStreamingRequest(BaseStreamingHTTPEndpoint.java:1055)
at flex.messaging.endpoints.BaseStreamingHTTPEndpoint.service(BaseStreamingHTTPEndpoint.java:460)
at flex.messaging.endpoints.StreamingAMFEndpoint$$EnhancerByCGLIB$$d6583184.service(<generated>)
at org.springframework.flex.servlet.MessageBrokerHandlerAdapter.handle(MessageBrokerHandlerAdapter.java:101)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)

Alex Armenteros
Ranch Hand

Joined: May 05, 2010
Posts: 73
I've already seen that this is caused by a slow browser
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Spring-flex messageTemplate blocked