[GE users] SGE6.2u5 DRMAA - Java Illegal Argument Exception with Transfer Files

kimsc kim_sc at telenet.be
Mon Aug 16 13:31:31 BST 2010


Hi Users,

I'm working with SGE 6.2u5 in a AmazonWS EC2 environment that has a couple 
of nodes.  I want to use those nodes to execute an application that gives it 
results and errors back via the default/error console, so I added error-path 
and output-path to the jobtemplate. I also set the transferFiles to the 
correct mode (output/error-stream, but no inputstream).

I currently have the following code:
    SessionFactory sessionFactory = SessionFactory.getFactory();
    Session session = sessionFactory.getSession();
    session.init("");

    JobTemplate jt = session.createJobTemplate();
    jt.setRemoteCommand("ls");
    jt.setErrorPath("master:/jobs/");
    jt.setOutputPath("master:/jobs/");
    jt.setTransferFiles(new FileTransferMode(false, true, true));

    JobInfo info = session.wait(id, Session.TIMEOUT_WAIT_FOREVER);

    if (info.wasAborted()) {
        LOG.info("Job " + info.getJobId() + " never ran");
        return "[ABORTED]";
    } else if (info.hasExited()) {
        LOG.info("Job " + info.getJobId() + " finished regularly with exit 
status " + info.getExitStatus());
    } else {
        LOG.info("Not sure what job " + info.getJobId() + " did, maybe check 
the logs?");
    }

When running this in a glassfish (3.0.1ml) container (with a the 
sge6.2_5/lib/lx24_amd64/* symlinked in glassfish/lib), I get the following 
exception:
ERROR [Request] Failed to process SGE work step
java.lang.IllegalArgumentException:
        at com.sun.grid.drmaa.SessionImpl.nativeSetAttributeValue(Native 
Method)
        at 
com.sun.grid.drmaa.JobTemplateImpl.setAttribute(JobTemplateImpl.java:1028)
        at 
com.sun.grid.drmaa.JobTemplateImpl.setTransferFiles(JobTemplateImpl.java:874)
        at com.dummy.Request.test(Request.java:65)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at 
org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1056)
        at 
org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1128)


with Request:java:65 being the following line:
    jt.setTransferFiles(new FileTransferMode(false, true, true));

I traced it down to the native libraries, but couldn't find a reason why 
this error occured:

    public void setTransferFiles(FileTransferMode mode) throws 
DrmaaException {
        StringBuffer buf = new StringBuffer();

        if (mode.getInputStream()) {
            buf.append('i');
        }

        if (mode.getOutputStream()) {
            buf.append('o');
        }

        if (mode.getErrorStream()) {
            buf.append('e');
        }

        this.setAttribute(TRANSFER_FILES, buf.toString());
    }

    private void setAttribute(String name, Collection value) throws 
DrmaaException {
        session.nativeSetAttributeValues(id, name, 
(String[])value.toArray(new String[value.size()]));
    }


Maybe someone else has an idea?

Kind regards,
Kim

------------------------------------------------------
http://gridengine.sunsource.net/ds/viewMessage.do?dsForumId=38&dsMessageId=274677

To unsubscribe from this discussion, e-mail: [users-unsubscribe at gridengine.sunsource.net].



More information about the gridengine-users mailing list