AnsweredAssumed Answered

Using smack with google hangout ?

Question asked by Nicolas on Jul 4, 2016
Latest reply on Jul 5, 2016 by Nicolas



I'm trying to build a java application that sends messages through Hangout.

I've looked at smack which seems to answer to my problem, but the initial setup is kind of tricky, there's a lot dependencies and the behavior change when I add some libs.

XMPPTCPConnectionConfiguration config = XMPPTCPConnectionConfiguration.builder() //           .setUsernameAndPassword("<username>", "<password>") //           .setServiceName("") //           .setHost("") //           .setPort(5222) //           .setHostnameVerifier(new HostnameVerifier() {                @Override                public boolean verify(String hostname, SSLSession session) {                     return true;                }           }) //           .build();  AbstractXMPPConnection connection = new XMPPTCPConnection(config); connection.connect();


With only smack-core and smack-tcp, the application manage to connect (at least no error is shown).

When I add smack-extension, for sending a message, the above code fail with this strange error:

Exception in thread "main" java.lang.NullPointerException      at org.jivesoftware.smack.util.stringencoder.Base64.encode(      at org.jivesoftware.smack.util.stringencoder.Base64.encode(      at org.jivesoftware.smack.util.stringencoder.Base64.encodeToString(      at org.jivesoftware.smackx.caps.EntityCapsManager.generateVerificationString(      at org.jivesoftware.smackx.caps.EntityCapsManager.generateVerificationString(      at org.jivesoftware.smackx.caps.EntityCapsManager.updateLocalEntityCaps(      at org.jivesoftware.smackx.caps.EntityCapsManager.(      at org.jivesoftware.smackx.caps.EntityCapsManager.getInstanceFor(      at org.jivesoftware.smackx.caps.EntityCapsManager$1.connectionCreated(      at org.jivesoftware.smack.tcp.XMPPTCPConnection.initConnection(      at org.jivesoftware.smack.tcp.XMPPTCPConnection.connectInternal(      at org.jivesoftware.smack.AbstractXMPPConnection.connect(      at poc.Hangout.main(

Can somebody help me through this setup ?