Unable to send message from JBoss


I have a strange situation. I am using latest Smack(version 4.1.5) & have a standalone program

which uses a class(which uses Smack) with methods to login & send a message to another user.

Using this class I am able to send messages from one user to another successfully. But when I try

to use the same class from a Session Bean in JBoss(version 6.0.0) to send a message between

exactly same users the message doesn’t seem to reach chat server. There is no exception anywhere

(i.e. login, set presence, send stanza etc are successful with no exception) but the neither the message

reaches the recipient nor does it show up in chat server’s log(whereas is the case of standalone

program, message is received & logged successfully).

When I step through session bean code using debugger, the message is being successfully sent

& is also received successfully. This led me to believe that their is some timing issue involved, so

I added a delay of few seconds between login & send stanza, but no success. Smack’s threads

seem to be started & garbage collected correctly. I am using Tigase 7.0.2.

Has anyone encountered this ? Kindly let me know how did you resolve this or is my approach is not