Smack XMPP connection with Kerberos


I am trying to create an XMPP connection using the smack API. How do I use the windows active dir support for creating the connection and then logging in?

Any code snippets would be useful.

I am currently doing this:

XMPPConnection conn1 = new XMPPConnection(“”);

conn1.login("", “”, “AIMTest”, false);

After i get the connection, it shows in the debug that it is connected. As soon as I do the login bit, here is the stack trace:

stream:error (text)

at org.jivesoftware.smack.PacketReader.parsePackets(

at org.jivesoftware.smack.PacketReader.access$000(

at org.jivesoftware.smack.PacketReader$

java.lang.IllegalStateException: Not connected to server.

at org.jivesoftware.smack.XMPPConnection.sendPacket(

at org.jivesoftware.smack.NonSASLAuthentication.authenticate(NonSASLAuthentication .java:54)

at org.jivesoftware.smack.SASLAuthentication.authenticate( 213)

at org.jivesoftware.smack.XMPPConnection.login(