title: Smack throws java.lang.ClassNotFoundException: org.apache.http.conn.ssl.StrictHostnameVerifier
body: <p>I have followed the tutorial at the link <a href="https://developer.android.com/google/gcm/ccs.html#implement" rel="nofollow">https://developer.android.com/google/gcm/ccs.html#implement</a>.</p>
  
  <p>I am using Smack 4.0.4.</p>
  
  <p>I have created an endpoint for the method "connect" and deployed this class on google app engine.</p>
  
  <p>However when I call "connect" from my android mobile client app, i get exception as shown below. </p>
  
  <p>Do I need to download the jar containing org/apache/http/conn/ssl/StrictHostnameVerifier and add to dependencies in Android Studio?</p>
  
  <p>Any helpful comment is appreciated!</p>
  
  <pre><code>java.lang.NoClassDefFoundError: org/apache/http/conn/ssl/StrictHostnameVerifier
  at org.jivesoftware.smack.android.AndroidSmackInitializer.initialize(AndroidSmackInitializer.java:29)
  at org.jivesoftware.smack.SmackConfiguration.loadSmackClass(SmackConfiguration.java:472)
  at org.jivesoftware.smack.SmackConfiguration.parseClassesToLoad(SmackConfiguration.java:430)
  at org.jivesoftware.smack.SmackConfiguration.processConfigFile(SmackConfiguration.java:400)
  at org.jivesoftware.smack.SmackConfiguration.processConfigFile(SmackConfiguration.java:385)
  at org.jivesoftware.smack.SmackConfiguration.&lt;clinit&gt;(SmackConfiguration.java:161)
  at org.jivesoftware.smack.ConnectionConfiguration.&lt;init&gt;(ConnectionConfiguration.java:69)
  at com.example.mymodule.XMPPServer.SmackCcsClientEndpoint.connect(SmackCcsClientEndpoint.java:267)
  at com.example.mymodule.XMPPServer.SmackCcsClientEndpoint.getInstance(SmackCcsClientEndpoint.java:73)
  at com.example.mymodule.connectionServlet.CcsServlet.init(CcsServlet.java:24)
  at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:440)
  at org.mortbay.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:339)
  at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
  at com.google.appengine.api.socket.dev.DevSocketFilter.doFilter(DevSocketFilter.java:74)
  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
  at com.google.appengine.tools.development.ResponseRewriterFilter.doFilter(ResponseRewriterFilter.java:127)
  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
  at com.google.appengine.tools.development.HeaderVerificationFilter.doFilter(HeaderVerificationFilter.java:34)
  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
  at com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:63)
  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
  at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
  at com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:125)
  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
  at com.google.appengine.tools.development.DevAppServerModulesFilter.doDirectRequest(DevAppServerModulesFilter.java:366)
  at com.google.appengine.tools.development.DevAppServerModulesFilter.doDirectModuleRequest(DevAppServerModulesFilter.java:349)
  at com.google.appengine.tools.development.DevAppServerModulesFilter.doFilter(DevAppServerModulesFilter.java:116)
  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
  at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
  at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
  at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
  at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
  at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
  at com.google.appengine.tools.development.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:98)
  at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
  at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:490)
  at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
  at org.mortbay.jetty.Server.handle(Server.java:326)
  at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
  at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)
  at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755)
  at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
  at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
  at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
  at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
  Caused by: java.lang.ClassNotFoundException: org.apache.http.conn.ssl.StrictHostnameVerifier
  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 com.google.appengine.tools.development.IsolatedAppClassLoader.loadClass(IsolatedAppClassLoader.java:216)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
  ... 47 more
  Caused by:
  
  java.lang.ClassNotFoundException: org.apache.http.conn.ssl.StrictHostnameVerifier
  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 com.google.appengine.tools.development.IsolatedAppClassLoader.loadClass(IsolatedAppClassLoader.java:216)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
  at org.jivesoftware.smack.android.AndroidSmackInitializer.initialize(AndroidSmackInitializer.java:29)
  at org.jivesoftware.smack.SmackConfiguration.loadSmackClass(SmackConfiguration.java:472)
  at org.jivesoftware.smack.SmackConfiguration.parseClassesToLoad(SmackConfiguration.java:430)
  at org.jivesoftware.smack.SmackConfiguration.processConfigFile(SmackConfiguration.java:400)
  at org.jivesoftware.smack.SmackConfiguration.processConfigFile(SmackConfiguration.java:385)
  at org.jivesoftware.smack.SmackConfiguration.&lt;clinit&gt;(SmackConfiguration.java:161)
  at org.jivesoftware.smack.ConnectionConfiguration.&lt;init&gt;(ConnectionConfiguration.java:69)
  at com.example.mymodule.XMPPServer.SmackCcsClientEndpoint.connect(SmackCcsClientEndpoint.java:267)
  at com.example.mymodule.XMPPServer.SmackCcsClientEndpoint.getInstance(SmackCcsClientEndpoint.java:73)
  at com.example.mymodule.connectionServlet.CcsServlet.init(CcsServlet.java:24)
  at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:440)
  at org.mortbay.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:339)
  at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
  at com.google.appengine.api.socket.dev.DevSocketFilter.doFilter(DevSocketFilter.java:74)
  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
  at com.google.appengine.tools.development.ResponseRewriterFilter.doFilter(ResponseRewriterFilter.java:127)
  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
  at com.google.appengine.tools.development.HeaderVerificationFilter.doFilter(HeaderVerificationFilter.java:34)
  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
  at com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:63)
  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
  at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
  at com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:125)
  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
  at com.google.appengine.tools.development.DevAppServerModulesFilter.doDirectRequest(DevAppServerModulesFilter.java:366)
  at com.google.appengine.tools.development.DevAppServerModulesFilter.doDirectModuleRequest(DevAppServerModulesFilter.java:349)
  at com.google.appengine.tools.development.DevAppServerModulesFilter.doFilter(DevAppServerModulesFilter.java:116)
  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
  at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
  at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
  at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
  at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
  at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
  at com.google.appengine.tools.development.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:98)
  at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
  at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:490)
  at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
  at org.mortbay.jetty.Server.handle(Server.java:326)
  at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
  at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)
  at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755)
  at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
  at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
  at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
  at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
  </code></pre>