Package org.apache.airavata.gfac.core.provider

Examples of org.apache.airavata.gfac.core.provider.GFacProviderException


                log.info("stdout=" + stdOutputString);
            
//                GFacUtils.updateJobStatus(details, JobState.COMPLETE);
            } catch (Exception e) {
                throw new GFacProviderException(e.getMessage(), e);
            } finally {
                if (cluster != null) {
                  try {
            cluster.disconnect();
          } catch (SSHApiException e) {
            throw new GFacProviderException(e.getMessage(), e);
          }
                }
            }
        } else {
            try {
                jobExecutionContext.getNotifier().publish(new StartExecutionEvent());
                HostDescriptionType host = jobExecutionContext.getApplicationContext().
                        getHostDescription().getType();
                HpcApplicationDeploymentType app = (HpcApplicationDeploymentType) jobExecutionContext.getApplicationContext().
                        getApplicationDeploymentDescription().getType();
                JobDetails jobDetails = new JobDetails();
                String taskID = jobExecutionContext.getTaskData().getTaskID();
                try {
                    Cluster cluster = null;
                    if (jobExecutionContext.getSecurityContext(SSHSecurityContext.SSH_SECURITY_CONTEXT) != null) {
                        cluster = ((SSHSecurityContext) jobExecutionContext.getSecurityContext(SSHSecurityContext.SSH_SECURITY_CONTEXT)).getPbsCluster();
                    }
                    if (cluster == null) {
                        throw new GFacProviderException("Security context is not set properly");
                    } else {
                        log.info("Successfully retrieved the Security Context");
                    }
                    // This installed path is a mandetory field, because this could change based on the computing resource
                    JobDescriptor jobDescriptor = GFACSSHUtils.createJobDescriptor(jobExecutionContext, app, cluster);

                    log.info(jobDescriptor.toXML());

                    jobDetails.setJobDescription(jobDescriptor.toXML());

                    String jobID = cluster.submitBatchJob(jobDescriptor);
                    jobExecutionContext.setJobDetails(jobDetails);
                    if (jobID == null) {
                        jobDetails.setJobID("none");
                        GFacUtils.saveJobStatus(jobExecutionContext, jobDetails, JobState.FAILED);
                    } else {
                        jobDetails.setJobID(jobID);
                        GFacUtils.saveJobStatus(jobExecutionContext, jobDetails, JobState.SUBMITTED);
                    }

                } catch (SSHApiException e) {
                    String error = "Error submitting the job to host " + host.getHostAddress() + " message: " + e.getMessage();
                    log.error(error);
                    jobDetails.setJobID("none");
                    GFacUtils.saveJobStatus(jobExecutionContext, jobDetails, JobState.FAILED);
                    GFacUtils.saveErrorDetails(jobExecutionContext, error, CorrectiveAction.CONTACT_SUPPORT, ErrorCategory.AIRAVATA_INTERNAL_ERROR);
                    throw new GFacProviderException(error, e);
                } catch (Exception e) {
                    String error = "Error submitting the job to host " + host.getHostAddress() + " message: " + e.getMessage();
                    log.error(error);
                    jobDetails.setJobID("none");
                    GFacUtils.saveJobStatus(jobExecutionContext, jobDetails, JobState.FAILED);
                    GFacUtils.saveErrorDetails(jobExecutionContext, error, CorrectiveAction.CONTACT_SUPPORT, ErrorCategory.AIRAVATA_INTERNAL_ERROR);
                    throw new GFacProviderException(error, e);
                }
            } catch (GFacException e) {
                throw new GFacProviderException(e.getMessage(), e);
            }
        }
    }
View Full Code Here


                    }

                }
            } catch (URISyntaxException e) {
                log.error(e.getMessage());
                throw new GFacProviderException(e.getMessage(), e);
            } catch (ToolsException e) {
                log.error(e.getMessage());
                throw new GFacProviderException(e.getMessage(), e);
            }
            outputNew.getParameters().put(paramName, actualParameter);
        }
        jobExecutionContext.setOutMessageContext(outputNew);
    }
View Full Code Here

        try {
            String value = ele.requiredTextContent();
            if (value != null) {
                this.dataID = new URI(value);
            } else {
                throw new GFacProviderException(
                        "Illegal InputMessage, No value content found for the parameter "
                                + ele.getName() + "/value. Invalid Local Argument");
            }
            String location = ele.getAttributeValue(null, DataIDType.LOCATION_ATTRIBUTE);
            if (location != null) {
                addDataLocation(new URI(location));
            }
        } catch (URISyntaxException e) {
            throw new GFacProviderException("Invalid Local Argument", e);
        }
    }
View Full Code Here

                getServiceDescription().getType().getInputParametersArray();
        for (InputParameterType inputParam : inputParamDefinitionArray) {
            String parameterName = inputParam.getParameterName();
            ActualParameter parameter = (ActualParameter)inMessageContext.getParameter(parameterName);
            if(parameter == null){
                throw new GFacProviderException("Cannot find required input parameter " + parameterName + ".");
            }

            parameters.add(MappingFactory.toString(parameter));
        }
View Full Code Here

TOP

Related Classes of org.apache.airavata.gfac.core.provider.GFacProviderException

Copyright © 2018 www.massapicom. 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.