"Failed to get registry service for URL: " + url);
error.setRootCause(exception);
throw error;
}
NamingProvider provider;
try {
provider = (NamingProvider) registry.lookup("jndi");
} catch (NotBoundException exception) {
throw new ServiceUnavailableException(
"JNDI service is not bound in the registry for URL: "
+ url);
} catch (RemoteException exception) {
NamingException error = new CommunicationException(
"Failed to lookup JNDI provider for URL: " + url);
error.setRootCause(exception);
throw error;
} finally {
// get rid of the proxy now rather than waiting for GC
if (registry instanceof Proxy) {
((Proxy) registry).disposeProxy();
}
}
NameParser parser;
try {
parser = provider.getNameParser();
} catch (NamingException exception) {
throw exception;
} catch (Exception exception) {
NamingException error = new ServiceUnavailableException(
exception.getMessage());