I have an XMPP service that is designed as a “hub” to coordinate some other connected services. The idea is that those other services use the Service Discovery Manager to add a set of strings representing features. They do this after getting an XmppConnection but before logging in:
ServiceDiscoveryManager sdm = ServiceDiscoveryManager
.getInstanceFor(xmppConnection);
String[] funx = functions.split("[, ]+");
for (int i = 0; i < funx.length; i++)
{
dbg("Adding " + funx+);
sdm.addFeature(funx+);
}
The “hub” service may then require one of those features so it uses Service Discovery to locate a service that provides it:
ServiceDiscoveryManager sdm = ServiceDiscoveryManager
.getInstanceFor(xmppConnection);
dbg(“locateProvider attempting to find provider for service <” + service
- “>”);
DiscoverItems di = sdm.discoverItems(service); // BREAKS HERE
for (Iterator it = di.getItems(); it.hasNext()
{
It throws an exception at the point marked above:
(502) Unable to resolve hostname.
at org.jivesoftware.smackx.ServiceDiscoveryManager.discoverItems(ServiceDiscoveryM anager.java:399)
at org.jivesoftware.smackx.ServiceDiscoveryManager.discoverItems(ServiceDiscoveryM anager.java:365)
On the Hub side I see a “DiscoverItems” packet being detected by the packet filter but it’‘s rejecting it. Probably this is the cause - I think maybe I shouldn’'t be using high-level extensions like Service Discovery and low-level stuff like packet filters at the same time.
The trouble is I need the packet filter and listener to handle the other messages that go between the hub and the other services. Or do I? Is there another way I should be handling this?