diff --git a/src/main/java/org/gcube/gcat/client/GCatClientDiscovery.java b/src/main/java/org/gcube/gcat/client/GCatClientDiscovery.java index 7e05114..f06604c 100644 --- a/src/main/java/org/gcube/gcat/client/GCatClientDiscovery.java +++ b/src/main/java/org/gcube/gcat/client/GCatClientDiscovery.java @@ -74,25 +74,14 @@ public class GCatClientDiscovery { protected static List getAddresses(){ List addresses = new ArrayList<>(); - try { SimpleQuery proxyQuery = queryForProxy(GCatConstants.SERVICE_CLASS); addresses = ICFactory.client().submit(proxyQuery); - if(addresses==null || addresses.isEmpty()){ - proxyQuery = queryForProxy(GCatConstants.OLD_SERVICE_CLASS); - addresses = ICFactory.client().submit(proxyQuery); - if(addresses==null || addresses.isEmpty()){ - throw new Exception("No ResourceRegistry Proxy Found"); - } - } + } catch (Exception e) { logger.debug("{}. Looking for RunningInstance.", e.getMessage()); SimpleQuery serviceQuery = queryForService(GCatConstants.SERVICE_CLASS); addresses = ICFactory.client().submit(serviceQuery); - if(addresses==null || addresses.isEmpty()){ - serviceQuery = queryForService(GCatConstants.OLD_SERVICE_CLASS); - addresses = ICFactory.client().submit(serviceQuery); - } } return addresses; } @@ -122,7 +111,7 @@ public class GCatClientDiscovery { List addresses = getAddresses(); if(addresses==null || addresses.isEmpty()){ - String error = String.format("No (%s or %s):%s found in the current context", GCatConstants.SERVICE_CLASS, GCatConstants.OLD_SERVICE_CLASS, GCatConstants.SERVICE_NAME); + String error = String.format("No %s:%s found in the current context", GCatConstants.SERVICE_CLASS, GCatConstants.SERVICE_NAME); throw new RuntimeException(error); } Random random = new Random();