public SearchResult find(DN dn) throws Exception { Session session = createAdminSession(); LDAPClient client = null; try { LDAPConnection connection = (LDAPConnection) getConnection(); client = connection.getClient(session); return client.find(dn); } finally { if (client != null) try { client.close(); } catch (Exception e) { log.error(e.getMessage(), e); } if (session != null) try { session.close(); } catch (Exception e) { log.error(e.getMessage(), e); } } }