diff --git a/src/main/java/org/gcube/dataanalysis/geo/wps/client/WPSClient.java b/src/main/java/org/gcube/dataanalysis/geo/wps/client/WPSClient.java index 8ad84ca..340bb48 100644 --- a/src/main/java/org/gcube/dataanalysis/geo/wps/client/WPSClient.java +++ b/src/main/java/org/gcube/dataanalysis/geo/wps/client/WPSClient.java @@ -120,7 +120,19 @@ public class WPSClient { public void describeProcess(String processID, URL processDescriptionURL) throws Exception { WPSClientSession wpsClient = WPSClientSession.getInstance(); try { - ProcessDescriptionType processDescription = wpsClient.getProcessDescription(wpsServiceURL, processID); + AnalysisLogger.getLogger().debug("Describe Process WPS URL: "+wpsServiceURL); + ProcessDescriptionType processDescription = null; + for (int k=0;k<=3;k++){ + try{ + processDescription = wpsClient.getProcessDescription(wpsServiceURL, processID); + }catch(Exception e){ + AnalysisLogger.getLogger().debug("Retrying with WPS URL: "+wpsServiceURL); + if (k==3) + throw e; + } + if (processDescription!=null) + break; + } this.currentProcessDescription = processDescription; // processDescription.set(XmlString.Factory.parse(new URL("http://schemas.opengis.net/wps/1.0.0/examples/40_wpsDescribeProcess_response.xml"))); if (processDescriptionURL != null) diff --git a/src/main/java/org/gcube/dataanalysis/geo/wps/factory/DynamicWPSTransducerer.java b/src/main/java/org/gcube/dataanalysis/geo/wps/factory/DynamicWPSTransducerer.java index 0f22b92..5b371fa 100644 --- a/src/main/java/org/gcube/dataanalysis/geo/wps/factory/DynamicWPSTransducerer.java +++ b/src/main/java/org/gcube/dataanalysis/geo/wps/factory/DynamicWPSTransducerer.java @@ -51,7 +51,7 @@ public class DynamicWPSTransducerer implements DynamicTransducer{ static Map transducerersP = null; static long t0 = System.currentTimeMillis(); - static long maxtime = 60*60*1000; //1h + static long maxtime = 2*60*60*1000; //1h public static boolean isTooMuchTime(){ if (System.currentTimeMillis()-t0>maxtime){ t0 = System.currentTimeMillis(); diff --git a/src/main/java/org/gcube/dataanalysis/geo/wps/interfaces/WPSProcess.java b/src/main/java/org/gcube/dataanalysis/geo/wps/interfaces/WPSProcess.java index a429038..76b14bd 100644 --- a/src/main/java/org/gcube/dataanalysis/geo/wps/interfaces/WPSProcess.java +++ b/src/main/java/org/gcube/dataanalysis/geo/wps/interfaces/WPSProcess.java @@ -154,9 +154,13 @@ public class WPSProcess implements Transducerer { if (wpsclient ==null) { // here we build the WPS process by means of the client + try{ wpsclient = new WPSClient(wpsurl); wpsclient.describeProcess(processid); inputsCache.put(processid, wpsclient); + }catch(Exception e){ + AnalysisLogger.getLogger().debug("Error in getting process description with ID: "+processid); + } } inputTypes = wpsclient.getCurrentInputStatisticalTypes(); @@ -184,7 +188,7 @@ public class WPSProcess implements Transducerer { } public INFRASTRUCTURE getInfrastructure() { - return INFRASTRUCTURE.LOCAL; + return INFRASTRUCTURE.EXTERNAL_WPS; } public StatisticalType getOutput() {