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