Note that there are some explanatory texts on larger screens.

plurals
  1. POSearch for users on Ejabberd2 using smack, fails
    text
    copied!<p>Server: ejabberd2 XMPP: smack 3.3.1</p> <p>The goal is to design a chat engine. The user, by entering a username should be able to find out if the entered username is registered on the server.</p> <p><a href="http://www.igniterealtime.org/builds/smack/docs/latest/javadoc/org/jivesoftware/smack/XMPPConnection.html" rel="nofollow">The Smack Javadocs can be found here</a></p> <ul> <li>I am using UserSearch classes found in the Smack library.</li> <li>I can connect to the server. </li> <li>I can login using a username and password.</li> <li>I can add/sign up new users into the server.</li> </ul> <p>I want to find if a username already exists on the server. The code that I have used and its respective error that I got are given below.</p> <pre><code>UserSearchManager search = new UserSearchManager(connection); Form searchForm = search.getSearchForm("search."+connection.getServiceName()); Form answerForm = searchForm.createAnswerForm(); answerForm.setAnswer("Username", true); answerForm.setAnswer("search", name); ReportedData data = search.getSearchResults(answerForm,"search."+connection.getServiceName()); </code></pre> <p>The above code outputs the following error:</p> <pre><code>service-unavailable(503) at org.jivesoftware.smackx.search.UserSearch.getSearchForm(UserSearch.java:84) at org.jivesoftware.smackx.search.UserSearchManager.getSearchForm(UserSearchManager.java:73) at com.phanism.www.XmppConnect.searchUser(XmppConnect.java:74) at com.phanism.www.XmppConnect.main(XmppConnect.java:97) </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload