On Mar 21, 2013, at 4:46 PM, Julien Martin wrote:

> Hello,
> 
> I have the following Spring MVC 3.2 code (it uses the DeferredResult
> class<http://static.springsource.org/spring/docs/3.2.2.RELEASE/javadoc-api/org/springframework/web/context/request/async/DeferredResult.html>
> ):
> 
> @RequestMapping(value = "getMessages", method = RequestMethod.GET,
> produces = "application/json")
>    @ResponseBody
>    public DeferredResult<List<Message>> getMessages(@RequestParam
> final Long senderId) {
>        final Long recipientId = memberService.retrieveCurrentMember().getId();
>        final String messageRequestKey = new
> StringBuilder().append(senderId).append(":").append(recipientId).toString();
>        final DeferredResult<List<Message>> deferredResult = new
> DeferredResult<List<Message>>(null, Collections.emptyList());
>        messageRequests.put(messageRequestKey, deferredResult);
> 
>        deferredResult.onCompletion(new Runnable() {
>            @Override
>            public void run() {
>                messageRequests.remove(messageRequestKey);
>            }
>        });
> 
>        List<Message> unReadMessages =
> messageService.findUnreadMessages(senderId, recipientId);
>        if (!unReadMessages.isEmpty()) {
>            deferredResult.setResult(unReadMessages);
>        }
>        return deferredResult;
>    }
> 
> This method is polled continuously by an ajax call and it
> systematically *causes
> Tomcat to crash upon the 9th method invocation*. Note that Tomcat crashes
> without any error message.

Can you define "crash" a little better?  Is the Tomcat process still running?  
If so, is it answering any requests?  If so, what happens if you send a request 
to this resource?  Do you get a 4xx / 5xx error?  Does it hang?

Also, what does your <Connector/> look like?

Dan

> 
> *I would be very grateful if someone could help me determine the reason why
> this code exhibits this behavior, perhaps by giving me tips on how to debug
> the app/tomcat.*
> 
> Regards,
> 
> Julien.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to