How to stop smack threads?

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