Examples of JobSubmissionFault


Examples of org.apache.airavata.gfac.JobSubmissionFault

            synchronized (this) {
                currentlyExecutingJobCache.remove(job.getIDAsString());
            }

            throw new JobSubmissionFault(new Exception(errorMsg), host.getHostAddress(), gateKeeper,
                            job.getRSL(), jobExecutionContext, getGramErrorString(listener.getError()),
                    listener.getError());

        } else if (jobStatus == GramJob.STATUS_DONE) {
            log.info("Job " + job.getIDAsString() + " on host " + host.getHostAddress() + " is successfully executed.");
View Full Code Here

Examples of org.apache.airavata.gfac.JobSubmissionFault

            checkJobStatus(jobExecutionContext, host, gateKeeper);
           
        } catch (GramException e) {
            log.error(e.getMessage());
            JobSubmissionFault error = new JobSubmissionFault(this, e, host.getHostAddress(),
                    host.getGlobusGateKeeperEndPointArray(0), job.getRSL(), jobExecutionContext);
            throw error;
        }catch(JobSubmissionFault e){
          throw new GFacProviderException(e.getMessage(), e, jobExecutionContext);
        }
View Full Code Here

Examples of org.apache.airavata.gfac.JobSubmissionFault

                try {
                    job.request(gateKeeper, false, false);
                    listener.waitFor();
                } catch (GramException e) {
                    log.error(e.getMessage());
                    JobSubmissionFault error = new JobSubmissionFault(this, e, host.getHostAddress(),
                            host.getGlobusGateKeeperEndPointArray(0), job.getRSL(), jobExecutionContext);
                    throw error;
                } catch (GSSException e) {
                    log.error(e.getMessage());
                    throw new GFacProviderException(e.getMessage(), e, jobExecutionContext);
                } catch (InterruptedException e) {
                    log.error(e.getMessage());
                    throw new GFacProviderException("Thread", e, jobExecutionContext);
                } catch (GFacException e) {
                    JobSubmissionFault error = new JobSubmissionFault(this, new Exception(errorMsg), "GFAC HOST", gateKeeper,
                            job.getRSL(), jobExecutionContext);
                    throw error;
                }
            }
            JobSubmissionFault error = new JobSubmissionFault(this, new Exception(errorMsg), "GFAC HOST", gateKeeper,
                            job.getRSL(), jobExecutionContext);
                    throw error;

        }
    }
View Full Code Here

Examples of org.apache.airavata.gfac.JobSubmissionFault

            synchronized (this) {
                currentlyExecutingJobCache.remove(job.getIDAsString());
            }

            throw new JobSubmissionFault(new Exception(errorMsg), host.getHostAddress(), gateKeeper,
                            job.getRSL(), jobExecutionContext, getGramErrorString(listener.getError()),
                    listener.getError());

        } else if (jobStatus == GramJob.STATUS_DONE) {
            log.info("Job " + job.getIDAsString() + " on host " + host.getHostAddress() + " is successfully executed.");
View Full Code Here

Examples of org.apache.airavata.gfac.JobSubmissionFault

            synchronized (this) {
                currentlyExecutingJobCache.remove(job.getIDAsString());
            }

            throw new JobSubmissionFault(new Exception(errorMsg), host.getHostAddress(), gateKeeper,
                            job.getRSL(), jobExecutionContext, getGramErrorString(listener.getError()),
                    listener.getError());

        } else if (jobStatus == GramJob.STATUS_DONE) {
            log.info("Job " + job.getIDAsString() + " on host " + host.getHostAddress() + " is successfully executed.");
View Full Code Here

Examples of org.ogce.gfac.exception.JobSubmissionFault

     
      //set to context
      OutputUtils.fillOutputFromStdout(invocationContext.getMessageContext("output"), context.getExecutionModel().getStdoutStr(), context.getExecutionModel().getStderrStr());

    } catch (IOException e) {     
      throw new JobSubmissionFault(e, "", "", buildCommand(cmdList), CurrentProviders.Local);
    } catch (InterruptedException e) {
      throw new GfacException(e, FaultCode.LocalError);
    }

  }
View Full Code Here

