[jboss-jira] [JBoss JIRA] Commented: (JBREM-1125) Test for IllegalStateException when calling Timer.schedule()

Ron Sigal (JIRA) jira-events at lists.jboss.org
Fri May 1 15:46:46 EDT 2009


    [ https://jira.jboss.org/jira/browse/JBREM-1125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12465398#action_12465398 ] 

Ron Sigal commented on JBREM-1125:
----------------------------------

Hi Trustin,

Yeah, I see what you mean.  And yet, on the forum thread http://www.jboss.org/index.html?module=bb&op=viewtopic&t=122827, James gets

Caused by: java.lang.IllegalStateException: Timer already cancelled.
	at java.util.Timer.sched(Unknown Source)
	at java.util.Timer.schedule(Unknown Source)
	at org.jboss.remoting.LeasePinger.startPing(LeasePinger.java:99)
	at org.jboss.remoting.MicroRemoteClientInvoker.establishLease(MicroRemoteClientInvoker.java:478)

even though the reference to the Timer in LeasePinger is never removed.  I don't get it.  But I'll go with what works.  :)

-Ron

> Test for IllegalStateException when calling Timer.schedule()
> ------------------------------------------------------------
>
>                 Key: JBREM-1125
>                 URL: https://jira.jboss.org/jira/browse/JBREM-1125
>             Project: JBoss Remoting
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 2.2.2.SP11, 2.5.1 (Flounder)
>            Reporter: Ron Sigal
>            Assignee: Ron Sigal
>             Fix For: 2.2.2.SP12, 2.5.2 (Flounder)
>
>
> When a java.util.Timer has not more TimerTasks in its queue, it can shut itself down, so that subsequent calls to Timer.schedule() will throw a java.lang.IllegalStateException.  Therefore, all calls to Timer.schedule() should be inside a try/catch block that will catch IllegalStateExceptions and create a new Timer.  Most of these calls in Remoting are already protected, but there are a couple that are not.  In particuler,
>   branch 2.2:
>   ========
>   * org.jboss.remoting.detection.AbstractDetector.startHeartbeat()
>   * org.jboss.remoting.util.TimerUtil.schedule()
>   branch 2.x:
>   ========
>   * org.jboss.remoting.detection.AbstractDetector.startHeartbeat()

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list