AnsweredAssumed Answered

ClassNotFound on sun.security.util.HostnameChecker

Question asked by Mert Caliskan on Apr 21, 2016
Latest reply on Apr 26, 2016 by Flow

While I'm trying to use smack 4.1.7 with jars:

smack-core

smack-tcp

smack-extensions

smack-java7 (this was needed because of the NPE on Base64 class)

I'm getting a class not found exception on a JDK class on JDK 8.

 

stack trace is:

  java.lang.NoClassDefFoundError: sun/security/util/HostnameChecker

  at org.jivesoftware.smack.java7.Java7HostnameVerifier.verify(Java7HostnameVerifier .java:47)

  at org.jivesoftware.smack.tcp.XMPPTCPConnection.proceedTLSReceived(XMPPTCPConnecti on.java:770)

  at org.jivesoftware.smack.tcp.XMPPTCPConnection.access$1000(XMPPTCPConnection.java :140)

  at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPC onnection.java:1018)

  at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$300(XMPPTCPCon nection.java:952)

  at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnecti on.java:967)

  at java.lang.Thread.run(Thread.java:745)

Caused by: java.lang.ClassNotFoundException: sun.security.util.HostnameChecker not found by org.igniterealtime.smack.java7 [324]

  at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(Bun dleWiringImpl.java:1532)

  at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75 )

  at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleW iringImpl.java:1955)

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

  ... 7 more]]

Outcomes