ejabberd - Comments for "asmack connects to ejabberd server" https://www.ejabberd.im/node/4878 en hello badlop, " ejabberd https://www.ejabberd.im/node/4878#comment-64242 <p>hello badlop,<br /> "<br /> ejabberd complains that it doesn't serve that vhost:<br /> ... from='irvascloud' xml:lang='en'&gt;"</p> <p>what does it mean </p> <p>I am also getting same eroor while trying to log in on ejabbered 2.1.11 server install on my local machine<br /> what would be possible resone of it </p> <h3>My code is as below </h3> <p>private class DownloadWebPageTask extends AsyncTask {</p> <p> @Override<br /> protected Void doInBackground(String... params) {<br /> int portInt = 5222; </p> <p> // Create a connection<br /> ConnectionConfiguration connConfig =<br /> new ConnectionConfiguration("192.168.0.104", portInt,"localhost");<br /> connConfig.setSASLAuthenticationEnabled(true);<br /> connConfig.setCompressionEnabled(true);<br /> connConfig.setSecurityMode(SecurityMode.enabled);</p> <p> if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {<br /> connConfig.setTruststoreType("AndroidCAStore");<br /> connConfig.setTruststorePassword(null);<br /> connConfig.setTruststorePath(null);<br /> Log.i("XMPPClient", "[XmppConnectionTask] Build Icecream");</p> <p> } else {<br /> connConfig.setTruststoreType("BKS");<br /> String path = System.getProperty("javax.net.ssl.trustStore");<br /> if (path == null)<br /> path = System.getProperty("java.home") + File.separator + "etc"<br /> + File.separator + "security" + File.separator<br /> + "cacerts.bks";<br /> connConfig.setTruststorePath(path);<br /> Log.i("XMPPClient", "[XmppConnectionTask] Build less than Icecream ");</p> <p> }<br /> connConfig.setDebuggerEnabled(true);<br /> XMPPConnection.DEBUG_ENABLED = true;<br /> XMPPConnection connection = new XMPPConnection(connConfig);</p> <p> try {<br /> connection.connect();<br /> Log.i("XMPPClient", "[SettingsDialog] Connected to " + connection.getHost());<br /> // publishProgress("Connected to host " + HOST);<br /> } catch (XMPPException ex) {<br /> Log.e("XMPPClient", "[SettingsDialog] Failed to connect to " + connection.getHost());<br /> Log.e("XMPPClient", ex.toString());<br /> //publishProgress("Failed to connect to " + HOST);<br /> // xmppClient.setConnection(null);<br /> }</p> <p> try {<br /> connection.login("xyzw@localhost","admin");<br /> Log.i("androxmpp", "Logged in as" + connection.getUser());<br /> } catch(Exception ex){</p> <p> Log.i("androxmpp", "loginfails ");<br /> ex.printStackTrace();<br /> }<br /> return null;</p> <p> }<br /> }</p> <h3>and smack debug log and android log is as below </h3> <p>07-12 15:59:31.735: I/XMPPClient(7363): [XmppConnectionTask] Build Icecream<br /> 07-12 15:59:31.825: D/SMACK(7363): 03:59:31 pm SENT (1100387832):<br /> 07-12 15:59:32.035: D/SMACK(7363): 03:59:32 pm RCV (1100387832): &lt;?xml version='1.0'?&gt;<br /> 07-12 15:59:32.045: I/XMPPClient(7363): [SettingsDialog] Connected to 192.168.0.104<br /> 07-12 15:59:32.065: D/SMACK(7363): 03:59:32 pm SENT (1100387832):<br /> 07-12 15:59:32.345: I/androxmpp(7363): loginfails<br /> 07-12 15:59:32.345: W/System.err(7363): java.lang.IllegalStateException: Not connected to server.<br /> 07-12 15:59:32.345: W/System.err(7363): at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:229)<br /> 07-12 15:59:32.345: W/System.err(7363): at org.jivesoftware.smack.Connection.login(Connection.java:371)<br /> 07-12 15:59:32.345: W/System.err(7363): at com.example.androxmpp.MainActivity$DownloadWebPageTask.doInBackground(MainActivity.java:89)<br /> 07-12 15:59:32.345: W/System.err(7363): at com.example.androxmpp.MainActivity$DownloadWebPageTask.doInBackground(MainActivity.java:1)<br /> 07-12 15:59:32.345: W/System.err(7363): at android.os.AsyncTask$2.call(AsyncTask.java:287)<br /> 07-12 15:59:32.345: W/System.err(7363): at java.util.concurrent.FutureTask.run(FutureTask.java:234)<br /> 07-12 15:59:32.345: W/System.err(7363): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)<br /> 07-12 15:59:32.355: W/System.err(7363): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)<br /> 07-12 15:59:32.355: W/System.err(7363): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)<br /> 07-12 15:59:32.355: W/System.err(7363): at java.lang.Thread.run(Thread.java:841)<br /> 07-12 16:03:43.073: W/InputMethodManager(7363): [FXN.ASD] InputBindResult is null</p> <p>Hope you will replay soon<br /> thanks!!!!</p> Sat, 12 Jul 2014 10:41:54 +0000 devlad comment 64242 at https://www.ejabberd.im thanks, it works. i can login https://www.ejabberd.im/node/4878#comment-57680 <p>thanks, it works. i can login now.</p> <div class="codeblock"><code>ConnectionConfiguration cc = new ConnectionConfiguration(<br /> &quot;my_ejabberd_server_domain_name&quot;, 5222, &quot;irvascloud&quot;);</code></div> <p>thanks for the help @badlop.</p> <p>:)</p> Wed, 03 Aug 2011 19:08:18 +0000 chanhangfai comment 57680 at https://www.ejabberd.im This is your client code: new https://www.ejabberd.im/node/4878#comment-57675 <p>This is your client code:<br /> new ConnectionConfiguration("my_ejabberd_server_domain_name", 5222);</p> <p>So, you should configure this in ejabberd.cfg<br /> {hosts, ["my_ejabberd_server_domain_name"]}.</p> <p>But when your client connects to ejabberd, it attempts to login to a different vhost:<br /> to="test" xmlns="jabber:client" </p> <p>ejabberd complains that it doesn't serve that vhost:<br /> ... from='irvascloud' xml:lang='en'&gt;</p> Tue, 02 Aug 2011 14:46:56 +0000 mfoss comment 57675 at https://www.ejabberd.im