- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: Java failure on exec call?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2004 10:26 AM
11-02-2004 10:26 AM
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.TESTING]TESTJOB.COM");
ExitCode = p.waitFor();
}
catch (Exception ex)
{
System.out.println("Error: Could not launch TESTJOB. Mes
sage is :" + ex.getMessage());
}
}
}
When I run the above code, below is the Exception message I receive,
$ java "Example1
Executing TESTJOB
Error: Could not launch TESTJOB. Message is :Child creation error: error 100052
VMS error code: error 100052
Please help.
Thanks
Sandeep
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2004 10:32 AM
11-02-2004 10:32 AM
Re: Java failure on exec call?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2004 03:18 PM
11-02-2004 03:18 PM
SolutionLook at the definition of the r.exec function. Does it expect a command string or the name of an image to execute? I suspect it's the image name, in which case the "@" in the filespec is incorrect and would account for the RMS-F-SYN error.
As a test, try replacing the string with "OVMS01$DKA100:[SYS0.SYSMGR.TESTING]HELLOWORLD.EXE"
It may also accept just the name of the command procedure, so try leaving off the leading "@".
There may be another routine to call to execute an arbitrary DCL command (maybe "system"?).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2004 07:44 PM
11-02-2004 07:44 PM
Re: Java failure on exec call?
I'm with John; r.exec is like spawn c function and I guess you can run only binary imaged (.exe).
You have to search the equivalent method of system c function.
Antonio Vigliotti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2004 08:38 PM
11-02-2004 08:38 PM
Re: Java failure on exec call?
I try yours example on an alpha 7.3-2 same Java version. Same error reported. Johns suggestion works. So you must omitt the @.
Now the strange things. I write the testjob.com like this:
$ open/write f test.dat
$ write f p1," ",p2," ",p3
$ close f
Now I have replaced the
r.exec("@OVMS01$DKA100:[SYS0.SYSMGR.TESTING]TESTJOB.COM"); in
r.exec("OVMS01$DKA100:[SYS0.SYSMGR.TESTING]TESTJOB.COM a b c");
The contents of the test.dat is supposed to be:
a b c
but they are:
OVMS01$DKA100:[SYS0.SYSMGR.TESTING]TESTJOB.COM a b
So pay attention when passing arguments. (The same is when you use an array of strings).
Bojan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2004 04:12 AM
11-03-2004 04:12 AM
Re: Java failure on exec call?
Thank you all for your replies.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2004 04:13 AM
11-03-2004 04:13 AM