+2  A: 

You need to set the authentication before you connect viz

SASLAuthentication.supportSASLMechanism("PLAIN", 0);

must appear before connection.connect().

See my blog.

Chuk Lee
thanks for thr reply it worked
SPB