Hi Folks,

we have serious problems to submit ineractive jobs via the gramjob Java API 
(ws-gram). 

First of all we create a FactoryEndpointReferenceType as suggested by
www.ibm.com/developerworks/grid/library/gr-wsgram/index.html

However, it doesn't work. The method gramjob.submit doesn"t throw any 
exception, isn't blocked, but the job is never executed. We have tried to get 
an fault and error code, but we fault of null, and an error of 0 (see end of 
the sniplet.

[snip]

Address: https://xx.xx.xx.xx:8443/wsrf/services/ManagedExecutableJobService
Reference property[0]:
<ns1:ResourceID 
xmlns:ns1="http://www.globus.org/namespaces/2004/10/gram/job";>ffc69550-cf50-11dc-b209-91714a565505</ns1:ResourceID>

5108 [main] DEBUG org.globus.exec.client.GramJob  - Job Endpoint:
Address: https://xx.xx.xx.xx:8443/wsrf/services/ManagedExecutableJobService
Reference property[0]:
<ns1:ResourceID 
xmlns:ns1="http://www.globus.org/namespaces/2004/10/gram/job";>ffc69550-cf50-11dc-b209-91714a565505</ns1:ResourceID>

after job.submit
null
0
[snip]

In the attachments you can find the parts of the source code.

Any ideas? All what we want is to submit jobs using gt wsgram, and the GT4 
Java API, and we like to be able to retrieve the job state, get the exit 
status, and so on...

Cheers

Alexander and Roelof
    private EndpointReferenceType getFactoryEPR (String contact, String factoryType)
	throws Exception {
    		URL factoryUrl = ManagedJobFactoryClientHelper.getServiceURL(contact).getURL();
    		logger.debug("Factory Url: " + factoryUrl);
    		return ManagedJobFactoryClientHelper.getFactoryEndpoint(factoryUrl, factoryType);
}
        if (listener != null && metricDefinitionName != null) {
            Metric metric = wsgt4job.getMetricDefinitionByName(metricDefinitionName)
                    .createMetric(null);
            wsgt4job.addMetricListener(listener, metric);
        }
        if (!useGramSandbox) {
        		wsgt4job.setState(Job.PRE_STAGING);
	        sandbox.prestage();
        }        
        
        GramJob job = new GramJob(RSLHelper
				.makeSimpleJob(createRSL(description, sandbox, useGramSandbox)));
        job.setTimeOut(GramJob.DEFAULT_TIMEOUT);
		job.setAuthorization(HostAuthorization.getInstance());
		job.setMessageProtectionType(Constants.ENCRYPTION);
		job.setDelegationEnabled(true);
		job.setDuration(null);
		job.setTerminationTime(null);
		job.setCredentials(getCred());
		job.addListener(wsgt4job);
		
		//TODO make the factory type flexible.
		EndpointReferenceType epr;
		try {
			epr = getFactoryEPR(host, ManagedJobFactoryConstants.FACTORY_TYPE.FORK);
			System.out.println("Endpoint reference type created to: '" + host + "', factory type: '" + ManagedJobFactoryConstants.FACTORY_TYPE.FORK + "'");
		} catch (Exception e) {
			throw new GATInvocationException("WSGT4newResourceBrokerAdaptor", e);
		}
		
		UUIDGen uuidgen 	= UUIDGenFactory.getUUIDGen();
		String submissionID = "uuid:" + uuidgen.nextUUID();
		System.out.println("UUID created: " + submissionID);

		System.out.println("EPR: " + epr);
		
		try {
			System.out.println("before job.submit");
			job.submit(epr, false, false, submissionID);
			System.out.println("after job.submit");
			System.out.println(job.getFault());
			System.out.println(job.getError());
			System.out.println(GramJob.getJobs(epr));
			wsgt4job.setState(Job.RUNNING);
		} catch (Exception e) {
			throw new GATInvocationException("WSGT4newResourceBrokerAdaptor", e);
		} 

Reply via email to