External process destroy on Windows XP

Hello friends.
I have a small program that launches external process (another java program), reads and processes process output until the process is destroyed (terminates). The program works fine on Windows 2000 - when external java program launched as separate Process terminates, an inputStream.readLine() call throws exception, and my program can continue. However on XP when external process terminates, it is not unloaded from memory, and inputStream.readLine() blocks forever...
I run under lates JVM 1.4... Any ideas why? Has anyone encountered this problem before?
try {                          
   Process p=Runtime.getRuntime().exec("java SomeProgram");
   in=new BufferedReader(new InputStreamReader(p.getInputStream()));
   while ((s=in.readLine())!=null) { // blocks on XP, works on Win2000
      // Process input
} catch(IOException ioe) {
} catch (Exception e) {
}Any help appreciated.

I have a similar problem with a small Java program running on Linux, so it may not be OS specific. The code is similar to yours, except that the file being read is produced by a third party. The third party claims to produce a new file every 5 minutes, and it takes about 30 seconds for them to produce the file.
The program is supposed to run indefinitely -- it reads the file, then sleeps for 5 minutes, then reads the file again.
Every so often, (like once every 24-36 hours), the program hangs indefinitely at the readLine() call.
What's driving me crazy is that I've used the exact same idiom in numerous other circumstances and I've never encountered this problem.
At first I thought that perhaps the file was being changed while my program was reading it. But under those circumstances I would have thought I'd get some kind of IOException, and I don't.
I'm going to explore using the ready() method of BufferedReader... but I'm not sure if that will solve the problem.
I'd also be very greatful for any input on this matter!
- Dean

Similar Messages

  • Error in using External Process in the Process Flow

    I Created a Process Flow with an external process to Move the file from one location to another location,
    I gave the below parameters for the External Process
    COMMAND: move
    PARAMETER_LIST: ?F:\\FlatFiles\\in\\company.txt?F:\\FlatFiles\\error\\company.err
    SUCCESS_THRESHOLD: 0
    SCRIPT:
    The environment is
    Windows 2003
    OWB 9.2.0.8
    OWF Builder 2.6
    When I deploy and execute using Deployment Manager, it gave me the below error
    Starting Execution TEST
    Starting Task TEST
    Starting Task TEST:EXTERNALPROCESS
    CreateProcess: move move F:\FlatFiles\in\company.txt F:\FlatFiles\error\company.err error=2
    Completing Task TEST:EXTERNALPROCESS
    Completing Task TEST
    Completing Execution TEST
    What am I missing something here?
    Is my Parameters correct?
    GIve me the link where I can find more on using External process.
    Please...please...help me..
    Shree

    Nikolai,
    I have created a simple process flow which only calls the external process. The script is on the same host as the process flow is deployed to.
    I have used two diffent values for the command parameter.
    1. I placed the full path of the file in the command parameter and left the script parameter blank:
    COMMAND: /edwftp/ppas/scripts/ClearPPAS.sh
    PARAMETER_LIST:
    SUCCESS_THRESHOLD: 0
    SCRIPT:
    2.I placed the bash command in the command parameter and the full path in the script parameter.
    COMMAND: /usr/bin/sh
    PARAMETER_LIST:
    SUCCESS_THRESHOLD: 0
    SCRIPT: /edwftp/ppas/scripts/ClearPPAS.sh
    Both of these appear to work as they print out the statements inside the script but the files that are supposed to be removed still remain.
    Starting Execution EXTER_FILE
    Starting Task EXTER_FILE
    Starting Task EXTER_FILE:EXTERNALPROCESS
    Removing ActivatedAudit.dat...
    Removing ActivatedCustomers.dat...
    Removing ActiveAudit.dat...
    Removing ActiveCustomers.dat...
    Done!
    Create the Activated Customers data file...
    Create the Active Customers data file...
    Done!
    WARNING: Log file truncated - see RAB for further information.
    /edwftp/ppas/scripts/ActivatedCustomers.sh: /edwftp/ppas/log/ActivatedCustomers.log: cannot create
    /edwftp/ppas/scripts/ActiveCustomers.sh: /edwftp/ppas/log/ActiveCustomers.log: cannot create
    WARNING: Log file truncated - see RAB for further information.
    Completing Task EXTER_FILE:EXTERNALPROCESS
    Completing Task EXTER_FILE
    Completing Execution EXTER_FILE
    The permissions on the /log direcotry are 775. The user I register the file location with owns this directory.
    Can't think of anything else I have missed. I really appreciate your help :)
    Ryan

  • How to execute External Process activity in flow

    Hi,
    I want to run a pl/sql procedure as an external process in a process flow (OWB904 on WinNT). The procedure is run from sqlplus in a .bat file. I try to follow the example in the documentation; setting the value of the Command parameter to c:\winnt\system32\cmd.exe and the Parameter List value to ?/c?c:\\temp\\test.bat .
    The flow deploys ok and executes without errors, but the procedure is not run (I can tell because it contains an INSERT and COMMIT, but the row is never inserted). I'm pretty sure the connection info is correct; the test.bat file executes ok when run in a 'dos' window. I am obviously missing something here....
    Any clues?
    Regards
    Rolf

    Hi Richard,
    The <HOME>\owb\log\owbrt.log.6 file contains the following:
    15:21:05 [93EFE] AuditId=43689: Processing execute request
    15:21:05 [5843C4] Attempting to create adapter 'class.RuntimePlatform.0.NativeExecution'
    15:21:05 [5843C4] Attempting to create native operator 'class.RuntimePlatform.0.NativeExecution.ProcessFlow'
    15:21:06 [93EFE] AuditId=43693: Processing execute request
    15:21:06 [365F84] Attempting to create adapter 'class.RuntimePlatform.0.NativeExecution'
    15:21:06 [365F84] Attempting to create native operator 'class.RuntimePlatform.0.NativeExecution.Shell'
    15:21:07 [365F84] task_end auditId=43693
    15:21:07 [93EFE] AuditId=43693: Request completed
    15:21:07 [5843C4] task_end auditId=43689
    15:21:07 [93EFE] AuditId=43689: Request completed
    Rings any bells for anyone ??
    Regards
    Rolf

  • Problem in external process using process flow

    Hi All,
    I want to execute a batch file ( which is appending 2 text files ) using OWB process flow.
    For this i am using external process in OWB process flow and giving the parameters for external process as below:
    COMMAND --- VALUE as c:\winnt\system32\cmd.exe
    PARAMETERS_LIST --- VALUE as ?c:\\fileappend.bat
    when i execute the process flow....it is showing
    Completion Status Completed successfully
    Starting Execution BATCH_PROC
    Starting Task BATCH_PROC
    Starting Task BATCH_PROC:EXTERNALPROCESS
    Microsoft Windows 2000 [Version 5.00.2195]
    (C) Copyright 1985-2000 Microsoft Corp.
    C:\owb\owb\bin\win32&gt;
    C:\owb\owb\bin\win32&gt;
    WARNING: Log file truncated - see RAB for further information.
    Completing Task BATCH_PROC:EXTERNALPROCESS
    Completing Task BATCH_PROC
    Completing Execution BATCH_PROC
    But i couldn't see the result, means the files appended.
    It is working when i execute the batch file through MS-DOS.
    Please let me know is there any other necessary steps i need to take.
    Thanks in advance
    Malli

    Hi Malli,
    Because you are using an external process you do not need to specify the cmd command to perform the execution. You can just put the call to the batch file you have in the command string and that is it. Beware that the working directory is <owb home>\owb\bin\win32.
    Mark.

  • External process execution and destruction (multi-platform)

    I want to execute a program from within java and then stop it later on also from within the same java program. Since some programs do not have a way to cleanly kill them off (say exit or stop) I'm looking for a way to kill a process.
    The process is created using:
    process = Runtime.getRuntime().exec(.....);So the Process Object can be used for some thing such as getting output and sending input to the process it can also be used in a form like:
    try {
                        // the process located at i from the list as see if it is valid
                        Process p = (Process) l.get(i);
                        int stillRunning = p.exitValue();
                        if (p.exitValue() != 0) {
    catch (IllegalThreadStateException e) {
                       System.our.print("process is still running");
    }Also you can do something like:
    Process.destroy();However this will only destroy the shell used to create the process on a UNIX system and not the process that was executed as a result that process will then be picked up by init, so process.destroy is not a good solution to killing off a process.
    an example:
    XXXXX  28393 28389  0 14:10 pts/4    00:00:00 /bin/sh /home/egandt/IdeaProjects/JumpstartKit/RunTime/Email_Server/james-2.3.1/bin/phoenix.sh run
    XXXXX   28398 28393  9 14:10 pts/4    00:00:01 /opt/jdk1.6.0_02_amd64/bin/java -Djava.ext.dirs=/home/egandt/IdeaProjects/JumpstartKit/RunTime/Email_Server/james-2.3.1/lib:/home/egandt/IdeaProjects/JumpstartKit/RunTime/Email_Server/james-2.3.1/tools/lib -Djava.security.manager ....
    egandt   28497 32547  0 14:10 pts/7    00:00:00 grep 28393In this example james is execute by running run.sh which starts the actual process, now if I kill the process for run.sh then james will be inherent by init (id 1).
    I'm kind of out of ideas how to get around this problem on UNIX I if I had the ID of the process pointed to by the object process that could be used to find the child ID which is actually running, but this does not help on windows?, Any ideas?
    Thanks,
    ERIC GANDT

    This bug is involved in the problem:
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4770092
    In current Windows, there are two commandline commands that provide the ability to identify PIDs
    and then kill processes. Open Windows Help and type "tasklist" and "taskkill" in Search.
    What you want to do is buggy due to the os problems.

  • RW-50004: Error code received when running external process.

    Hi,
    I am trying to install 11.5.10 on windows vista and receiveing following error.
    RW-50004: Error code received when running external process. Check log for details. Running Database Install Driver for VIS Instance
    When checked on the log file following is the error. Could anyone pls help me with this regard
    There was an error while running the command - c:\OracleApps\visdb\9.2.0\temp\VIS_erp\adrun9i.cmd APPS APPS
    The process tried to write to a nonexistent pipe.
    The process tried to write to a nonexistent pipe.
    The process tried to write to a nonexistent pipe.
    The process tried to write to a nonexistent pipe.
    The process tried to write to a nonexistent pipe.
    The process tried to write to a nonexistent pipe.
    The process tried to write to a nonexistent pipe.
    The process tried to write to a nonexistent pipe.
    The process tried to write to a nonexistent pipe.
    The process tried to write to a nonexistent pipe.
    RW-50010: Error: - script has returned an error: 1
    RW-50004: Error code received when running external process.
    "dbInstancecfg" file shows below error
    Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved.
    Connecting to (ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROCVIS))
    TNS-12541: TNS:no listener
    TNS-12560: TNS:protocol adapter error
    TNS-00511: No listener
    32-bit Windows Error: 2: No such file or directory
    Connecting to (ADDRESS=(PROTOCOL=TCP)(Host=erp.erp)(Port=1521))
    TNS-12541: TNS:no listener
    TNS-12560: TNS:protocol adapter error
    TNS-00511: No listener
    32-bit Windows Error: 61: Unknown error
    LSNRCTL for 32-bit Windows: Version 9.2.0.6.0 - Production on 13-JUL-2008 05:48:04
    Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved.
    Starting tnslsnr: please wait...
    TNS-12546: TNS:permission denied
    TNS-12560: TNS:protocol adapter error
    TNS-00516: Permission denied
    32-bit Windows Error: 5: Input/output error
    addlnctl.cmd exiting with status 3
    OpenSCManager failed
    adsvdlsn.cmd exiting with status 1002
    ERRORCODE = 1002 ERRORCODE_END
    .end std out.
    System error 1060 has occurred.
    The specified service does not exist as an installed service.
    .end err out.
    File c:\OracleApps\visdb\9.2.0\appsutil\install\VIS_erp\afmkinit_inst.cmd not instantiated in the current pass, this file will not be executed
    Executing script in InstantiateFile:
    c:\OracleApps\visdb\9.2.0\appsutil\install\VIS_erp\afmkinit.cmd
    script returned:
    Sun 07/13/2008
    05:48 AM
    1 file(s) copied.
    1 file(s) copied.
    1 file(s) copied.
    "afmkinit.cmd exiting with status 0"
    ERRORCODE = 0 ERRORCODE_END
    .end std out.
    .end err out.
    Skipping INSTE8_PRF
    Skipping INSTE8_APPLY
    [AutoConfig Error Report]
    The following report lists errors AutoConfig encountered during each
    phase of its execution. Errors are grouped by directory and phase.
    The report format is:
    <filename> <phase> <return code where appropriate>
    [SETUP PHASE]
    AutoConfig could not successfully execute the following scripts:
    Directory: c:\OracleApps\visdb\9.2.0\appsutil\install\VIS_erp
    adsvdlsn.cmd INSTE8_SETUP 1002
    AutoConfig is exiting with status 1

    Thanks for the update and the link was informational.
    Can I install following on windows vista? Pls confirm.
    Oracle® Applications 11i Release 10.2 Media Pack for
    Microsoft Windows (32-bit) No That's not possible, if you would like to use this machine for Applications then the OS needs to be changed or install vmware/Microsoft Virtual PC with a Certified Operating system to be able to use Applications.
    Thanks
    Ronald

  • External process

    Hi all,
    I want to execute a unix command as external process in a process flow. I enter the whole name (with path) into the field command/value.
    By executing it, I get the message:
    rm /export/home/oracle/mus: not found
    Could anybody help me?
    Thanks a lot..
    [email protected]

    Pierre,
    For the external command on Windows I also specify the full path to the executable. For me, that works.
    I guess in your case you would make a call to rm and pass /export/home/oracle/mus as a parameter.
    Mark.

  • Browser Stops how to kill external process

    Hi All,
    I am using Runtime 's exec method to run some binary on server from my JSP page .
    Runtime rt = Runtime.getRuntime();
    Process pr = rt.exec(XYZ);
    I am running the server (TOMCAT) on bsd machine ,
    Problem ,
    When the JSP is requested from the browser and user clicks on stop button / closes the browser window .
    The external process does not terminated .
    it is shown as paused process in TOP .
    Is there any way to handle this situation to stop the process .
    Regards
    Yogesh

    you have to write a class which implements HttpSessionActivationListener and in the sessionWillPasivate() method do the processing to KILL the process that is running in the background.
    you have to take care in identifying the process from the session object passed to the listener.
    Note that this method will be called when session is about to be invalidated either by time out or forcefull invalidation.
    The listener class is than supposed to be registered by putting the following in web.xml
    <listener>
         <listener-class>fully qualified name of your Listener</listener-class>
    </listener>

  • Running external process continously.. !!.. help plz

    Hello frnds,
    I have to run an external process.. continously.. ??
    am not able to figure out.. what is best for me..
    Should I run it.. it in a while loop.. with separate thread..?? as I dont know how long the process takes place?.. Then have to start process again..
    if someone has tried it already.. or know how to proceed.. please let me know!!
    Thanks in advance!!
    gervini

    What kind of process is it ?
    Do you "have" to run only while your applicationruns
    or after it has exited, too ?Its an .exe tool.. a kinda optimizer..
    Well I am displaying.. a small frame.. with two
    buttons.. START and STOP.. so I have to run it
    until.. STOP is pressed..(and have to take care..
    when STOP is pressed.. it should complete that
    running process.. and then stops..)So.. obviously.. you.. run.. only.. one.. of.. these.. processes.. at.. once.., don'..t.. you.. ?..
    Do you need to track when the process has finished (i.e. giving the user some feedback) ? If so, I'd suggest starting the process in a separate Thread, doing a waitFor() (don't forget to empty the process' outputstreams), and notifying your GUI when the Thread ends (i.e. when the child process has ended).
    Furthermore, I suppose you'll need to keep a reference to the Process Object somewhere else if you want to be able to stop it (supposedly using destroy() or some command the process understands to the Process' System.in).
    Therefore a while() loop seems to be right out, IMO. Unless you have to start the Process again as soon as it's finished, without any interaction from the user, which wouldn't quite seem to fit in the scenario you describe.

  • Process.destroy() is ignored

    Hi all,
    I have a problem using the method destroy() from class Process.
    I created a simple thread as a class which implements interface Runnable. In method run() I start an external command using ProcessBuilder.start(). The command which is started writes output to stdout in an endless loop. I consume this output using class Scanner which iterates line-by-line through the stream displaying it by System.out.println().
    If I try to stop the process with method destroy() nothing really happens. I checked Process.exitValue() which throws an IllegalThreadStateException saying that the process has not exited.
    I searched the internet and found something about this problem: A process could only be destroyed if it does not write to stdout anymore. Is that true, because my process acts like an endless loop writing to stdout...
    Thanks in advance
    public class Starter implements Runnable {
        private volatile Thread thisThread;
        private ProcessBuilder processBuilder;
        private Process process;
        private Scanner scanner;
        public void start() {
            thisThread = new Thread(this);
            thisThread.start();
        public void stop() {
            thisThread.interrupt();
            process.destroy();
            System.out.println("EXIT: " + process.exitValue());
        public void run() {
            try {
                processBuilder = new ProcessBuilder("myCommand");
                processBuilder.redirectErrorStream(true);
                process = processBuilder.start();
                scanner = new Scanner(process.getInputStream());
                while (scanner.hasNextLine()) {
                    String input = scanner.nextLine();
                    System.out.println("Line: " + input);
                scanner.close();
            } catch (IOException e) {
                e.printStackTrace();
    }

    Thanks for the reply. I made the following changes:
        public void stop() {
            process.destroy();
            try {
                Thread.sleep(2000); // needed, otherwise the exception mentioned before is thrown
            } catch (InterruptedException e) {
                e.printStackTrace();
            thisThread.interrupt();
            System.out.println("EXIT: " + process.exitValue());
        }This code throws no exception anymore. I get a value from exitValue(). But my process is still running: I tried this without using method thisThread.interrupt(). The scanner should actually stop, because there is no further input to process.
    Also a ps (I'm working on Linux) still shows my process.

  • Confirmation of external processing operation

    Dear All,
    I would like to know is it possible to prevent the confirmation of an external processing operation (pp02 control key) until the Purchase Order associated with that operation is received (GR) ?
    I checked the forum for this, but was unable to find any inputs & also in customizing where i find only settings for confirmation of orders & not at operation level.
    Hope my problem is clear, await inputs.
    Regards,
    Vivek

    Yes,
    it can be done but no through std SAP setting...but with user exit.
    Check this exit
    CONFPP03  PP order conf.: Cust. specific check after op. selection
    CONFPP04  PP order conf.: Customer specific input checks       
    CONFPP05  PP order conf.: Customer specific enhancements.

  • Product Costing:External Processing

    Hi Gurus,
    My doubt is I am comparing standard cost estimates of production client with another client which is its copy. The product cost estimate of a material, the cost component 'External Processing' is showing value 700 in PN client and 1000 in the New client. The cost element for 'External Processing is 700000000H as primary cost element and another as secondary cost element. I tried checking the GL account report in FBL3N regarding the postings happened in the GL accounts.
    1. My question is why there is a variation of 700(of PN client) and 1000(in NEW client).
    2. The second question is, from where these values are flowing.How we can trace back the flow of values for this particular cost component of External Processing' of a material cost estimate?
    Is it anyway related with Exchange Rate differences? If so, how and where it is linked?
    I'll be really grateful for your answers.
    Looking forward for you reply soon.
    Thanks,
    Prithwi.

    Hi,
    I have checked the valuation variant 001. The startegy sequence is same only. There's no change in configuration settings as the new client is copy of production client only.
    I wanted to know, the 'External processing' data or values from which.postings. How it gets picked up and how we can check its origin?
    Thanks in advance for your help.
    Prithwi.

  • How to pass BindVariables to External Process (Workflow)

    I build a shell script (unix) which accepts a command line parameter .... a "filename"
    The "filename" is a dynamic name!
    The workflow is build with a custom input parameter "filename" ... which I want to pass to an external process, which calls this shell script:
    How can I do that ?
    ExtProcess:
    Command : Val=/bin/ksh
    Parameter_List : Val=":/home/bin/myscript.sh:${Task.Input}:"
    (Binding ":Filename" replaces the whole value, sorry)
    Succes_Threshold: Val=0
    Script : Val="" , Binding=":Filename"
    ... does not pass the value of ":Filename"
    Script : Val="/tmp/fixed.name"
    ... works only with fixed names
    what I really need is something simple like:
    Parameter_list : Val=":/home/bin/myscript.sh:${Parameter.Filename}:FIXPARAM:"
    or Script : Val=":${Parameter.Filename}:${Parameter.Param2}:${Parameter.Pram3}"
    ... similar problem I had with FTP, I found no way to pass dynamic filenames or other parameters (except LOCATION Parameters)
    ... similar problem I had with EMAIL I found no way to include PARAMETERS to the mail body (except to replace the whole body by 1 parameter)
    Is there a solution or is in current version OWB 9.2 only "static" parameters supported.
    I also was missing to pass OUTPUT-parameters for example of a TRANSFORMation,
    I also was missing some urgent SYSTEM-parameters for self identification of the process(like "SYSTEM.TASK_NAME" "SYSTEM.EXECUTION_AUDIT_ID" "SYSTEM.ITEM_KEY" )
    Thanks for all hints and best regards
    Martin

    Actually... After further investigation this may not be needed. I'd be interested in the answer, to understand what is possible.
    The concept of passing parameters in the OWB workflow designer is rather limited, in my humble opinion. Sure, you can designate a "start" sequence that takes a parameter and you can pass that to mappings/transformations but there is no chance for feedback. Ie, if I manually (or through some rigged script) execute the flow with the "PARAMETER" then it will be able to bind. What about mid-flow. IE, select the record to be "processed", then call a "flow" with that as a parameter.
    Am I mistaken? Is there a way to expose the "out" parameters of a mapping, or the return of a "transformation function" as "OUTS" in the process flow.
    Of course, in a world where everything is OWB and in the DB one can leave data in tables, and pick it up on the other mappings. HOWEVER, most BI systems involve external retrievals, etc. that need a bit more "intelligence" then "run and return 1,2,3" . :)
    Hope this is helpful for product feedback. If I'm mistaken on the WF capabilities please clue me in. :)
    btw, I'm an OWB fan, certainly. The progress over the past two years has been excellent.

  • Can i use an external hard drive in windows to add additional storage after my initial partition is set up. i want to add a 500 GB hard drive to use with my windows. I set windows up in boot camp with a 50 GB partition?

    can i use an external hard drive in windows to add additional storage after my initial partition is set up. i want to add a 500 GB external hard drive to use with my windows. I set windows up in boot camp with a 50 GB partition? I now want to add another 500 GB?

    Yes. Windows supports external USB drives.

  • How to access external drives while in Windows

    Using VMWare Fusion as the system hosting Windows XP. Have specific programs in Windows only but of course they work much better on the IMac. I edit a ton of video and have the vids all stored on eternal drives. These drives are read by the Mac and all show up on the desktop and are accessible for all Mac programs.
    Here's the issue. I need to access those external drives from a Windows video editing program being run thru Fusion. The Windows program is accessing a folder via "Shared folder on host" but the only folders showing up there are the ones listed under "Home" om "My Places". I'm sure this is nothing more than a setting but I am in need of help! All my editing is held up at the moment so any assistance is greatly appreciated for this Apple rookie. Thanks.

    I don't have my laptop with fusion loaded, so I can't think of the exact terms. However, you should be able to set the shared folders in the settings for the virtual machine. The ones you see are the default setup, but you can define more paths to view while in Fusion.

Maybe you are looking for

  • How do I set up multiple users on my ipad2

    How do I setup multiple users/passwords/privileges

  • How do I upload only the songs I want?

    I have a new ipod Nano 6th gen. and also a new ipod Shuffle. Neither is large enough to automatically sync all the music I have in iTunes on my Macbook, and if I unchecked enough songs in iTunes to allow automatic syncing, I'd be re-checking all day,

  • Use of Update Price button  in PO

    Hi Gurus, In PO item detal , bottom portion there is a button "Update" by which we can update price. In which case , we can update price can you please explain. I had a doubt here... The Po was created with old contract validity period now at present

  • Change Document Object - SCDO

    I have created a new Change Document Object for a Z table(say ZXXX). When Generating Update program for this change document, a new structure is generated VZXXX that has ZXXX as include. This structure does not have a Package assigned to it and there

  • Oracle -- SSO (single signon)

    I am planning to use Oracle's SSO to setup multiple apps that pass login info from one app to the other when building an ERP with OrderEntry, AP, GL, Warehousing, Food Production Scheduling, etc. Can I post my 5MB app and pay you to show me how to ad