title: Android XMPP using smack: No response from server
body: <p>I'm trying to make an application which uses XMPP to send messages to a gmail account. I found a link which mentions the name of Google's XMPP server, but I dont think that I am able to make a connection.</p>
  
  <p><strong>EDIT</strong> I changed the name of the server and I believe it was able to establish a connection. But it says there are 0 entries for the Rosters. I am trying to login using a gmail account. The new exception I got:</p>
  
  <pre><code>07-05 14:02:05.099: W/System.err(13903): java.security.KeyStoreException: java.security.NoSuchAlgorithmException: KeyStore jks implementation not found
  07-05 14:02:05.099: W/System.err(13903):    at java.security.KeyStore.getInstance(KeyStore.java:119)
  07-05 14:02:05.099: W/System.err(13903):    at org.jivesoftware.smack.ServerTrustManager.&lt;init&gt;(ServerTrustManager.java:70)
  07-05 14:02:05.099: W/System.err(13903):    at org.jivesoftware.smack.XMPPConnection.proceedTLSReceived(XMPPConnection.java:824)
  07-05 14:02:05.099: W/System.err(13903):    at org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:267)
  07-05 14:02:05.099: W/System.err(13903):    at org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:43)
  07-05 14:02:05.099: W/System.err(13903):    at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:70)
  07-05 14:02:05.099: W/System.err(13903): Caused by: java.security.NoSuchAlgorithmException: KeyStore jks implementation not found
  07-05 14:02:05.099: W/System.err(13903):    at org.apache.harmony.security.fortress.Engine.notFound(Engine.java:177)
  07-05 14:02:05.099: W/System.err(13903):    at org.apache.harmony.security.fortress.Engine.getInstance(Engine.java:151)
  07-05 14:02:05.099: W/System.err(13903):    at java.security.KeyStore.getInstance(KeyStore.java:116)
  07-05 14:02:05.099: W/System.err(13903):    ... 5 more
  </code></pre>
  
  <p>Here is the original exception :</p>
  
  <pre><code>07-05 13:30:23.444: W/System.err(12434):    at org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:306)
  07-05 13:30:23.454: W/System.err(12434):    at org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:44)
  07-05 13:30:23.454: W/System.err(12434):    at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:76)
  07-05 13:30:38.229: D/Smack(12434): Start Login
  07-05 13:30:43.235: E/Smack(12434): Error: No response from the server.
  07-05 13:30:43.235: W/System.err(12434): No response from the server.: 
  07-05 13:30:43.235: W/System.err(12434):    at org.jivesoftware.smack.NonSASLAuthentication.authenticate(NonSASLAuthentication.java:58)
  07-05 13:30:43.235: W/System.err(12434):    at org.jivesoftware.smack.SASLAuthentication.authenticate(SASLAuthentication.java:232)
  07-05 13:30:43.245: W/System.err(12434):    at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:341)
  07-05 13:30:43.245: W/System.err(12434):    at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:301)
  07-05 13:30:43.255: W/System.err(12434):    at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:283)
  07-05 13:30:43.255: W/System.err(12434):    at com.example.xmpp.MessageTask.doInBackground(MessageTask.java:33)
  07-05 13:30:43.255: W/System.err(12434):    at com.example.xmpp.MessageTask.doInBackground(MessageTask.java:1)
  07-05 13:30:43.265: W/System.err(12434):    at android.os.AsyncTask$2.call(AsyncTask.java:287)
  07-05 13:30:43.265: W/System.err(12434):    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
  07-05 13:30:43.275: W/System.err(12434):    at java.util.concurrent.FutureTask.run(FutureTask.java:137)
  07-05 13:30:43.275: W/System.err(12434):    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
  07-05 13:30:43.275: W/System.err(12434):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
  07-05 13:30:43.285: W/System.err(12434):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
  07-05 13:30:43.285: W/System.err(12434):    at java.lang.Thread.run(Thread.java:856)
  </code></pre>
  
  <p>Here is my code:</p>
  
  <pre><code>ConnectionConfiguration config = new ConnectionConfiguration("xmpp.l.google.com", 5222);
          XMPPConnection connection =  new XMPPConnection(config);
          try {
              Log.d("Smack", "Start Connect");
              connection.connect();
              Log.d("Smack", "Start Login");
              connection.login(user, pwd);
              Roster roster = connection.getRoster();
              //Get all rosters
              Collection&lt;RosterEntry&gt; entries = roster.getEntries();
              //loop through
              Log.d("Smack", "Start Rosters");
              for (RosterEntry entry : entries) {
              //example: get presence, type, mode, status
              Presence entryPresence = roster.getPresence(entry.getUser());
                String status = entryPresence.getStatus();
                Toast.makeText(context, status, Toast.LENGTH_LONG).show();
                Log.d("Smack", "Print rosters");
              }
              Log.d("Smack", "End Rosters");
  
          } catch (XMPPException e) {
              // TODO Auto-generated catch block
              Log.e("Smack", "Error: " + e.getMessage());
              e.printStackTrace();
          }
  </code></pre>