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>

Similar Messages

  • How to kill a process chain in an intermediate step...?

    How to kill a process chain in an intermediate step...?
    I have tried doing it using SM37... but still the chain is hanging....
    Please help ASAP...
    Regards
    Sneha

    Hi Sneha,
    If its a loading process then:
    1. Go to monitor & make its overall status RED.
    2. Go to the target & make the QM status RED.
    3. Since its loading data to BW, its R/3 will be active even if you make any status RED in BW.
    4. Cancel its corresponding R/3 job. U'll get its R/3 job from monitor>Header tab>Job name. Copy that job name& go to R/3 side>sm37>in Job name add B*followed by the job name copied & then delete the Active job.
    Once this is done then your loading process will anyhow stop further stopping the Process chian.
    If your job is other than loading, then simply go to that process chain & remove the link between the active process nad the next process after cancelling the active job (as mentioned in the various replies for your question).
    Give some time to update the staus of that cancelled job in Db, because even if you cancel any active job, it requires some time to refresh it updated status. Once it is cancelled you can rejoin the link between the proceses and reactivate & schedule your process chain.
    hope it'll help

  • How to kill the process chain

    hi,
        I have question how to kill the process chain during running.
    thank you.

    Hi
    If the process chain is running in background,
    goto <b>SM37</b>
    Give * in the jobname
    Give the username who scheduled the process chain
    Job status - check the check boxes - SCHED, relased, ready, active
    click <b>execute</b>.
    It displays all the process chains that, scheduled & running.
    You can select the process chain that need to be stopped & click STOP active job or ctrl+F1.
    Hope this helps!
    Kindly award points for all useful answers.
    If you post the BW related queries in the <b>BI general</b> forum, you will get more answers.
    Best regards,
    Thangesh

  • How to kill TP process at OS Level

    Dear ALL,
    How to kill the TP process at OS level
    Operating System : win 2003

    Q.1 Different Method for Kernel Upgradation
    So far till now, I have known only one method for Kernel upgradation which is very very simple. I dont think we need any other work-around for Kernel upgrade as this method is very very straight forward. The steps to be followed are ---
    Go to the SAP OSS Site :- 
    http://service.sap.com/SWCenter-Main
    From here Download the kernel programs in a temporary folder or use Download Basket toi download the Kernel.
    Now shutdown the R/3 database and all services including saposcol. 
    Create a folder and copy the original executables from  /exe/run/ directory then uncar the downloaded files and replace the original executables in /exe/run/ directory. 
    Then restart your system. 
    A couple of important points to remember are :-.
    a) Always make a copy of the files you're going to replace. For e.g. Create a directory (oldkern) and copy all the old files before replacing them (this helps when sometimes the new Kernel has problems, and you can revert it)
    b) You have to shutdown SAP and the Database using the OLD kernel file. Again it is good practice to shutdown everything first.
    Regards,
    Mandar

  • How to kill these processes?

    I want to see if port 11162 is in use or not so I issued the below command
    netstat -a | grep 11162
    and this is what I got back
    hostname.11162 hostname.50916 49152 0 49152 0 CLOSE_WAIT
    *.11162 *.* 0 0 49152 0 LISTEN
    hostname.11162 hostname.50291 49152 0 49152 0 CLOSE_WAIT
    hostname.11162 hostname.51288 49152 0 49152 0 CLOSE_WAIT
    I have 2 questions
    1) What is the meaning of CLOSE_WAIT?
    2) How do I kill all processes that use this port 11162 currently? I tried these commands kill 50916, kill 50291, kill 51288 but it said No such process. Basically I want to kill all processes that use this port 11162 currently.
    Thanks

    Andrew2008 wrote:
    I have 2 questions
    1) What is the meaning of CLOSE_WAIT?From 'netstat':
    CLOSE_WAIT
    Remote shutdown; waiting for the socket to close.
    This means that the remote side sent us a shutdown packet. The OS told the application that it received the shutdown, and it's waiting for the application to close the socket. It will remain in that state until the socket is closed or until the process exits.
    2) How do I kill all processes that use this port 11162 currently? I tried these commands kill 50916, kill 50291, kill 51288 but it said No such process. Basically I want to kill all processes that use this port 11162 currently.Those numbers are the port numbers on the other end of the connection. They are not PIDs.
    You would need to either install 'lsof' and ask it which processes are using the port (lsof -i :11162), or you need to run 'pfiles' on all the system processes and see which ones report having port 11162 open. I'm sure there's some simple scripts that automate the second task.
    Darren

  • 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

  • How to call external processes before & after WL services start/stop

    I set up WL Admin Server and Managed Server to run as Windows services.
    I have the code to retire/re-activate in an ANT script and right now, I execute it via the command line.
    Here's my question
    I want to retire a SOA composite BEFORE my Managed Server Windows service stops and re-activate it AFTER the Window service starts up.
    Do you know how to do that? Or if you have other suggestions, please let me know
    Thanks
    I'm using 11.1.1.2

    I want to retire a SOA composite BEFORE my Managed Server Windows service stops and re-activate it AFTER the Window service starts up.
    This means you need to check for the ManagedServer is in RUNNING state right?
    in WLST you can get State of a given Managed Server with getState() method. write a WLST invoke method in ANT and try.

  • How to kill VPN processes in background

    I've tried logging in as root, and
    kill -9
    these process ID's found in Terminal with
    ps -ax
    screenshot here - http://screencast.com/t/FvKyLJIiS
    But they just won't die.
    Anyone have any ideas?
    Thanks in advance,
    Darren.

    Thanks Carolyn ;-)
    I should have clarified - I'd already tried Activity Monitor - Quit & Force Quit.
    Nothing happens - which is how I ended up trying to use Terminal as Root - and that didn't work either.
    I really don't like this at all - it smacks of Spyware.  I'm pretty sure they're not, as I've installed them myself.
    But I don't like any program that stops me from selecting whether or not I want to run it on Login.....

  • How to kill AMCMenu process which uses my whole ram for mac os 10.8.5 macbook pro?

    whenever i kill AMCMenu through activity monitor it starts again and uses my ram. i have restarted my computer many times .please help .
    here the link to AMCMenu process sample : http://forums.macrumors.com/attachment.php?attachmentid=438583&d=1380955778

    This is a temporary solution --
    Step 1: From Activity Monitor, determine the process id (column PID) for AMCMenu - e.g. 100.
    Step 2: Open a terminal window and type the following runes:
    sudo kill -stop <value of PID from Step 1>
    e.g. sudo kill -stop 100
    It will ask for your password - type it fearlessly.
    you are done......
    To release it into the wild again:
    Either:
    sudo kill -cont <value of PID from Step 1>
    e.g. sudo kill -cont 100
    Or:
    it will be started automatically when you restart your Mac.
    thanx

  • How to kill the process running on specific port in Solaris 10

    Hi
    As I want to kill the proces running on port 8080 in my solaris 10 box. is there any command to do the same.
    Thanks
    Rajan

    A quick google, found lots of scripts... I found the script below @ Christopher Hubbell's blog - I've modified it to pump out the command name.
    ---->>>>>>BUT let's just say it would be quicker to got to sunfreeware.com and download lsof.
    the 'lsof -i " option will give you the process id, which you can use kill _pid_ to kill the id.
    Christopher's modded script (my edits in bold):
    #!/bin/sh
    if [ `/usr/xpg4/bin/id -u` -ne 0 ]; then
    echo "ERROR: This script must run as root to access pfiles command."
    exit 1
    fi
    if [ $# -eq 1 ]; then
    port=$1
    else
    printf "which port?> "
    read port
    echo "Searching for processes using port $port...";
    echo
    fi
    for pid in `ps -ef -o pid | tail +2`
    do
    foundport=`/usr/proc/bin/pfiles $pid 2>&1 | grep "sockname:" | egrep "port: $port$"`
    if [ "$foundport" != "" ];
    then
    pname=`ps -ef -o pid -o comm |grep $pid| awk '{print $2}'`
    echo "process name: $pname, $foundport"
    fi
    done
    exit 0
    Tom de

  • How to kill EXCEL process after upload?

    Hi 2 all!
    I use ALSM_EXCEL_TO_INTERNAL_TABLE to get the data from excel file and it works fine. But in the task manager the number of EXCEL processes increases with every execution of my program. How can I avoid this?

    Hi 2 all!
    I use ALSM_EXCEL_TO_INTERNAL_TABLE to get the data from excel file and it works fine. But in the task manager the number of EXCEL processes increases with every execution of my program. How can I avoid this?

  • How to allocate external process cost on the units of Production order

    Hi Gurus,
    I am facing a cost allocation issue.
    The scenario is a make-to-stock scenario in discrete manufacturing industry. I am using production order (PP01) and confirming the material issued to production and operations manually. There is an electrical cost incurred by the client. The total cost of electricity is allocated on the number of units that comes out from the production. Say, total electrical cost is 1000, number of units produced using the production order is 100, then per unit is charged 10 (1000/100).
    Can anyone help me how can I perform the cost allocation? Should I go for an activity type in work center OR should I use the cost sheet. Kindly help me.
    Thanks and Regards,

    Hi
    activity type would be better choice...
    Ajay M

  • Help: how to kill a bpm process

    I create a bpm process with an infinite loop and my server crash everytime.
    How to kill this process.

    Hi Capro
    Log into NWA
    Navigate to manage processes
    NWA-> Operation management -> Processes and Tasks -> Manage Processes
    Select the nasty process instance and click on Actions> Cancel
    By doing so you will be canceling the process instance and this will help in saving your server from crashing
    If you are using 7.20 there are options to handle this too from BPM System Overview
    Regards,
    Harsha

  • How to kill process in windows

    Hi,
    how to kill the process in windows.
    Thanks in advance

    >
    I already tried that one rmishra......
    but it was not killed.>
    I think you are trying to find something like "ps - ef" in Unix for windows? if yes then you can follow below:
    show processes
    C:\>tasklist
    Image Name                   PID Session Name     Session#    Mem Usage
    ========================= ====== ================ ======== ============
    System Idle Process            0 Console                 0         28 K
    System                         4 Console                 0        260 K
    smss.exe                     892 Console                 0        460 K
    csrss.exe                    952 Console                 0    396,948 K
    winlogon.exe                 976 Console                 0      5,944 K
    services.exe                1020 Console                 0     69,300 K
    lsass.exe                   1032 Console                 0      4,260 K
    svchost.exe                 1204 Console                 0     14,384 K
    svchost.exe                 1312 Console                 0     14,056 K
    svchost.exe                 1436 Console                 0     59,188 K
    snac.exe                    1488 Console                 0      1,600 K
    svchost.exe                 1656 Console                 0      6,668 K
    svchost.exe                 1744 Console                 0     10,656 K
    spoolsv.exe                 1864 Console                 0     12,560 K
    svchost.exe                  332 Console                 0      8,884 K
    jqs.exe                      576 Console                 0      1,424 K
    notepad.exe              4772 Console                 0      5,640 K
    .........................................ect
    C:\>taskkill /pid 4772
    SUCCESS: The process with PID 4772 has been terminated.-RMishra

  • How to kill aprocess

    Hi,
    could anybody tell me how to kill a process which is runnuing on unix OS.
    actually I have an RMI server, and I want to write an applet or some thing simillar to stop this server.
    So I need to know it is pid on the server to kill it.
    Any body has an idea??

    It's not that there's no response, cos I can switch apps and other apps respnd. It's just that a specific app hangs (or loads data or whatever) which takes too long for me to wait for and I'd like to kill it.
    So the question is - if the phone is generally responsive but one app in the background needs to be killed, can I somehow do this not rebooting the whole device?
    edit: just to add: the back button while hold get's me to the app list and I can switch apps and work with others.

Maybe you are looking for

  • MMS over WiFi

    I understand to send MMS (pictures/group messages) you need a data plan and have to be connected to the mobile network.  However, whenever I am at home or work, and I happened to be connected to the local WiFi network, I am unable to send group messa

  • Missing search operator

    Hi all, I need to implement a search form that allow me to match exactly a string attribute (e.g. if I search for the string TIME I don't want to get the item with the attribute equals to SOMETIME). The problem is that the wwsbr_search_api.submit_sea

  • Accidentally cancelled a paid app now it won't reinstall :( HELP

    I had JUST bought LED app for $1.00 and i accidently got out of it whilst it was downloading..... now when i go to the uninstall list the app it there but it doesn't show the button of "reinstall" I've tried: taking the battery out, wiping the data o

  • IPod touch volume problem

    my ipod does not have any problems that cannot be solved by turning it off and on again. However, the volume goes wired when i listen to music. Im just sitting there and listening to it and all of a sudden the volume turns up and when i try to turn i

  • How restore accidentally deleted contacts from iCloud

    I've accidentally deleted contacts from iCloud.com. and all contacts were deleted from my devices. How I can restore it