powered by Jive Software

Smack 4.0 and openfire

Hello! Can someone help me making a basic connection to Openfire server using the lastest smack4.0. I was following the snipets from the documentation but failed. thanks in advance.

Did you see https://community.igniterealtime.org/thread/52347 ?

Thanks for your answer, I was looking at the wrong documentation. Did fix everything but an error in connection.login() line. It says: “The type javax.security.sasl.SaslException cannot be resolved. It is indirectly referenced from required .class files”. Im stuck at this point. |Any idea?

try{

ConnectionConfiguration config = new ConnectionConfiguration(“10.0.0.4”,5222);

XMPPConnection connection = new XMPPTCPConnection(config);

connection.connect(); // This line has an error.

connection.login(“test”,“test”);

}

catch (SmackException e) {

e.printStackTrace();

}

catch (java.io.IOException e)

{

e.printStackTrace();

}

catch (XMPPException e) {

e.printStackTrace();

}

Are you on Android?

Yes

Saw your reply from this post https://community.igniterealtime.org/thread/52833 will try aSmack

Add your server name like this:

ConnectionConfiguration config = new ConnectionConfiguration(“10.0.0.4”,5222,“yourDomain.org”);