I was working on integrating the AIM library into a
non-bot application, and it kept leaving threads open
at shutdown. I finally tracked the problem to the timer
thread used to run the watchdog connection check. The
timer starts up in its own thread in the AIMClient.java
constructor (line 74), and that thread needs to be shut
down upon exit or the progam won't close properly.
What needs to be done is add a call to
connectionCheck.cancel() in the signoff function, like
this:
public void signOff() {
// cancel the ping until signon is called again
watchdogCheck.cancel();
watchdogVerify.cancel();
connectionCheck.cancel();
signoff("User request");
}
That will make sure that the timer thread exits
properly upon signoff. This isn't a big problem for a
bot that essentially runs continually, but for anyone
(like myself) integrating the functionaliy into a
regular problem, the is a must. (It might also be a
good idea to put a similar call in some other places in
case of an irregular signoff, but I can't say off the
top of my head exactly where at the moment).
Thanks for all your hard work on this great open source
utility,
--
Aaron Andersen
www.XulPlanet.com
Logged In: YES
user_id=682016
Originator: NO
aha! I found the same problem.
I'm implementing a webservices thing and AIM is one interface. This is the best Lib out there, but it needs that one thing. I couldn't figure out where the madness was coming from:
<paste>
Exception in thread "Thread-88" java.lang.NullPointerException
at com.levelonelabs.aim.AIMClient.run(AIMClient.java:381)
at java.lang.Thread.run(Thread.java:619)
Exception in thread "Thread-89" java.lang.NullPointerException
at com.levelonelabs.aim.AIMClient.run(AIMClient.java:381)
at java.lang.Thread.run(Thread.java:619)
</paste>
But I think this will solve it. Thanks :D