I'm trying to make a simple example to connect to an openfire server using the smack 4.0.6 library and I have the following code:
ConnectionConfiguration configuration= new ConnectionConfiguration(ADDRESS, 5222);
configuration.setSecurityMode(ConnectionConfiguration.SecurityMode.enabled);
SSLContext sc = null;
try {
sc = SSLContext.getInstance("TLS");
sc.init(null, new TrustManager[] { new AcceptAllTrustManager() }, new SecureRandom());
} catch (Exception e1) {
e1.printStackTrace();
}
configuration.setCustomSSLContext(sc);
XMPPConnection connection = new XMPPTCPConnection(configuration);
try {
connection.connect();
} catch (Exception e) {
e.printStackTrace();
return;
}
The part of the TSL protocol it manages to accomplish completely, however, when I try to connect it it returns the following error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/jivesoftware/smackx/disco/ServiceDiscoveryManager
at org.jivesoftware.smackx.hoxt.HOXTManager$1.connectionCreated(HOXTManager.java:43)
at org.jivesoftware.smack.tcp.XMPPTCPConnection.initConnection(XMPPTCPConnection.java:490)
at org.jivesoftware.smack.tcp.XMPPTCPConnection.connectUsingConfiguration(XMPPTCPConnection.java:440)
at org.jivesoftware.smack.tcp.XMPPTCPConnection.connectInternal(XMPPTCPConnection.java:811)
at org.jivesoftware.smack.XMPPConnection.connect(XMPPConnection.java:396)
at Main.main(Main.java:56)
Which leads me to believe that what is missing is a library that has the definition of class ServiceDiscoveryManager
. In the meantime I've imported all the libraries that are provided by Ignite and it still does not work.
What dependency is missing for it?