Forums » User questions »
Parsing error
Added by Balint Tunde over 14 years ago
Hello,
I was trying to run a simple command with JSAGA from Java. The command is : /bin/data -d "UTC 1970-01-01 1240596879 secs"
First try:
desc.setAttribute(JobDescription.EXECUTABLE, "/bin/date"); desc.setVectorAttribute(JobDescription.ARGUMENTS, new String[]{ "d", "\"UTC 1970-01-01 1240596879 secs\""}); desc.setAttribute(JobDescription.OUTPUT, "out1.txt"); desc.setAttribute(JobDescription.ERROR, "err1.txt"); desc.setVectorAttribute(JobDescription.FILETRANSFER, new String[]{ "/tmp/out.txt" + "<"+"out1.txt", "/tmp/err.txt" + "<"+ "err1.txt"});
Received error:
Job ID: 281ee371-4a2d-4273-81df-7c6989005a5a NoSuccess: The following parsing error(s) have been found: ClassAd utils - cannot parse classad: [ Type = "Job"; Executable = "/bin/date"; Arguments = " d "UTC 1970-01-01 1240596879 secs""; Requirements = true && (other.GlueCEStateStatus=="Production"); Rank = (-other.GlueCEStateEstimatedResponseTime); StdOutput = "out1.txt"; StdError = "err1.txt"; SandboxDirectory = "gsiftp://wms.grid.sara.nl:2811/tmp/1280922469072"; OutputSandboxPostStaging = { [ From = "gsiftp://wms.grid.sara.nl:2811/tmp/1280922469072/out1.txt"; To = "/tmp/out.txt"; Append = "false"; ], [ From = "gsiftp://wms.grid.sara.nl:2811/tmp/1280922469072/err1.txt"; To = "/tmp/err.txt"; Append = "false"; ] }; OutputSandbox = { "out1.txt", "err1.txt"}; OutputSandboxDestURI = { "gsiftp://wms.grid.sara.nl:2811/tmp/1280922469072/out1.txt", "gsiftp://wms.grid.sara.nl:2811/tmp/1280922469072/err1.txt"}; ] Method: jobRegister TimeStamp: Thu Aug 04 2010 13:47:52 GMT ErrorCode: 1507 Cause: AdSyntaxException: The following parsing error(s) have been found: ClassAd utils - cannot parse classad: [ Type = "Job"; Executable = "/bin/date"; Arguments = " d "UTC 1970-01-01 1240596879 secs""; Requirements = true && (other.GlueCEStateStatus=="Production"); Rank = (-other.GlueCEStateEstimatedResponseTime); StdOutput = "out1.txt"; StdError = "err1.txt"; SandboxDirectory = "gsiftp://wms.grid.sara.nl:2811/tmp/1280922469072"; OutputSandboxPostStaging = { [ From = "gsiftp://wms.grid.sara.nl:2811/tmp/1280922469072/out1.txt"; To = "/tmp/out.txt"; Append = "false"; ], [ From = "gsiftp://wms.grid.sara.nl:2811/tmp/1280922469072/err1.txt"; To = "/tmp/err.txt"; Append = "false"; ] }; OutputSandbox = { "out1.txt", "err1.txt"}; OutputSandboxDestURI = { "gsiftp://wms.grid.sara.nl:2811/tmp/1280922469072/out1.txt", "gsiftp://wms.grid.sara.nl:2811/tmp/1280922469072/err1.txt"}; ] at fromString(const string& jdl )[Ad.cpp:339] at Ad::fromString(const string& jdl )[Ad.cpp:318] at getType()[wmpcommon.cpp:311] at jobregister()[wmpcoreoperations.cpp:293] at jobRegister()[wmpcoreoperations.cpp:382] at fr.in2p3.jsaga.adaptor.wms.job.WMSJobControlAdaptor.rethrow(WMSJobControlAdaptor.java:445) at fr.in2p3.jsaga.adaptor.wms.job.WMSJobControlAdaptor.submit(WMSJobControlAdaptor.java:267) at fr.in2p3.jsaga.impl.job.instance.AbstractSyncJobImpl.doSubmit(AbstractSyncJobImpl.java:196) at fr.in2p3.jsaga.impl.task.AbstractTaskImpl.run(AbstractTaskImpl.java:101) at fr.in2p3.jsaga.impl.job.instance.JobImpl.run(JobImpl.java:43) at submitJob.RunJobJSAGA.main(RunJobJSAGA.java:201)
Second try:
desc.setAttribute(JobDescription.EXECUTABLE, "/bin/date"); desc.setVectorAttribute(JobDescription.ARGUMENTS, new String[]{ "d", "UTC 1970-01-01 1240596879 secs"}); desc.setAttribute(JobDescription.OUTPUT, "out1.txt"); desc.setAttribute(JobDescription.ERROR, "err1.txt"); desc.setVectorAttribute(JobDescription.FILETRANSFER, new String[]{ "/tmp/out.txt" + "<"+"out1.txt", "/tmp/err.txt" + "<"+ "err1.txt"});
Job runs, but in the err.txt I get the following message back:
/bin/date: extra operand `UTC' Try `/bin/date --help' for more information.
So the second argument is not transferred correctly.
I was just wondering if this should work somehow or not? I can the command, if I put it in a script, transfer and run the script.
Best,
Tünde
Replies (3)
RE: Parsing error
-
Added by Reynaud Sylvain over 14 years ago
Hi Tünde,
You can try to double-escape (\\ or more?) the double-quotes (") if you really need to use this character, but the easiest is probably to use a simple-quote (') instead.
Best regards,
Sylvain
RE: Parsing error
-
Added by Balint Tunde over 14 years ago
Hi Sylvain,
Thanks, single quote worked...I should have thought of this solution, sorry for the stupid question...
Best regards,
Tünde