powered by Jive Software

Smack 4.4.0 unable to search Users

Hello community members,
I am new to XMPP and Smack and I am building a chat application using Smack 4.4.0 and Openfire 4.6.2. I am using the following code to perform a user search

UserSearchManager searchManager = new UserSearchManager(connection);
            String searchString = "search." + connection.getXMPPServiceDomain();
            DataForm searchForm = searchManager.getSearchForm(JidCreate.domainBareFrom(searchString));
            FillableForm requestForm = new FillableForm(searchForm);

            requestForm.setAnswer("search", "admin");
            requestForm.setAnswer("Username", "true");
            ReportedData data = searchManager.getSearchResults(requestForm.getDataFormToSubmit(), JidCreate.domainBareFrom(searchString));

however, there is a bug which throws an IllegalArgumentException: " is not a valid boolean string"

W/System.err: org.jivesoftware.smack.SmackException$NotConnectedException: The connection XMPPTCPConnection[admin@mydomain/9613oid3a1] (2) is no longer connected while waiting for response with IQReplyFilter: iqAndIdFilter (AndFilter: (OrFilter: (IQTypeFilter: type=error, IQTypeFilter: type=result), StanzaIdFilter: id=2NAK2-43)), : fromFilter (OrFilter: (FromMatchesFilter (full): search.mydomain)) because of java.io.IOException: java.lang.IllegalArgumentException: admin is not a valid boolean string
W/System.err:     at org.jivesoftware.smack.StanzaCollector.nextResultOrThrow(StanzaCollector.java:276)
        at org.jivesoftware.smack.StanzaCollector.nextResultOrThrow(StanzaCollector.java:228)
        at org.jivesoftware.smackx.search.UserSearch.sendSearchForm(UserSearch.java:98)
        at org.jivesoftware.smackx.search.UserSearchManager.getSearchResults(UserSearchManager.java:91)
        at com.example.xmpptutorial.MainActivity.onCreate(MainActivity.java:88)
W/System.err:     at android.app.Activity.performCreate(Activity.java:7893)
        at android.app.Activity.performCreate(Activity.java:7880)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3283)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3457)
        at android.app.ActivityThread.handleRelaunchActivityInner(ActivityThread.java:5372)
        at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:5280)
        at android.app.servertransaction.ActivityRelaunchItem.execute(ActivityRelaunchItem.java:69)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ClientTransactionHandler.executeTransaction(ClientTransactionHandler.java:57)
        at android.app.ActivityThread.handleRelaunchActivityLocally(ActivityThread.java:5331)
        at android.app.ActivityThread.access$3500(ActivityThread.java:224)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2054)

I tried searching and found that this has already been reported here which states that the branch has been merged and issue has been fixed.
The fix lies in the snapshot version of the repository and hence I am unable to proceed. I don’t know when the snapshot version will go live. Are there alternative solution to my problem as I am stuck because of this.

This topic was automatically closed 62 days after the last reply. New replies are no longer allowed.