(9903) Java r.exec, Error Codes, File Specs?

Archive of the OpenVMS Ask the Wizard (ATW) questions and answers database.
Locked

Topic author
User
Visitor
Posts: 0
Joined: Mon Jan 10, 2022 8:16 am
Reputation: 0
Status: Offline

(9903) Java r.exec, Error Codes, File Specs?

Post by User » Tue Nov 02, 2004 8:26 am

I have VMS version 8.2 on Itanium machine. (I cannot post question when I enter select Other for cpu and OpenVMS version)

When using the following code snippet to execute from within Java I receive an Exception message with the following error message:

Code: Select all

Error: Could not launch TESTJOB. Message is :Child creation error: error
 100052. VMS error code: error 100052


import java.lang.*;

public class Example1

	public static void main(String args[])
	{
		int ExitCode=0;
		try
		{
			Runtime r = Runtime.getRuntime();
			System.out.println("Executing TESTJOB");
			Process p =
 r.exec("@OVMS01$DKA100:[SYS0.SYSMGR.TEST]TESTJOB");
			ExitCode = p.waitFor();
		}
		catch (Exception ex)
		{
			System.out.println("Error: Could not launch TESTJOB.
 Error Message is :" + ex.getMessage());
		}
	}
Last edited by marty.stu on Thu Aug 18, 2022 9:18 am, edited 1 time in total.


Wizard
Visitor
Posts: 0
Joined: Mon Jan 10, 2022 8:17 am
Reputation: 0
Status: Offline

Re: (9903) Java r.exec, Error Codes, File Specs?

Post by Wizard » Wed Nov 03, 2004 8:26 am

For translating an error value into text, you can use the following:

Code: Select all

    $ x=f$message(100052)
    $ show symbol x
      X = "%RMS-F-SYN, file specification syntax error"
The format, content and structure of a condition value are documented in the OpenVMS documentation set. The structure and operation of a condition value are of central interest to all OpenVMS programmers, of course.

The specification to TESTJOB is somewhat unusual, as the OpenVMS Wizard would expect to see:

Code: Select all

    SYS$SYSROOT:[SYSMGR.TEST]TESTJOB
rather than:

Code: Select all

    OVMS01$DKA100:[SYS0.SYSMGR.TEST]TESTJOB
When logical names are available, their use is preferred over use of physical device names and of explicit system-specific root directories. When logical names are not available, the OpenVMS Wizard would create the necessary logical names; the Wizard would avoid the inclusion of physical device or directory specifications in any application code.

Also please look at the documentation for the Java r.exec mechanism, as it is not a direct analog for the OpenVMS RTL lib$spawn call nor the C system call; r.exec has assumptions around the filename. In particular, the r.exec specification expects a filename, and not a DCL command.
Last edited by marty.stu on Thu Aug 18, 2022 9:22 am, edited 2 times in total.

Locked