I read in a post to the Smack forum recently that
Starting daemon threads in a Java EE server is a big no no
Basically Smack’s XMPPConnection starts one daemon thread to monitor incoming data
& another to send outgoing data from/to the jabber server respectively. Is it reasonable to use daemon threads to listen for write/reads in this scenario ?
Yes, XMPPConnection creates two threads–one for listening/reading and one for writing. But these only live as long as the XMPPConnection instance, which I assume is not forever.
Are you writing spec compliant EJB? If so, then this applies. The spec says don’t do it. EJB 2.1 specification:
Or is it just a webapp that happens to be running in Tomcat? If this is the case, then I do not see any fundamental problem. Without the threads, your Smack client would be unable to communicate with the server.