Examples of org.ogce.gfac.exception.JobSubmissionFault

            int jobStatus1 = listener.getStatus();
            if (jobStatus1 == GramJob.STATUS_FAILED) {
              int errCode1 = listener.getError();
              String errorMsg = "Job " + job.getID() + " on host " + context.getExecutionModel().getHost() + " Error Code = " + errCode1;
              String localHost = context.getServiceContext().getGlobalConfiguration().getLocalHost();
              throw new JobSubmissionFault(new Exception(errorMsg), localHost, "", "", CurrentProviders.Gram);
            }
          } catch (Exception e) {
            String localHost = context.getServiceContext().getGlobalConfiguration().getLocalHost();
            throw new JobSubmissionFault(e, localHost, "", "", CurrentProviders.Gram);
          }
        } else {
          String errorMsg = "Job " + job.getID() + " on host " + context.getExecutionModel().getHost() + " Error Code = " + errCode;
          String localHost = context.getServiceContext().getGlobalConfiguration().getLocalHost();
          GfacException error = new JobSubmissionFault(new Exception(errorMsg), localHost, contact, rsl, CurrentProviders.Gram);
          if (errCode == 8) {
            error.setFaultCode(ErrorCodes.JOB_CANCELED);
          } else {
            error.setFaultCode(ErrorCodes.JOB_FAILED);
          }
          // error.addProperty(ErrorCodes.JOB_TYPE,
          // ErrorCodes.JobType.Gram.toString());
          // error.addProperty(ErrorCodes.CONTACT, contact);
          throw error;
        }
      }
      notifier.computationFinished(compObj);     

      /*
       * Stdout and Stderror
       */
      GridFtp ftp = new GridFtp();

      // get Hostname
      String hostgridFTP = null;

      if (invocationContext.getExecutionContext().getExecutionModel().getHostDesc().getHostConfiguration().getGridFTPArray() != null && invocationContext.getExecutionContext().getExecutionModel().getHostDesc().getHostConfiguration().getGridFTPArray().length > 0) {
        hostgridFTP = invocationContext.getExecutionContext().getExecutionModel().getHostDesc().getHostConfiguration().getGridFTPArray(0).getEndPointReference();
      } else {
        hostgridFTP = invocationContext.getExecutionContext().getExecutionModel().getHost();
      }     

      URI stdoutURI = GfacUtils.createGsiftpURI(hostgridFTP, invocationContext.getExecutionContext().getExecutionModel().getStdOut());
      URI stderrURI = GfacUtils.createGsiftpURI(hostgridFTP, invocationContext.getExecutionContext().getExecutionModel().getStderr());
     
      System.out.println(stdoutURI);
      System.out.println(stderrURI);
     
      File logDir = new File("./service_logs");
      if (!logDir.exists()) {
        logDir.mkdir();
      }

      // Get the Stdouts and StdErrs
      QName x = QName.valueOf(invocationContext.getServiceName());
      String timeStampedServiceName = GfacUtils.createServiceDirName(x);
      File localStdOutFile = new File(logDir, timeStampedServiceName + ".stdout");
      File localStdErrFile = new File(logDir, timeStampedServiceName + ".stderr");
     
      String stdout = ftp.readRemoteFile(stdoutURI, gssCred, localStdOutFile);
      String stderr = ftp.readRemoteFile(stderrURI, gssCred, localStdErrFile);
     
      //set to context
      OutputUtils.fillOutputFromStdout(invocationContext.getMessageContext("output"), stdout, stderr);
     
     
      jobSucsseful = true;     
    } catch (GramException e) {
      String localHost = "xxxx";
      GfacException error = new JobSubmissionFault(e, localHost, contact, rsl, CurrentProviders.Gram);
      if (errCode == 8) {
        error.setFaultCode(ErrorCodes.JOB_CANCELED);
      } else {
        error.setFaultCode(ErrorCodes.JOB_FAILED);
      }
      // error.addProperty(ErrorCodes.JOB_TYPE,
      // ErrorCodes.JobType.Gram.toString());
      // error.addProperty(ErrorCodes.CONTACT, contact);
      throw error;
    } catch (GSSException e) {
      String localHost = context.getServiceContext().getGlobalConfiguration().getLocalHost();
      throw new JobSubmissionFault(e, localHost, contact, rsl, CurrentProviders.Gram);
    } catch (URISyntaxException e) {
      throw new GfacException(e, FaultCode.ErrorAtDependentService);
    } catch (InterruptedException e) {
      throw new GfacException(e, FaultCode.ErrorAtDependentService);
    } finally {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.