powered by Jive Software

NPE in Base64

I’m just getting started with Smack, and I’m clearly doing something wrong. I’m trying to follow the example in the docs, and I get a NullPointerException while trying to authenticate:

java.lang.NullPointerException
at org.jivesoftware.smack.util.Base64.encodeBytes(Base64.java:636)
at org.jivesoftware.smack.sasl.SASLMechanism.challengeReceived(SASLMechanism.java: 152)
at org.jivesoftware.smack.SASLAuthentication.challengeReceived(SASLAuthentication. java:492)
at org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:338)
at org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:44)
at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:76)

…and then:

No response from the server.:
at org.jivesoftware.smack.NonSASLAuthentication.authenticate(NonSASLAuthentication .java:74)
at org.jivesoftware.smack.SASLAuthentication.authenticate(SASLAuthentication.java: 335)
at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:395)
at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:349)
at org.me.Main.main(Main.java:23)

Here’s my code:

XMPPConnection con = new XMPPConnection(XMPP_SERVER);

con.connect();
con.login(XMPP_USERNAME, XMPP_PASSWORD);

I’m using smack.jar from my download of 3.1.0, running on windows. Authenticating against ejabberd 2.0.2, running on FreeBSD.