1

This may look a very basic question but I am having a problem accessing OpenFire search function using this code:

    try {

        UserSearchManager search = new UserSearchManager(connection.getConnection());
        Form searchForm = search.getSearchForm("search." + server);
        ...

    } catch (Exception e) {...}

The server here is a String with value something like "192.168.242.132", the code gets error from this line: Form searchForm = search.getSearchForm("search." + server);

Essentially, the server is up and running as I can create account and login/logout.

I assume that the problem is with the "server" String value. Any one have encountered this kind of problem before?

EDIT: I have already added in /etc/hosts to resolve the IP address to myelastix-local.com and still having the same problem, it can access create / login api but search still does not work. Do I have to modify openfire server settings too?

quarks
  • 33,478
  • 73
  • 290
  • 513

2 Answers2

1

Are you sure that you can call getSearchForm() with an IP? Try to provide the component ID, which is normally something like "search.jabberserver.tld"

Flow
  • 23,572
  • 15
  • 99
  • 156
  • Adding an entry in the hosts file won't help here. There is no reverse DNS lookup involved. Take a look at the source: The String from `getSearchFrom()` is written directly into the stanza. *Just set the String to "myelastix-local.com".* – Flow Aug 23 '11 at 06:15
  • thanks for the info, however I have already solved the issue hours ago. – quarks Aug 23 '11 at 08:49
  • @xybrek Then share the solution with us pls :) – Flow Aug 23 '11 at 09:08
  • sure please see my answer post. – quarks Aug 23 '11 at 11:25
1

Here's what I did:

Form searchForm = search.getSearchForm("search." + connection.getServiceName());

connection is the XMPPConnection.

quarks
  • 33,478
  • 73
  • 290
  • 513
  • Referring to the part: `"search." + connection.getServiceName()`, where can I find or configure the relevant string for my ejabberd setup? – battery Jun 01 '14 at 15:24