Execute and kill batch

Hi,
I want to execute batch file from my java program.
I need to have timeout for the execution of the batch.
I am using the following command to execute the batch:
Runtime.getRuntime().exec("cmd /c start test.bat");
How can I kill the batch file after some timeout ?

While you can try killing the program from Java using Process.destroy at the appropriate time, I doubt that it will work for most Windows environments since the .bat program will likely be decoupled from Java by the Windows os.
A possibility is to use the time command in the bat file and execute the exit command after the desired amount of time has elapsed.

Similar Messages

  • Program exit - IF_SWF_IFS_WORKITEM_EXIT - Executed by WF-batch.

    Hi all,
    I have implemented a Program exit in my User decision step. This user exit is for finding the actual agent rule. But whats happening now is that the events are getting triggered in the below fashion.
    1. swfco_event_before_creation(BEF_CREAT)
    2. swfco_event_after_creation
    The above two are getting executed by the user who created the workflow.
    But after that the event 'swfco_event_state_changed' is getting automatically execute by the WF-batch user and later the WF-batch user has trigerring the event -AFT_EXEC and allowing the Work item to be in the complete state.
    I tried simulating the same in test system and i was not able to find it and the Workflow is waiting in the event-swfco_event_after_creation and it is still in the wait status till in reached the deadline and didnt get executed by WF-batch.
    Kindly guide.
    Thanks,
    Neslin.

    WF-BATCH is starting at the event-C_EVTTYP_STATE_CHANGED(STATE_CHG) automatically. I can see it in the information message near to WF-BATCH.
    Correct agent             Dialog work item created                 26.06.2009 11:54:57
    Correct agent             Work Item Exit Called                    26.06.2009 11:54:57
    Correct agent             Work Item Exit Called                    26.06.2009 11:54:57
    Correct agent             Work Item Exit Called                    26.06.2009 11:54:57
    Correct agent             Work Item Exit Called                    26.06.2009 11:54:57
    Correct agent             Work Item Exit Called                    26.06.2009 11:54:57
    Correct agent             Work Item Exit Called                    26.06.2009 11:54:57
    WF-BATCH                  Work Item Exit Called                    26.06.2009 11:57:15
    WF-BATCH                  Work Item Exit Called                    26.06.2009 11:57:15
    WF-BATCH                  Work Item Exit Called                    26.06.2009 11:57:15
    WF-BATCH                  Work Item Exit Called                    26.06.2009 11:57:15
    WF-BATCH                  Work Item Reserved                       26.06.2009 11:57:15
    WF-BATCH                  Work Item Exit Called                    26.06.2009 11:57:15
    WF-BATCH                  Work Item Exit Called                    26.06.2009 11:57:15
    WF-BATCH                  Work Item Exit Called                    26.06.2009 11:57:15
    WF-BATCH                  Work Item Exit Called                    26.06.2009 11:57:15
    WF-BATCH                  Work Item Processing Complete            26.06.2009 11:57:15
    WF-BATCH                  Result Processing                        26.06.2009 11:57:15
    This is how it is coming in the log.
    Thanks,
    neslin.

  • FAGL_FC_VAL executed but the batch is not processed in SM35

    Hi,
    FAGL_FC_VAL executed but the batch is not processed in SM35 and I deleted this batch (Session).
    My understanding is when we execute FAGL_FC_VAL only system valuate but posting happens only when we run the session in SM35. Am I correct ?
    Or have I done mistake deleting this session in SM35?
    Second time when I am executing FAGL_FC_VAL , no listing is generating. Please suggest what could be the reason for this?
    Thank You

    Hi,
    This is how Batch Input Session Name field in foreign currency valuation works.  If you happen to enter a batch input name, a batch session will be created and you would have to use transaction code SM35 to process it yourself.  It will not process automatically.  However, if you leave the the batch input session name field blank, and you check create postings, postings will be made immediately when you execute the transaction.
    With regards to no listing generating the second time, make sure you check the Create Postings as suggested by the previous contributor.
    Regards,
    Elias

  • How to Kill Batch Deployment

    Hi,
    I Started batch of mappings for deployment, It has thrown some errors then I started individual mapping deployment.
    But after deploying few maps, I am unable to deploy some of the mappings.
    The error is RTC-5161: Deployment cannot proceed because an error during pre deployment or generation phase.
    I thought the earlier started deployment is in progress that’s why it is showing this kind of errors. But I don’t see any deploying job status in Control Center.
    Could someone please Help me on this how to resolve this issue or How to see the deployment status in Audit tables and kill them.
    Thanks in Advance

    Hi,
    It is also possible to look at the activity in the database.
    There are some scripts you can use
    In $ORACLE_HOME/owb/rtp/sql are some scripts:
    - list_requests.sql
    - deactivate_execution.sql
    - deactivate_all.sql
    You can use them with sqlplus
    example:
    sqlplus <repositoryowner>@<SID> @list_requests
    We use these all the time with OWB 10.2.0.3 and OWB 11.1
    You can also look at the activity of Oracle Workflow
    Example:
    -- OWB Check hanging processes
    SELECT *
    FROM owf_mgr.wf_item_activity_statuses_v
    WHERE activity_type_code = 'PROCESS'
    AND activity_status_code != 'COMPLETE';
    Emile

  • Find network share process and kill it

    Hi All,
    Is it possible that we could find open network share access process and kill it?
    For example, user is opened a folder via network share (e.g: \\myserver\c$\myfolder). Is it possible that we could somehow query process to identify this open network share process and kill it before attemp to delete C:\myfolder? Please advise.
    Best Regards,
    Andy Pham
    Best Regards, Andy Pham

    You could try checking for open file handles, as described here:
    http://stackoverflow.com/questions/317071/how-do-i-find-out-which-process-is-locking-a-file-using-net. They have both a solution using an external executable utility (SysInternals) and one using PInvoke. You could also use this other utility which is specifically
    targeted at hosts of network shares:
    http://technet.microsoft.com/en-us/sysinternals/bb897552.aspx.
    Wasabi Fan

  • Detecting (And Killing) Abandoned Threads

    Hi All,
    I'm going to try to make my question as simple as possible: I'm trying to use the service guardian to automatically detect an abandoned thread and kill the originating process. So basically I set up a test that ends up with an abandoned thread and configured service Guardian... but it didn't work :D
    What I first did is setting the guardian's timeout to be very short (6 seconds). When I do that, what I get is:
    2010-03-26 10:03:29.389/0.859 Oracle Coherence GE 3.5.3/465 <Info> (thread=main, member=n/a): Loaded cache configuration from "file:/C:/workspaces/POC/InvocableTest/bin/coherence-cache-config.xml"
    2010-03-26 10:03:29.952/1.422 Oracle Coherence GE 3.5.3/465 <D5> (thread=Cluster, member=n/a): Service Cluster joined the cluster with senior service member n/a
    2010-03-26 10:03:35.295/6.765 Oracle Coherence GE 3.5.3/465 <Error> (thread=Cluster, member=n/a): Attempting recovery (due to soft timeout) of Guard{Daemon=TcpRingListener}
    2010-03-26 10:03:35.904/7.374 Oracle Coherence GE 3.5.3/465 <Error> (thread=Cluster, member=n/a): Terminating guarded execution (due to hard timeout) of Guard{Daemon=TcpRingListener}
    Coherence <Error>: Halting JVM due to unrecoverable service failure
    2010-03-26 10:03:36.904/8.374 Oracle Coherence GE 3.5.3/465 <Error> (thread=Termination Thread, member=n/a): Full Thread Dump
    ThreadCluster
         java.lang.Object.wait(Native Method)
         com.tangosol.coherence.component.util.Daemon.onWait(Daemon.CDB:18)
         com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onWait(Grid.CDB:6)
         com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:39)
         java.lang.Thread.run(Unknown Source)
    So that's before the thread gets abandoned... it seems that it detects a deadlock when starting coherence. But that's ok, I know the service guardian is working. The problem comes when I set the timeout to something more realistic: 35 seconds for instance. I run my test, the thread gets to an abandoned state and the service guardian does not see it :(
    Any Ideas?
    h4. My override config is:
    <coherence>
    <cluster-config>
         <service-guardian>
              <timeout-milliseconds system-property="tangosol.coherence.guard.timeout">6000</timeout-milliseconds>
              <service-failure-policy>exit-process</service-failure-policy>
         </service-guardian>
    </cluster-config>
    <logging-config>
    <severity-level system-property="tangosol.coherence.log.level">5</severity-level>
    <character-limit system-property="tangosol.coherence.log.limit">0</character-limit>
    </logging-config>
    </coherence>
    Thanks!
    Fernando
    Edited by: ZeoS on Mar 26, 2010 7:13 AM

    it's an Invovable running on the server.
    The description in the debugger is: InvocationServiceWorker
    Maybe this helps:
    10-03-26 12:03:41.279/72.663 Oracle Coherence GE 3.5.3/465 <Error> (thread=Abandon, member=1): A worker thread "InvocationServiceWorker:0 executing task "Message "InvocationRequest"
    FromMember=Member(Id=1, Timestamp=2010-03-26 12:02:29.866, Address=10.31.106.86:8088, MachineId=32598, Location=site:someSite.com,machine:ZeoSWorkStation,process:1084, Role=TestInvocableExpiration)
    FromMessageId=0
    Internal=false
    MessagePartCount=0
    PendingCount=0
    MessageType=1
    ToPollId=0
    Poll=null
    Packets
    Service=InvocationService{Name=InvocationService, State=(SERVICE_STARTED), Id=3, Version=3.1, OldestMemberId=1}
    ToMemberSet=MemberSet(Size=1, BitSetCount=2, ids=[1])
    NotifySent=false
    InvocationRequest{Query, Task=TestInvocableExpiration.SocketInvocable@16b352c}
    }", did not respond to 8 interrupt requests. The execution was canceled. The thread is abandoned...
    Fernando

  • When closing my Firefox window, all processes are not closing requiring me to open task manager and kill the process before using Firefox again. Received recent upgrade and hasn't worked right since then.

    I open Firefox, use it, then close the window. Try to reopen Firefox and it fails with a message that a previous process is still running. Requires me to open Task Manager and kill the old process.

    Try to wait a bit longer before reopening Firefox to give Firefox more time to close completely.<br />
    Try to use "Firefox/File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit") to close Firefox if you are currently doing that by clicking the close X on the title bar.
    See "Hang at exit":
    *http://kb.mozillazine.org/Firefox_hangs
    *https://support.mozilla.com/kb/Firefox+hangs

  • Issue on How to mimic Deski document from CMS to local machine, pass parameter, execute and save in a mutiple report format then store in a network drive.

    Post Author: usaitconsultant
    CA Forum: JAVA
    Would you know if there's a way to mimic Deski
    document from BOXI server(CMS) to local machine, pass parameter, execute and
    save in a mutiple report format then store in a local drive or network
    drive? Most examples and tutorials in BO XI R2 I've seen are scheduling while drilling report is for web intelligence only and not desktop intelligence.  Please let me know your ideas. I would really appreciate your help. Thanks.

    Post Author: usaitconsultant
    CA Forum: JAVA
    Hi Ted,
    Thanks for the reply.The file is not available in the server. Though, I checked CMS and I found an instance in history tab and the status is failed with error below. 
                Error Message:
                A variable prevented the data provider Query 1 with BANRRD30 from being refreshed. (DMA0008).When I checked my codes, I found out that the object Im using is for web intelligence data provider. However, I cannot find any documentation and example for passing parameter values in desktop intelligence data provider. Any idea on this? You think this is not suported by Report Engine SDK?Thanks.    

  • Automatic and manual batch determination at the time of Goods receipt

    hi,
    where i can have the settings for automatic and manual batch determination at the time of Goods receipt and goods issue..
    E.g.: If i am receiving material from vendor then my requirement is system will generate batch automatically...
    Where  we can get this setting?
    Tx
    Uts

    Dear,
    You assign the batch number either
    Manually
    Automatically, using internal batch number assignment, refer to Customizing for Batch Management under Internal batch number assignment.
    Internal batch number assignment is activated for the complete client, unless you exempt individual plants or materials using a customer exit (see Configure customer exits for intern. batch number assignment in Customizing for Batch Management).
    The R/3 System informs you that the internal batch number assignment is active. You are however only informed once per transaction, for example, when you enter the first item on the multiple-entry screen.
    Please refer: http://help.sap.com/saphelp_45b/helpdata/en/25/283cb44f7811d18a150000e816ae6e/frameset.htm
    Regards,
    Syed Hussain.

  • How to add NI VI's in a executable and installer

    I have a working program made in Labview, but I have problems withy creating an executable and installer.
    The first thing I did was create a project, I have the Main program and under the Dependencies I have the Vi's and the VI.lib from labview 8.6 directory.
    I made an executable and after that an Installer. But when I run the installer version it's missing some Vi's.
    These Vi's arer mainly the VI's that come from the vi.lib from the LAbview 8.6 directory. Some how these Vi's aren't taken into the executable and installer.
    What am I doing wrong????
    Kind regards,
    Barry Bomer

    Hi Bomer,
    normally all vi's you need are automatically in the executable. Do you use some dynamic called vi's, maybe the report generation toolkit?
    Mike
    Message Edited by MikeS81 on 01-15-2009 09:27 AM

  • Mdnsresponder will not quit.  Consumes above 100% CPU and kills my battery.  Also causes my fan to run constantly and my computer to get extremely hot.  Force quitting doesn't work.  It just comes back.

    The mdnsresponder will not quit.  Consumes above 100% CPU and kills my battery.  Also causes my fan to run constantly and my computer to get extremely hot.  Force quitting doesn't work.  It just comes back.   I posted about this earlier and never got an answer.  Somebody, please help. 
    Thanks.

    mDNSResponder is a background process that runs all the time. If you kill it, it's relaunched automatically.
    Please launch the Console application and select "system.log" from the file list. Enter "mDNSResponder" (without the quotes) in the search field. Post a sample of the log messages in the Console window -- only one example of each repeated message, please.

  • Vendor Material No. and Vendor Batch field in MIGO for GR against Order

    HI,
      I received a very specific requirment for one of our client: Client need the field Vendor Material No. and Vendor Batch in the detail data --> material and batch tab in MIGO transcation for A01 (Goods receipt ) against R08 (Order), this is for good receipt against Process Order, Here though the vendor does not come in picture , these field are required. These field are appearing in GR(A01 against Purchase order(R01)
    Regards
    Rahul

    Hi,
    First of all, why do you want Vendor Batch no & material no while doing receipt against process order.  You can enter the same while doing a GR against Purchase order & same can be tracked using some reports.
    As you said, since you are doing a receipt against the Process order, vendor doesn't come in picture. Hence the vendor batch no: or vendor material no: wont be populated as per Std.SAP.  You can check for some enhancements/BAdi's in MIGO transaction to populate the same.
    Thanks & Regards,

  • How to mimic Deski document from BOXI server to local machine, pass parameter, execute and save in a mutiple report format then store in a network drive.

    Post Author: usaitconsultant
    CA Forum: JAVA
    To Guru's, Would you know if there's a way to mimic Deski document from BOXI server to local machine, pass parameter, execute and save in a mutiple report format then store in a local drive or network drive? Most examples and tutorials in BO XI R2 I've seen are scheduling while drilling report is for web intelligence only.  Please let me know your ideas. I would really appreciate your help. Thanks. 

    Give Chronosync a go - have been using for over a year and it works great; if you like Syncback you'll like this app.

  • On Word I was copying a sentence, but the command has not been executed and the timer is constantly circling. It has been circling for over 10 minues. How do I get out of this?

    On Word I was copying a sentence, but the command has not executed and the timing cursor has been circling for over 10 minutes. How do I get out of this?

    You probably will need to force-quit Word. Go to the Apple menu, choose "Force Quit", locate and select Word in the list of applications and click the "Force Quit" button. You will of course most likely lose any changes you made to the document since you last saved it (or it was auto-saved, if you have that option turned on in Word).
    Regards.

  • Sales of same material with and without batch

    Hello Experts,
    One of my requirement is
    To sell single material from same plant
    1)with batches and
    2)Without batches
    Will this be possible in R/3 and how?
    Please suggest.
    NVS

    Hi Nikhil
    It Depends on where did you activate the Batch management. If its activated at Plant level, then yes, its possible to maintain the batch for a single material in one plant and no batch in another plant.
    But if you activated batch management at material level. then its not possible to have batch assignment in one plant and not in another.
    If you have batch activated at material level. what you can do is create a dummy batch in the other plant and the actual batch in the original plant.
    Hope this helps..
    Thanks
    Srini

Maybe you are looking for

  • How to post the revenue on exchange rate in SAP ?

    Hi All, a Company gets a g.l. bank account in USD (account currency). The local currency is EUR. 2010.01.01: its balance was 9.527,23 USD (account currency). Given a currency exchange rate 1 USD x 1,4406 EUR, the amount of the account in local curren

  • Trouble Cleaning Up At The End of an Automator Action

    So my automator action currently downloads a file (a .dmg), mounts it, copies its contents to Applications, and then... I then want to unmount the dmg and throw the dmg away. However, by this point I no longer have the references to these two items:

  • Converting contract to sales order does not auto create schedule lines

    Hi When I convert quotation to sales order, then schedule lines get auto created. But when I convert contract to sales order, then schedule lines don't be auto created. Instead, a confirmation screen for proposal delivery date pops up for every line

  • Information on Usage & Loading of Cubes

    Hi all, I am looking out for a <b>FUNCTION MODULE</b> or a <b>TABLE</b> in BW that can give me information like : 1. When was the last time data was loaded to my cube ? 2. When was the Cube last used or queried upon? I have the list of all cubes in m

  • Getting A12ES error installing photoshop . Help?

    I am getting A12ES error running installation. Can someone help?