Executing System call
String SRCPATH = "/home/mohamed/file1.txt";
String DESPATH = "/home/mohamed/file2.txt";
String command = "tail +10 " + SRCPATH + " > " + DESPATH;
Process p = Runtime.getRumtime ().exec (command);
I tried to execute this program. This is not not getting executed. The command String contains "tail +10 /home/mohamed/file1.txt > /home/mohamed/file2.txt "
If will execute the above string in the command line i am able to get the output.
Please help me out in executing the program.
Characters like >, |, &, etc. are interpreted by the shell, not by the command you're executing. The tail command never sees the >. So if you want to use those shell facilities, execute a shell, and tell it to execute the command. Something like this, though the details may be different on your particular *nix.
rt.exec("/bin/bash -c 'tail a > b'");Although it's probably better to use the exec that takes an array of Strings. Something like this, IIRC.
rt.exec(new String[] {"/bin/bash", "-c", "tail a > b"});
Similar Messages
-
Can I source an environment before making a system call from the database
I can execute system calls from the database like
Process proc = Runtime.getRuntime().exec("env");
but I am unable to source an environment before making the call.
Our goal is to from within the database to execute tkprof on a
raw trace file then load both files into clobs in a table. We can load
the raw trace no problem, we just cannot figure out how to execute
tkrprof on the raw trace then load its output.
Anyone know if this is possible to hava java get a runtime and then call
an environment file to source the environment so that path's and other environment variables are set prior to executing another system command.Thanks for that...but can I do multiple edits in my Stored Procedure Vaibhav and pass back something that I can then utilize in my SSIS? For example...
One and Only one Member Span...so I'd be doing a SELECT COUNT(*) based on my match criteria or handle the count accordingly in my Stored Procedure and passing something back via the OLE DB Command and handling it appropriately in SSIS
Are there "Diabetes" claims...again probably by analyzing a SELECT COUNT(*)
Am I expecting too much from the SSIS...should I be doing all of this in a Stored Procedure? I was hoping to use the SSIS GUI for everything but maybe that's just not possible. Rather use the Stored Procedure to analyze my stged data, edit accordingly, do
data stores accordingly...especially the data anomalies...and then use the SSIS to control navigation
Your thoughts........
Could you maybe clarify the difference between an OLE DB Command on the Data Flow and the Execute SQL Task on the Control Flow...
You can get return values from oledb comand if you want to pipeline.
see this link for more details
http://josef-richberg.squarespace.com/journal/2011/6/30/ssis-oledb-command-and-procedure-output-params.html
The procedure should have an output parameter defined for that
I belive if you've flexibility of using stored procedure you may be better off doing this in execute sql task in control flow. Calling sp in data flow will cause it to execute sp once for each row in dataset whereas in controlflow it will go for set based
processing
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page -
How to make system call to execute command line in JAVA?
Hi,
I am new in JAVA. How to make system call to execute the following command line in JAVA in LINUX environment.
rpm -qa jdkIn C programming, use as such:
system ("rpm -qa jdk");
How about JAVA?
Thanks.Runtime.getRuntime().exec. But first read this:
http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html -
How to execute a cvs command using System Call?
hi all,
how to execute a cvs login command using system call ?
thanks,
damTo anyone that reached this post and still dont have a hint, try this small sample - it logs on CVS using installed CVSNT and execute a fake update:
package testeCVS;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
public class execCMD
String password="yourPassword";
String directory="C:\\CVS\\yourPathToProject";
//send commands to CVS and shows the resulting screen
public int sendCMD(String[] command) throws IOException, InterruptedException
ProcessBuilder pb = new ProcessBuilder(command);
pb.directory(new File(directory));
pb.redirectErrorStream(true); // merge stdout and stderr
Process p = pb.start();
InputStreamReader isr = new InputStreamReader(p.getInputStream());
BufferedReader br = new BufferedReader(isr);
String lineRead;
StringBuilder buffer=new StringBuilder();
System.out.println("Return of shell:");
while ((lineRead = br.readLine()) != null)
buffer.append(lineRead + "\n");
System.out.println(buffer.toString());
return p.waitFor();
//send commands to CVS, send the password after the prompt and show the resulting screen
public int sendDialogCMD(String[] command) throws IOException, InterruptedException
ProcessBuilder pb = new ProcessBuilder(command);
pb.directory(new File(directory));
pb.redirectErrorStream(true); // merge stdout and stderr
Process p = pb.start();
PrintWriter writer = new PrintWriter( new OutputStreamWriter( p.getOutputStream() ));
writer.println( password );
writer.flush();
InputStreamReader isr = new InputStreamReader(p.getInputStream());
BufferedReader br = new BufferedReader(isr);
String lineRead;
StringBuilder buffer=new StringBuilder();
System.out.println("Return of shell:");
while ((lineRead = br.readLine()) != null)
buffer.append(lineRead + "\n");
System.out.println(buffer.toString());
return p.waitFor();
public static void main(String a[]) throws IOException, InterruptedException
execCMD e=new execCMD();
String[] command = new String[5];
command[0] = "cvs";
command[1] = "-q";
command[2] = "-d";
command[3] = ":pserver:yourUserID@localhost:2402/path/of/yourProject"; //in this case using CVS port 2402
command[4] = "login";
System.out.println("exit value=" + e.sendDialogCMD(command));
command = new String[8];
command[0] = "cvs";
command[1] = "-q";
command[2] = "-d";
command[3] = ":pserver:yourUserID@localhost:2402/path/of/yourProject";
command[4] = "-n";
command[5] = "-q";
command[6] = "update";
command[7] = "-dA";
System.out.println("exit value=" + e.sendCMD(command));
}It is possible to send the password on the same command, but I had problems when the password had the character '@' because CVSNT took it as the separator between the username and server name. In that case the command is: ":pserver:yourUserID:yourPassword@localhost:2402/path/of/yourProject" -
Exchange 2007 SP3 Install on 2008R2 Fails with "The data passed to a system call is too small"
I'm installing Exchange 2007 SP3 onto Server 2008 R2. I have run this install in compatibility mode and in normal install mode with the same results. Error code 3221684346: The data area passed to a system call is too small. I am installing directly from
the SP3 files, this is not an upgrade. What do I have to do to get this to work?
[2/15/2011 7:24:18 AM] [2] Interpreting line <CreateSecureKey:MSExchangeIS\ParametersPrivate> -- ID:31259 --
[2/15/2011 7:24:18 AM] [2] CInsParser::ScProcessLine (f:\08.03.0083\sources\dev\admin\src\libs\exsetup\hiddenw1.cxx:1199)
Error code 0XC007007A (122): The data area passed to a system call is too small.
[2/15/2011 7:24:18 AM] [2] Processing file 'C:\Exchange Server\Setup\data\mdb_reg.ins', at or near line 77 (CreateSecureKey:MSExchangeIS\ParametersPrivate) -- ID:31111 -- CInsParser::ScProcessLine (f:\08.03.0083\sources\dev\admin\src\libs\exsetup\hiddenw1.cxx:488)
Error code 0XC007007A (122): The data area passed to a system call is too small.
[2/15/2011 7:24:18 AM] [2] Registry file name: 'C:\Exchange Server\Setup\data\mdb_reg.ins' CRegistryManager::ScProcessFile (f:\08.03.0083\sources\dev\admin\src\udog\setupbase\tools\regmgr.cxx:125)
Error code 0XC007007A (122): The data area passed to a system call is too small.
[2/15/2011 7:24:18 AM] [2] Filename = 'C:\Exchange Server\Setup\data\mdb_reg' CBaseAtom::ScRunRegistryFile (f:\08.03.0083\sources\dev\admin\src\udog\setupbase\basecomp\baseatom.cxx:1379)
Error code 0XC007007A (122): The data area passed to a system call is too small.
[2/15/2011 7:24:18 AM] [2] Leaving CBaseAtom(Information Store Service)::ScRunRegistryFile
[2/15/2011 7:24:18 AM] [2] Filename = 'C:\Exchange Server\Setup\data\mdb_reg' CBaseAtom::ScAddRegistryKeys (f:\08.03.0083\sources\dev\admin\src\udog\setupbase\basecomp\baseatom.cxx:1249)
Error code 0XC007007A (122): The data area passed to a system call is too small.
[2/15/2011 7:24:18 AM] [2] Leaving CBaseAtom(Information Store Service)::ScAddRegistryKeys
[2/15/2011 7:24:18 AM] [2] CAtomBaseMDB::ScAddRegistryKeys (f:\08.03.0083\sources\dev\admin\src\udog\exsetdata\components\server\a_basemdb.cxx:132)
Error code 0XC007007A (122): The data area passed to a system call is too small.
[2/15/2011 7:24:18 AM] [2] Leaving CAtomBaseMDB::ScAddRegistryKeys
[2/15/2011 7:24:18 AM] [2] CBaseAtom::ScAdd (f:\08.03.0083\sources\dev\admin\src\udog\setupbase\basecomp\baseatom.cxx:639)
Error code 0XC007007A (122): The data area passed to a system call is too small.
[2/15/2011 7:24:18 AM] [2] Leaving CBaseAtom(Information Store Service)::ScAdd
[2/15/2011 7:24:18 AM] [2] Service = 'MSExchangeIS' CBaseServiceAtom::ScAdd (f:\08.03.0083\sources\dev\admin\src\udog\setupbase\basecomp\basesvcatom.cxx:203)
Error code 0XC007007A (122): The data area passed to a system call is too small.
[2/15/2011 7:24:18 AM] [2] Leaving CBaseServiceAtom(Information Store Service)::ScAdd
[2/15/2011 7:24:18 AM] [2] mode = 'Install' (61953) CBaseAtom::ScSetup (f:\08.03.0083\sources\dev\admin\src\udog\setupbase\basecomp\baseatom.cxx:535)
Error code 0XC007007A (122): The data area passed to a system call is too small.
[2/15/2011 7:24:18 AM] [2] ScSetupAtom (f:\08.03.0083\sources\dev\admin\src\udog\exsetdata\exsetds.cxx:897)
Error code 0XC007007A (122): The data area passed to a system call is too small.
[2/15/2011 7:24:18 AM] [2] Leaving ScSetupAtom
[2/15/2011 7:24:18 AM] [2] [ERROR] An error occurred. The error code was 3221684346. The message was The data area passed to a system call is too small..
[2/15/2011 7:24:18 AM] [1] The following 1 error(s) occurred during task execution:
[2/15/2011 7:24:18 AM] [1] 0. ErrorRecord: An error occurred. The error code was 3221684346. The message was The data area passed to a system call is too small..
[2/15/2011 7:24:18 AM] [1] 0. ErrorRecord: Microsoft.Exchange.Management.Deployment.ExsetdataException: An error occurred. The error code was 3221684346. The message was The data area passed to a system call is too small..
[2/15/2011 7:24:18 AM] [1] [ERROR] An error occurred. The error code was 3221684346. The message was The data area passed to a system call is too small..
[2/15/2011 7:24:18 AM] [1] Setup is halting task execution because of one or more errors in a critical task.
[2/15/2011 7:24:18 AM] [1] Finished executing component tasks.
[2/15/2011 7:24:18 AM] [1] Ending processing.
[2/15/2011 7:42:08 AM] [0] End of Setup
[2/15/2011 7:42:08 AM] [0] **********************************************I would probably rebuild the host machine. The Exchange installation should occur without any issues, and where a problem does occur that can be an indication of a more widespread problem. Rebuild the machine, reinstall the prerequisites and try again.
Simon.
Simon Butler, Exchange MVP
Blog |
Exchange Resources | In the UK?
Hire Me.
Hello Poster.
I am having the same issue, however it is most likely NOT a host box problem. The above advice is not a fix. I have 3 servers that are cloned with the same setup. 2 were fixed by doing the Vista compatibility trick, this one gave a different error (which
happened to be the same as above). This org was a 5.5 to 2000. to 2003 coexistence with 2007 currently(because the mailbox role won't install). It has something to do with AD or permissions. Server 2008 r2 inherently has problems installing exchange.
Example, having to use vista compatibility to get the mailbox role to install. SP2 patch gives the same error to some people, and also doesn't upgrade the mailbox role properly in some cases. Some people have had luck restarting the IIS admin service, but
that did not solve my copy of this error. I will repost here if I find a solution to this issue...
Same exact setup log for me as well.
[3/4/2011 10:45:51 AM] [2] Interpreting line <OpenMachineKey:SYSTEM\CurrentControlSet\Services> -- ID:31259 --
[3/4/2011 10:45:51 AM] [2] Interpreting line <CreateSecureKey:MSExchangeIS\ParametersPrivate> -- ID:31259 --
[3/4/2011 10:45:51 AM] [2] CInsParser::ScProcessLine (f:\08.03.0083\sources\dev\admin\src\libs\exsetup\hiddenw1.cxx:1199)
Error code 0XC007007A (122): The data area passed to a system call is too small.
[3/4/2011 10:45:51 AM] [2] Processing file 'C:\Program Files\Microsoft\Exchange Server\Setup\data\mdb_reg.ins', at or near line 77 (CreateSecureKey:MSExchangeIS\ParametersPrivate) -- ID:31111 -- CInsParser::ScProcessLine (f:\08.03.0083\sources\dev\admin\src\libs\exsetup\hiddenw1.cxx:488)
Error code 0XC007007A (122): The data area passed to a system call is too small.
[3/4/2011 10:45:51 AM] [2] Registry file name: 'C:\Program Files\Microsoft\Exchange Server\Setup\data\mdb_reg.ins' CRegistryManager::ScProcessFile (f:\08.03.0083\sources\dev\admin\src\udog\setupbase\tools\regmgr.cxx:125)
Error code 0XC007007A (122): The data area passed to a system call is too small.
[3/4/2011 10:45:51 AM] [2] Filename = 'C:\Program Files\Microsoft\Exchange Server\Setup\data\mdb_reg' CBaseAtom::ScRunRegistryFile (f:\08.03.0083\sources\dev\admin\src\udog\setupbase\basecomp\baseatom.cxx:1379)
Error code 0XC007007A (122): The data area passed to a system call is too small.
[3/4/2011 10:45:51 AM] [2] Leaving CBaseAtom(Information Store Service)::ScRunRegistryFile
[3/4/2011 10:45:51 AM] [2] Filename = 'C:\Program Files\Microsoft\Exchange Server\Setup\data\mdb_reg' CBaseAtom::ScAddRegistryKeys (f:\08.03.0083\sources\dev\admin\src\udog\setupbase\basecomp\baseatom.cxx:1249)
Error code 0XC007007A (122): The data area passed to a system call is too small.
[3/4/2011 10:45:51 AM] [2] Leaving CBaseAtom(Information Store Service)::ScAddRegistryKeys
[3/4/2011 10:45:51 AM] [2] CAtomBaseMDB::ScAddRegistryKeys (f:\08.03.0083\sources\dev\admin\src\udog\exsetdata\components\server\a_basemdb.cxx:132)
Error code 0XC007007A (122): The data area passed to a system call is too small.
[3/4/2011 10:45:51 AM] [2] Leaving CAtomBaseMDB::ScAddRegistryKeys
[3/4/2011 10:45:51 AM] [2] CBaseAtom::ScAdd (f:\08.03.0083\sources\dev\admin\src\udog\setupbase\basecomp\baseatom.cxx:639)
Error code 0XC007007A (122): The data area passed to a system call is too small.
[3/4/2011 10:45:51 AM] [2] Leaving CBaseAtom(Information Store Service)::ScAdd
[3/4/2011 10:45:51 AM] [2] Service = 'MSExchangeIS' CBaseServiceAtom::ScAdd (f:\08.03.0083\sources\dev\admin\src\udog\setupbase\basecomp\basesvcatom.cxx:203)
Error code 0XC007007A (122): The data area passed to a system call is too small.
[3/4/2011 10:45:51 AM] [2] Leaving CBaseServiceAtom(Information Store Service)::ScAdd
[3/4/2011 10:45:51 AM] [2] mode = 'Install' (61953) CBaseAtom::ScSetup (f:\08.03.0083\sources\dev\admin\src\udog\setupbase\basecomp\baseatom.cxx:535)
Error code 0XC007007A (122): The data area passed to a system call is too small.
[3/4/2011 10:45:51 AM] [2] ScSetupAtom (f:\08.03.0083\sources\dev\admin\src\udog\exsetdata\exsetds.cxx:897)
Error code 0XC007007A (122): The data area passed to a system call is too small.
[3/4/2011 10:45:51 AM] [2] Leaving ScSetupAtom
[3/4/2011 10:45:51 AM] [2] [ERROR] An error occurred. The error code was 3221684346. The message was The data area passed to a system call is too small..
[3/4/2011 10:45:51 AM] [1] The following 1 error(s) occurred during task execution:
[3/4/2011 10:45:51 AM] [1] 0. ErrorRecord: An error occurred. The error code was 3221684346. The message was The data area passed to a system call is too small..
[3/4/2011 10:45:51 AM] [1] 0. ErrorRecord: Microsoft.Exchange.Management.Deployment.ExsetdataException: An error occurred. The error code was 3221684346. The message was The data area passed to a system call is too small..
[3/4/2011 10:45:51 AM] [1] [ERROR] An error occurred. The error code was 3221684346. The message was The data area passed to a system call is too small..
[3/4/2011 10:45:51 AM] [1] Setup is halting task execution because of one or more errors in a critical task.
[3/4/2011 10:45:51 AM] [1] Finished executing component tasks.
[3/4/2011 10:45:51 AM] [1] Ending processing.
Just curious though, how long is your FQDN? Mine is 34 characters plus whatever exchange is adding to it during setup for this particular string. I found a post with the same error for ISA server and some buffer is only 100 characters for a system call.
ERROR_INSUFFICIENT_BUFFER 122 (0x7A) The data area passed to a system call is too small. http://msdn.microsoft.com/en-us/library/ms681382(v=vs.85).aspx Indicates a msft programming problem.
Outsource Technology Inc. MSFT Professional Consultant -
Dear All,
I am getting a below error while doing ehp6 installation on sybase (high availbility )
can any one help me on this..?
An error occurred while processing option SAP Business Suite 7i 2011 > Enhancement Package 6 for SAP ERP 6.0 > SAP Application Server ABAP > SAP ASE > High-Availability System > Database Instance( Last error reported by the step: System call failed. Error 2 (The system cannot find the file specified. ) in execution of system call 'CreateProcessAsUser' with parameter ( , NULL, Program Files/sapinst_instdir/BS2011/ERP606/AS-ABAP/SYB/HA/DB, &StartupInfo, &ProcessInfo), line (646) in file (d:\depot\bas\720_rel\bc_720-2_rel\gen\optu\ntamd64\ins\sapinst\impl\src\syslib\synxcchapp.cpp), stack trace: d:\depot\bas\720_rel\bc_720-2_rel\gen\optu\ntamd64\ins\sapinst\impl\src\ejs\ejscontroller.cpp: 181: EJSControllerImpl::executeScript() d:\depot\bas\720_rel\bc_720-2_rel\gen\optu\ntamd64\ins\sapinst\impl\src\ejs\jsextension.hpp: 1059: CallFunctionBase::call() d:\depot\bas\720_rel\bc_720-2_rel\gen\optu\ntamd64\ins\sapinst\impl\src\osmod\iaxxbprocess.cpp: 423: CIaOsProcess::start_impl() d:\depot\bas\720_rel\bc_720-2_rel\gen\optu\ntamd64\ins\sapinst\impl\src\syslib\synxcchapp.cpp: 238: CSyChildApplicationImpl::start(false) d:\depot\bas\720_rel\bc_720-2_rel\gen\optu\ntamd64\ins\sapinst\impl\src\syslib\synxcchapp.cpp: 262: CSyChildApplicationImpl::doStart() .). You can no
Regards,
Letz..Hello Mauricio.
Thanks
Two Thinks:
1.- This error appears precisely in the process of creating SAP users including you mention sidadm:
A.- Execute sapinst
B.- Installation option is chosen
SAP NetWeaver CE Production Edition
Installation Options
High-Availability System
Central Service Instance (SCS)
c.- System ID, Next and appear message error
2.- However, the user manually create sidadm, I gave the permissions you indicate, and the error message is the same
Thanks -
Unix system() system call in Java
Hi,
system() call in Unix is very helpfull when you need to implement a piece of code that is already implemented in an exsiting utility.
Is there a way to achive a similar functionality?
To put it in simpler words - is there a way, in Java, to call some method that will invoke a Unix shell and will execute the command specified in the string that is past in?
Could you please CC the reply to [email protected]
Thanks,
-MichaelRuntime.exec()
> Could you please CC the reply to [email protected]
Certainly not. -
Reading output of a system call
Hi,
It appears that java system call does not return a value in Netware OS.
The same code functions flawlessly on other OS'es, eg. linux and windows.
If the following code is run on a Netware (6.5), the following error is
returned:
External App Returned:
java.io.IOException: Bad file number
Does anyone knows how to receive the values from the system call on Netware?
To reproduce the problem, do the following:
1) save the included source code to netware server's sys:java/classes
with a filename ExecuteExternalApp.java
2) compile it issuing a console command:
javac sys:java/classes/ExecuteExternalApp.java
3) execute the application:
java ExecuteExternalApp volumes
This should successfully launch the system command "volumes" but also
would give an error message:
External App Returned:
java.io.IOException: Bad file number
---- Source code
import java.io.*;
public class ExecuteExternalApp{
public static String executeSystemCommand(String command) throws
Exception {
String ret = "";
try
Process process = Runtime.getRuntime().exec(command);
BufferedReader input = new BufferedReader(new
InputStreamReader(process.getInputStream()));
BufferedReader err = new BufferedReader(new
InputStreamReader(process.getErrorStream()));
//InputStreamReader iar = new
InputStreamReader(process.getInputStream());
StringBuffer sb = new StringBuffer();
String line = "";
//while ((line = input.readLine()) != null)
//testi tuleeko yksi rivi
line = input.readLine();
sb.append(line);
input.close();
ret = sb.toString();
catch (Exception err)
ret = err.toString();
return ret;
public static void main(String[] args) throws Exception {
if (args.length > 0){
String output = executeSystemCommand(args[0]);
System.out.println("External App Returned:");
System.out.println(output);
else
System.out.println("Usage: ExecuteExternalApp <command>");Guenter wrote:
> Hi Jonne,
> Jonne Viljanen <jonne.viljanen@rmv_this.helsinki.fi> wrote in
> news:y%[email protected]:
>
>> Thank you for your effort. I've been trying to write a simple program
>> that would monitor if any cluster resource would be in comatose and in
>> such case, it would try to online the resource on some other cluster
>> node. For this I'd need to run these system commands and parse their
>> output:
>>
>> - "cluster resources" - to see if any resource is in comatose
>>
>> and
>>
>> - "cluster view" - to determine which nodes are online.
>>
>> Also i'd need to run "cluster offline resource" and "cluster online
>> resource node", but for these command I would not need to get the
>> output.
>>
>> I know that my approach is a bit clumsy, but it's beauty is in its
>> simplicity. Novell's engineer suggested that with a bit more effort one
>> could read the data from ldap or cluster related virtual XML files on
>> the _Admin volume. I think that I should investigate the latter
>> approach, since I'd like to avoid handling the ldap authentication. I
>> appreciate any comments and suggestions. Code examples are also greatly
>> welcomed ;-)
> hmmm, well that sounds to me as if the language doesnt matter at all since
> finally you most likely fire your app from cron to do these tasks frequently
> automatically, right? Therefore I'd suggest you take a look at Perl - it
> seems better suited for these tasks; look at sys:/perl/scripts where you find
> Perl scripts which do already some cluster stuff, and AFAICT these make use
> of the _ADMIN volume.
> Additional info and Perl samples can be found with the VFS NDK IIRC:
> http://developer.novell.com/wiki/ind..._File_Services
>
> greetz, Gnter.
>
Hi Gnter,
Thank you for your excellent help. I started to play with the _ADMIN
-volume today. I was amazed to see how much can be done with it. I got
my little cluster watch application almost working in just 1 hour, but
then spent the rest of the day trying to get it fully functional ;-) I
still cannot figure out what is wrong with my code, so I was wondering
if I could get any help from this newsgroup.
I'm able to read the *.xml files and determine the cluster state and all
the information I need. However I dont seem to be able to write the
command files. I'm trying the following:
public void offlineClusterResource(String resourceName) {
String fileName = "_ADMIN:/Novell/cluster/Resource.cmd";
//String logFile = "sys:java/classes/ClusterWorker.log";
String commandLine = "<virtualIO><datastream
name=\"command\"></virtualIO>"+
"<ncsRequest><offline>" +
"<resource>" + resourceName + "</resource>" +
"</offline></ncsRequest>";
//Log("Turning the cluster resource " + resourceName + "
offline!!!", logFile);
try {
//PrintWriter in autoFlush mode
PrintWriter pw = new PrintWriter(new FileWriter(fileName,
false), false);
pw.println(commandLine);
pw.close();
} catch (IOException e) {
System.out.println("Unable to write " + fileName);
It seems not to write anything to _ADMIN:/Novell/cluster/Resource.cmd.
If I set the file to be eg. SYS:/tmp/Resource.cmd -it writes nicely to
the file.
What am I missing here?
Cheers,
Jonne -
How to execute or call other application
I have doubt in executing or calling any exe file using java application.
For example: i have a button. If i click on that button, then any application (eg. any exe file, any program file, etc) will execute and come out in the different frame. Now, i don't know how to make the coding.
I need the helps. Please give me any code or ideas.
Thanks very muchSorry. if you are writing a sample program just to get a feel of Java, then the following is sufficient. Note that I have added "throws Exception" after the "main" method signature.
import javax.swing.JOptionPane; // import class JOptionPane
public class Welcome4 {
// main method begins execution of Java application
public static void main( String args[] ) throws Exception
JOptionPane.showMessageDialog(
null, "Welcome\nto\nJava\nProgramming!" );
String command = "d:\\test\\test.bat";
Process p = Runtime.getRuntime().exec(command);
p.waitFor();
System.out.println("done");
System.exit( 0 ); // terminate application
} // end method main
} // end class Welcome4 -
Hi experts,
When I install additonal dialog instance , the system issue the error:
INFO 2014-12-23 16:34:04.436 [syuxcfile.cpp:218]
CSyFileImpl::removeEx(ISyFSErrorHandler * pErrorHandler)
lib=syslib module=syslib
Removed file /sapmnt/HE5/exe/jdbcconnect.jar.
ERROR 2014-12-23 16:34:04.466 [syuxcfile.cpp:292]
CSyFileImpl::copy(const CSyPath & /usr/sap/HE5/SYS/exe/run/jdbcconnect.jar, ISyNode::CopyMoveMode_t 0x3, ISyProgressObserver*) const
lib=syslib module=syslib
FSL-00009 System call failed. Error 13 (The file access permissions do not allow the specified action.) in execution of system call 'openU' with parameter (/usr/sap/trans/tmp/AIXinst/swpm/COMMON/INSTALL/JDBCCONNECT.JAR, O_RDONLY), line (291) in file (syuxcfile.cpp), stack trace: EJSController.cpp: 183: EJSControllerImpl::executeScript()
JSExtension.hpp: 1072: CallFunctionBase::call()
iaxxbfile.cpp: 493: CIaOsFile::copyFromPath_impl()
syuxcfile.cpp: 255: CSyFileImpl::copy(const CSyPath & /usr/sap/HE5/SYS/exe/run/jdbcconnect.jar, ISyNode::CopyMoveMode_t 0x3, ISyProgressObserver*) const
WARNING 2014-12-23 16:34:04.488 [syuxcpath.cpp:663]
CSyPath::getOSNodeType(bool false) lib=syslib module=syslib
System call failed. Error 13 (The file access permissions do not allow the specified action.) in execution of system call 'lstat' with parameter (/usr/sap/trans/tmp/AIXinst/swpm/COMMON/INSTALL/JDBCCONNECT.JAR), line (660) in file (syuxcpath.cpp), stack trace: EJSController.cpp: 183: EJSControllerImpl::executeScript()
JSExtension.hpp: 1072: CallFunctionBase::call()
iaxxbfile.cpp: 493: CIaOsFile::copyFromPath_impl()
syuxcfile.cpp: 255: CSyFileImpl::copy(const CSyPath & /usr/sap/HE5/SYS/exe/run/jdbcconnect.jar, ISyNode::CopyMoveMode_t 0x3, ISyProgressObserver*) const
syuxcpath.cpp: 604: CSyPath::getOSNodeType(bool false)
ERROR 2014-12-23 16:34:04.489 [syuxcfile.cpp:308]
CSyFileImpl::copy(const CSyPath & /usr/sap/HE5/SYS/exe/run/jdbcconnect.jar, ISyNode::CopyMoveMode_t 0x3, ISyProgressObserver*) const
lib=syslib module=syslib
FSL-02015 Node /usr/sap/trans/tmp/AIXinst/swpm/COMMON/INSTALL/JDBCCONNECT.JAR does not exist.
ERROR 2014-12-23 16:34:04.506
CJSlibModule::writeError_impl()
MUT-03025 Caught ::ESyException in module call: At line 311 file syuxcfile.cpp
Call stack:
EJSController.cpp: 183: EJSControllerImpl::executeScript()
JSExtension.hpp: 1072: CallFunctionBase::call()
iaxxbfile.cpp: 493: CIaOsFile::copyFromPath_impl()
syuxcfile.cpp: 255: CSyFileImpl::copy(const CSyPath & /usr/sap/HE5/SYS/exe/run/jdbcconnect.jar, ISyNode::CopyMoveMode_t 0x3, ISyProgressObserver*) const
System call failed. Error 13 (The file access permissions do not allow the specified action.) in execution of system call 'openU' with parameter (/usr/sap/trans/tmp/AIXinst/swpm/COMMON/INSTALL/JDBCCONNECT.JAR, O_RDONLY), line (291) in file (syuxcfile.cpp), stack trace: EJSController.cpp: 183: EJSControllerImpl::executeScript()
JSExtension.hpp: 1072: CallFunctionBase::call()
iaxxbfile.cpp: 493: CIaOsFile::copyFromPath_impl()
syuxcfile.cpp: 255: CSyFileImpl::copy(const CSyPath & /usr/sap/HE5/SYS/exe/run/jdbcconnect.jar, ISyNode::CopyMoveMode_t 0x3, ISyProgressObserver*) const
Node /usr/sap/trans/tmp/AIXinst/swpm/COMMON/INSTALL/JDBCCONNECT.JAR does not exist.
INFO 2014-12-23 16:34:05.31 [syuxccuren.cpp:285]
CSyCurrentProcessEnvironmentImpl::setEffectiveGroup(PSyGroupInt)
lib=syslib module=syslib
Effective group id set to 204.
ERROR 2014-12-23 16:34:06.281 [CSiStepExecute.cpp:1158]
FCO-00011 The step copyScripts with step key |NW_DI|ind|ind|ind|ind|0|0|NW_Unpack2|ind|ind|ind|ind|unpack|0|copyScripts was executed with status ERROR ( Last error reported by the step: System call failed. Error 13 (The file access permissions do not allow the specified action.) in execution of system call 'openU' with parameter (/usr/sap/trans/tmp/AIXinst/swpm/COMMON/INSTALL/JDBCCONNECT.JAR, O_RDONLY), line (291) in file (syuxcfile.cpp), stack trace: EJSController.cpp: 183: EJSControllerImpl::executeScript()
JSExtension.hpp: 1072: CallFunctionBase::call()
iaxxbfile.cpp: 493: CIaOsFile::copyFromPath_impl()
syuxcfile.cpp: 255: CSyFileImpl::copy(const CSyPath & /usr/sap/HE5/SYS/exe/run/jdbcconnect.jar, ISyNode::CopyMoveMode_t 0x3, ISyProgressObserver*) const
INFO 2014-12-23 16:34:06.962 [syuxcpath.cpp:447]
CSyPath::createFile() lib=syslib module=syslib
Creating file /tmp/sapinst_instdir/BS2005/ERP60SR3/AS-ABAP/ORA/HA/DI/__instana_tmp.xml.
INFO 2014-12-23 16:34:13.663 [syuxcpath.cpp:447]
CSyPath::createFile() lib=syslib module=syslib
Creating file /tmp/sapinst_instdir/BS2005/ERP60SR3/AS-ABAP/ORA/HA/DI/instslana.xml.
Can any expert help me ? Thanks a lot.>>ERROR 2014-12-23 16:34:04.466 [syuxcfile.cpp:292]
CSyFileImpl::copy(const CSyPath & /usr/sap/HE5/SYS/exe/run/jdbcconnect.jar, ISyNode::CopyMoveMode_t 0x3, ISyProgressObserver*) const
lib=syslib module=syslib
FSL-00009 System call failed. Error 13 (The file access permissions do not allow the specified action.) in execution of system call 'openU' with parameter (/usr/sap/trans/tmp/AIXinst/swpm/COMMON/INSTALL/JDBCCONNECT.JAR, O_RDONLY), line (291) in file (syuxcfile.cpp), stack trace: EJSController.cpp: 183: EJSControllerImpl::executeScript()
JSExtension.hpp: 1072: CallFunctionBase::call()<<
Based on the log it is more likely an issue related to the file permissions. have you tried giving full permissions to the files?
Check these files:
ls -la /usr/sap/HE5/SYS/exe/run/jdbcconnect.jar
ls -la /usr/sap/trans/tmp/AIXinst/swpm/COMMON/INSTALL/JDBCCONNECT.JAR
If possible relax the file permissions (if required) and retry the step in sapinst.
Cheers
RB -
Trex installation error FSL-00001 System call failed. Error 3
I am installing trex on multiple hosts for a Production setup. Trex is version 7.0 patch level 40. All hosts are Windows servers running on "Windows Server 2003 R2 Enterprise x64 Edition, Service Pack 2" Distribution of trex instances are as follows,
Index Server =1
Slave Server =1
Backup Server =1
File Server =1
I started of with installing Trex global filesystem which resulted in following error,
ERROR 2008-10-23 15:19:27
FSL-00001 System call failed. Error 3 (The system cannot find the path specified.
) in execution of system call 'FindFirstVolumeMountPoint' with parameter (
?\Volume{51f489f8-8ef6-11dd-886f-001e0beae60e}\), line (91) in file (synxcfsmit.cpp).
ERROR 2008-10-23 15:19:27
MUT-03025 Caught ESyException in Modulecall: The system cannot find the path specified.
ERROR 2008-10-23 15:19:27
FCO-00011 The step getMounts with step key |NW_TREX_Prepare|ind|ind|ind|ind|0|0|NW_GetSidNoProfiles|ind|ind|ind|ind|1|0|NW_getMounts|ind|ind|ind|ind|0|0|getMounts was executed with status ERROR .
Installation is performed by administrator user and so has full access rights. Has anyone encountered such an error before.
Regards,
SandeepI uninstalled the Python application via the Windows "Add/Remove" programs utility and that seems to have resolved the issue.
TREX has been installed successfully. -
Quotes in parameters to a system call
Hello,
From my program, which is a servlet, I'm making a system call using -
(Runtime.getRuntime()).exec(cmd).waitFor();
where cmd is a previously defined String giving the call to execute. The problem here is seen when the parameters to cmd (which happens to be a perl script in this case) include one or more where the values are strings which include spaces, and hence are in double quotes. For example, if I want to execute -
/usr/local/bin/myScript.pl -t "Some text"
When executed from a prompt this works fine and -t has the value -
Some text
However when called from my Java program as above, the script instead thinks that -t has the value -
"Some
I'm not sure how this is coming about, but it seems to be a feature of the way Java executes the command. Has anybody seen this before? How do I stop it happening? I have tried every combination of quotes of which I can think, but nothing seems to do what I want, and the command string when printed to screen, for example, looks exactly as it should.
Thanks,
Joe PartridgeOr sat all separate parts in String[] like this:
String[] cmds={"/usr/local/bin/myScript.pl","-t","Some text"}
and call:
(Runtime.getRuntime()).exec(cmds).waitFor();
That also works and you don't have to remember to put quotes all the time
Gil -
When I make a system call of the sort
Process theProcess = Runtime.getRuntime().exec(*my command here*);
Does the thread wait for the command to be executed, or does it keep on executing subsequent lines of code?Does the thread wait for the command to be executed, or does it keep on executing subsequent lines of code? Write some simple test code and then report the results back here.
-
Problems with cached rowsets: execute() not called
I'm using sun studio creator and am trying to use a cached rowset. The code for creating it and accessing it has been created by studio creator.
The CachedRowSetXImpl is created by the session bean _init method (see below) and is accessed via the jsf web page via a value= attribute on a data table.
The problem is is that the first time the cached rowset is accessed, it generates the error 'java.sql.SQLException execute() never called. After this is works properly. I've already posted this iin the JSF forum, but didn't get a response. Any ideas?
private void _init() throws Exception {
System.err.println ( ClassName + " _init start");
arg_info_prvdrRowSet.setDataSourceName("java:comp/env/jdbc/isisdev1");
arg_info_prvdrRowSet.setCommand("SELECT * FROM ISIS_APP.ARG_INFO_PRVDR");
arg_info_prvdrRowSet.setTableName("ARG_INFO_PRVDR");
System.err.println ( ClassName + " _init end");
private CachedRowSetXImpl arg_info_prvdrRowSet = new CachedRowSetXImpl();
public CachedRowSetXImpl getArg_info_prvdrRowSet() {
System.err.println ( ClassName + " getArg_info_prvdrRowSet start*****");
try {
System.err.println ( ClassName + " Table Name = " +
arg_info_prvdrRowSet.getMetaData().getTableName(1));
arg_info_prvdrRowSet.first();
} catch (Exception Err) {
System.err.println ( ClassName + " Error is " + Err.getClass().getName() + " " + Err.getMessage() );
System.err.println ( ClassName + " getArg_info_prvdrRowSet end");
return arg_info_prvdrRowSet;
}Did you get the solution for this. if you can get please, tell me .
i m struggling like hell. everything ok. I cannot get the rows. when i deploy in Tomcat 5.5
con = DriverManager.getConnection("jdbc:mysql://localhost/seafood?user=root&password=");
categoryRowSet.setDataSourceName("java:comp/env/jdbc/sea");
//categoryRowSet.getConnection("jdbc:mysql://localhost/seafood?user=root&password=");
categoryRowSet.setUrl("jdbc:mysql://localhost:3306/seafood");
categoryRowSet.setUsername("root");
categoryRowSet.setPassword("");
//categoryRowSet.execute(con);
categoryRowSet.setCommand("SELECT * FROM category");
categoryRowSet.setTableName("category");
categoryRowSet.execute(); -
Operating system call w2k and linux
Hello:
I am not a programmer but i nedd a routine to do an operating system call and execute a batch or shell set of commands,
do anyone know how can i do it?
thanks a lot in advanceOr maybe Runtime.exec is enough for you. MUCH simpler than JNI, as long as a shell executing a script is all you want.
Read this first:
http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
%
Maybe you are looking for
-
In Mail, clicking on a date does not properly create an iCal event
If I click on a time/date in an email, a miniature calendar pops up showing the event as best as Mail can parse it. There are also two buttons: Edit and Add to iCal. If I click on Edit, I get a chance to change some of the parameters of the event, an
-
External monitor will not sleep using 2012 MacBook Air and HDMI adapter
I am running a HP 27xi (27" display) using the apple thunderbolt to HDMI adapter, and using a HDMI cable. ISSUE: I run my 2012 macbook air in "clamshell mode", and solely use the 27" display, which works great. Problem, is when the macbook goes to pu
-
Chnge d scenario from extendedclassic to classic scenario(co code specific)
Hello Gurus We are in SRM 4.0 in extended classic scenario. In the Global Roll out project, For a Company Code say India , we want to change the scenario from extended classic to classic scenario.Please let us know how this can be achived using BADI'
-
Best size and specs for Wallpaper photos?
If I want to import some of my jpegs for iPhone wallpaper, what's the optimal size (and other specs, like resolution)?
-
Are there any ill effects from removing Garage Band?
Can I uninstall Garage Band with no ill effects to my operating system? I don't want it--but if I'm going to mess something up by removing it, I'll leave it.