Quantcast
Channel: Ignite Realtime : Unanswered Discussions - Support
Viewing all articles
Browse latest Browse all 4979

When I tried to build a connection to Openfire with Smack-4.1.3, I got some problems

$
0
0

My code:

 

public class Test {

 

  public static void main(String[] args) {

  XMPPTCPConnectionConfiguration config = XMPPTCPConnectionConfiguration.builder()

  .setUsernameAndPassword("admin", "admin")

  .setServiceName("hy-server")

  .setSecurityMode(SecurityMode.disabled)

  .setDebuggerEnabled(true)

  .setPort(5222)

  .build();

 

  AbstractXMPPConnection connection = new XMPPTCPConnection(config);

  try {

  connection.connect();

  connection.login();

  connection.disconnect();

  } catch (SmackException e) {

  e.printStackTrace();

  } catch (IOException e) {

  e.printStackTrace();

  } catch (XMPPException e) {

  e.printStackTrace();

  }

  }

 

}

 

Exception in console:

 

Exception in thread "main" java.lang.NoClassDefFoundError: de/measite/minidns/DNSCache

  at java.lang.Class.forName0(Native Method)

  at java.lang.Class.forName(Class.java:274)

  at org.jivesoftware.smack.SmackInitialization.loadSmackClass(SmackInitialization.j ava:213)

  at org.jivesoftware.smack.SmackInitialization.parseClassesToLoad(SmackInitializati on.java:193)

  at org.jivesoftware.smack.SmackInitialization.processConfigFile(SmackInitializatio n.java:163)

  at org.jivesoftware.smack.SmackInitialization.processConfigFile(SmackInitializatio n.java:148)

  at org.jivesoftware.smack.SmackInitialization.<clinit>(SmackInitialization.java:11 6)

  at org.jivesoftware.smack.SmackConfiguration.getVersion(SmackConfiguration.java:96 )

  at org.jivesoftware.smack.ConnectionConfiguration.<clinit>(ConnectionConfiguration .java:38)

  at Test.main(Test.java:14)

Caused by: java.lang.ClassNotFoundException: de.measite.minidns.DNSCache

  at java.net.URLClassLoader$1.run(URLClassLoader.java:366)

  at java.net.URLClassLoader$1.run(URLClassLoader.java:355)

  at java.security.AccessController.doPrivileged(Native Method)

  at java.net.URLClassLoader.findClass(URLClassLoader.java:354)

  at java.lang.ClassLoader.loadClass(ClassLoader.java:425)

  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)

  at java.lang.ClassLoader.loadClass(ClassLoader.java:358)

  ... 10 more


Viewing all articles
Browse latest Browse all 4979

Trending Articles