How to stop smack threads?

Hello,

I use smack1.4.1 to communicate jive messenger 2.0.1, but when the program closed the XMPPConnection, those listeners,like packet listener, still kept running. I don’'t know how to stop all the listeners, please give me a hint! btw, my program are servlets of a webapp.

thanks!

best wishs

I’'m locking this thread, as essentially the same question is posted in the following thread:

http://www.jivesoftware.org/forums/thread.jspa?threadID=13672

Regards,

Matt

I am posting to this thread, as the link mentioned above points to nirwana (http status 404).

As I started using Smack in a Tomcat based webapplication, whenever I undeploy the application (while Tomcat keeps running), I get a warning from Tomcat saying that the application started some Threads but did not stop them, which can lead to memory leaks.

So I also have the question how to stop threads, as exiting the MUC and disconnecting seems not sufficient. I am using Smack 4.4.2 and Tomcat 10.0.3.

Someone mentioned the threads could be closed via reflection. I never had to stop “someone else’s” threads. Is there some example code around?

Edit: This seems the same problem as mentioned in Tomcat7 error at shutdown: Smack Keep Alive thread can not be stopped - #3 by brownylin