ex.printStackTrace();
    public synchronized Object sfResolve(Reference r, int index) throws SmartFrogResolutionException {        // If the requested object is the result, we try to find services using SLP.        String s = r.elementAt(index).toString();        try {            if("HERE result".equals(s) ) {                //System.out.println("Starting service discovery...");                // discover it...                if(discoveryResults == null) {                    waitForDiscovery();                }                //System.out.println("Discovery completed...");                if(returnEnumeration) return discoveryResults; // return the unmodified enumeration                                return getDiscoveredObject(discoveryResults); // return first object.            }            else {                return super.sfResolve(r, index);            }        }catch(Exception ex) {            ex.printStackTrace();            throw (SmartFrogResolutionException) SmartFrogResolutionException.forward(ex);        }    }