Hi Rachana,

Sorry I only just joined the mailing list and did not actually post when I was encountering the problem.

I am unable to reference your old email in the gt-user archives, but I am
curious that your proxy credential affected access of GRAM job with a
resource key missing exception. So if you comment out the following code
from your snippet, you see a resource key not found exception?

        //(processing through the extendedgssmanager)
        ExtendedGSSManager manager = (ExtendedGSSManager)
ExtendedGSSManager.getInstance();
        credential = manager.createCredential
(GSSCredential.INITIATE_AND_ACCEPT);
        globusCredential = ((GlobusGSSCredentialImpl)
credential).getGlobusCredential();

I believe that is correct (but I cannot test it right now).
When I was simply loading the proxy credential from disk and setting it as the credential for the job I would get resource key missing errors. When I added the ExtendedGSSManager code the problem went away.

In the security framework, when we load credential from a file, we use only the GlobusGSSCredentialImpl constructor for creating the relevant credential and we don't create a user credential using the ExtendedGSSManager. So I am
surprised about this fix.

I was surprised, too. But I will admit that to an extent I was at a point where I was just trying everything I could think of. Is it possibly something that I am doing when storing the proxy file? It seems unlikely as I could use the same proxy file to authenticate on gsiftp without problems.

Also, just to confirm, in both cases were you using the following utility or
equivalent to create the EPR to the GRAM factory service?

EndpointReferenceType factoryEndpoint
   = ManagedJobFactoryClientHelper.getFactoryEndpoint(factoryUrl,
factoryType);
ManagedJobFactoryPortType factoryPort
   = ManagedJobFactoryClientHelper.getPort(factoryEndpoint);

That is the code I was using, yes.

In your SOAP message header, did you see the resource key was missing in the
previous case?

I could see in the SOAP message that the ResourceID (in my case, PBS) was being correctly set in the XML. I was comparing the XML from my code against the XML from globusrun-ws and they were nearly identical (except for a different way of specifying namespaces, and my java code had an empty ResourceParameters node and globusrun-ws didn't have the ResourceParameters node at all).

Thanks,
Nick


Thanks,
Rachana

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Nick Takayama
Sent: Thursday, November 15, 2007 11:11 PM
To: gt-user@globus.org
Subject: [gt-user] (solved) Resource key is missing. Custom
proxy/credentials involved.

I had trouble finding information when I was struggling with a
'Resource key is missing' error this week. Since I have found the
solution I thought I would post it to this mailing list for others to
find.

Essentially, when I was submitting a GT4 GRAM job I was encountering
the following error:

org.apache.axis.axisfault : java.rmi.remoteexception: job creation
failed.; nested exception is:
org.globus.wsrf.invalidresourcekeyexception: resource key is missing

Most of my code followed the sample code, except that I was loading
my proxy credentials manually from a proxy file in a non-standard
location.
I eventually came to the realization that not all GSSCredential
objects are the same. Even though I had loaded my GSSCredential, it
needed to be processed by the ExtendedGSSManager in order to contain
the correct resource key for job submission.

The working code ended up being:

        //credentials
        GSSCredential credential;
        GlobusCredential globusCredential;

        globusCredential = new GlobusCredential
( this.proxyCertLocation );
        credential = new GlobusGSSCredentialImpl( globusCredential,
GSSCredential.INITIATE_AND_ACCEPT );
        //set default credential to prevent accidental loading of
default globus proxy files
        GlobusCredential.setDefaultCredential(globusCredential);

        //(processing through the extendedgssmanager)
        ExtendedGSSManager manager = (ExtendedGSSManager)
ExtendedGSSManager.getInstance();
        credential = manager.createCredential
(GSSCredential.INITIATE_AND_ACCEPT);
        globusCredential = ((GlobusGSSCredentialImpl)
credential).getGlobusCredential();

        //set security
        HostAuthorization iA = new HostAuthorization();
        ClientSecurityDescriptor secDesc = new
ClientSecurityDescriptor();
        secDesc.setGSITransport(GSIConstants.ENCRYPTION);
        secDesc.setAuthz(iA);
        secDesc.setGSSCredential(credential);
        secDesc.setProxyFilename(this.proxyCertLocation);
        ((Stub) factoryPort)._setProperty
(Constants.CLIENT_DESCRIPTOR, secDesc);

        Calendar cal = Calendar.getInstance();
        cal.add(java.util.Calendar.HOUR,50);

        //generate unique ID for referencing job later
        String uuid = UUIDGenFactory.getUUIDGen().nextUUID();

        CreateManagedJobInputType jobInput = new
CreateManagedJobInputType();
        jobInput.setJobID(new AttributedURI("uuid:" + uuid));
        jobInput.setInitialTerminationTime(cal);
        jobInput.setJob(jobDescription);

        CreateManagedJobOutputType createResponse =
factoryPort.createManagedJob(jobInput);
        EndpointReferenceType jobEndpoint =
createResponse.getManagedJobEndpoint();

I hope this information might come in useful for somebody else.
Although I understand it is not common to load proxy credentials from
a non-standard location.

--
Nick Takayama
Centre for Comparative Genomics
Murdoch University              Ph: +61-8-9360-2961
Murdoch, WA
Australia  6150                 Fx: +61-8-9360-7238



Reply via email to