JPredWSServiceLocator loc = new JPredWSServiceLocator(); // Default\r
try {\r
this.server = loc.getjpred(new java.net.URL(WsURL)); // JBPNote will be set from properties\r
+ ((JpredSoapBindingStub) this.server).setTimeout(60000); // one minute stub\r
}\r
catch (Exception ex) {\r
JOptionPane.showMessageDialog(Desktop.desktop, "The Secondary Structure Prediction Service named "\r
"Internal Jalview Error", JOptionPane.WARNING_MESSAGE);\r
wsInfo.setProgressText("Serious! "+WebServiceName+" Service location failed\nfor URL :"\r
+WsURL+"\n"+ex.getMessage());\r
+ wsInfo.setStatus(wsInfo.STATE_STOPPED_SERVERERROR);\r
}\r
\r
JPredThread jthread = new JPredThread(seq);\r
{\r
try\r
{\r
- result = server.getresult(jobId);\r
+ if ((result = server.getresult(jobId))==null)\r
+ throw(new Exception("Timed out when communicating with server\nTry again later.\n"));\r
\r
if( result.isRunning() )\r
wsInfo.setStatus(WebserviceInfo.STATE_RUNNING);\r
wsInfo.setProgressText(OutputHeader + "\n" + result.getStatus());\r
if (! (result.isJobFailed() || result.isServerError()))\r
{\r
- Thread.sleep(5000);\r
+ try\r
+ {\r
+ Thread.sleep(5000);\r
+ }\r
+ catch (InterruptedException ex1)\r
+ {\r
+ }\r
// System.out.println("I'm alive "+seqid+" "+jobid);\r
} else {\r
wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_ERROR);\r
{\r
allowedServerExceptions--;\r
wsInfo.appendProgressText("\nJPredWS Server exception!\n" + ex.getMessage());\r
+ try\r
+ {\r
+ if (allowedServerExceptions>0)\r
+ Thread.sleep(5000);\r
+ }\r
+ catch (InterruptedException ex1)\r
+ {\r
+ }\r
}\r
}\r
\r
} else {\r
jobId = server.predict(sequence);\r
}\r
- System.out.println(WsURL+" Job Id '"+jobId+"'");\r
+ if (jobId!=null) {\r
+ if (jobId.startsWith("Broken")) {\r
+ throw new Exception("Submission " + jobId);\r
+ } else {\r
+ System.out.println(WsURL+" Job Id '"+jobId+"'");\r
+ }\r
+ } else {\r
+ throw new Exception("Server timed out - try again later\n");\r
+\r
+ }\r
}\r
catch (Exception e)\r
{\r
- System.err.println("JPredWS Client: Failed to submit the prediction\n" +\r
- e.toString() + "\n");\r
- e.printStackTrace();\r
+ wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_SERVERERROR);\r
+ allowedServerExceptions=0;\r
+ jobComplete=false;\r
+ wsInfo.appendProgressText("Failed to submit the prediction: "+e.toString()+"\nJust close the window\n");\r
+ System.err.println("JPredWS Client: Failed to submit the prediction\n" +\r
+ e.toString() + "\n");\r
+ // e.printStackTrace(); TODO: JBPNote DEBUG\r
}\r
}\r
\r