Timer thread death
"Brett Buckingham" <[email protected]>
| Newsgroups | gmane.comp.voip.nist-sip |
|---|---|
| Message-ID | <AF72D46D56403D45AF5441A2D92F867001CF9B37@server01.NaturalConvergence.com> |
I searched the archives for instances of java.lang.IllegalStateException
and found a few relevant articles, but no clear solutions. Hope this
question hasn't been raised before.
Class SipTransactionStack has a single Timer object upon which are
scheduled various TimerTask subclasses, such as DialogTimerTask,
LingerTimer, etc. If any of the scheduled TimerTask subclasses throw an
exception, it causes the Timer thread to exit. Subsequent attempts to
schedule TimerTasks fail as if the Timer has been cancelled, with the
following exception:
java.lang.IllegalStateException: Timer already cancelled.
at java.util.Timer.sched(Timer.java:354)
at java.util.Timer.schedule(Timer.java:222)
at
gov.nist.javax.sip.stack.SIPClientTransaction.startTransactionTimer(SIPC
lientTransaction.java:1160)
at
gov.nist.javax.sip.stack.SIPTransactionStack.createMessageChannel(SIPTra
nsactionStack.java:1014)
at
gov.nist.javax.sip.SipProviderImpl.getNewClientTransaction(SipProviderIm
pl.java:353)
...
Effectively, this kills the SIP stack.
I find it curious that the java.util.Timer class/thread isn't more
robust in the face of exceptions thrown by TimerTasks. I suppose I
could subclass Timer, clone it's mainLoop() method, and put a try/catch
around task.run().
Has anyone else run into this problem before?
Brett