Running Java process in Back ground

We have a script that starts a Java process in Background. But still if I try to exit from the 'Console', it's not allowing me to do so, and if I forcibly kill the console, it's killing my Java process. My question is, how can I make my java process to run completely in background? Secondly, will the JVM have any references to the console through which it is being called. Please help me.

Hi Sastry66,
If your application is going to use stdout/stderr, then there may be a problem. Try to redirect stdout/stderr using shell redirections when starting your java program. You may also want to try using exec java <class-file> to start the process.
Regards,
SUN/DTS

Similar Messages

  • How to run the program in back ground with out selection screen ?

    Hi,
    I want to run the program in back ground but don't have selection screen. How to run this program in back ground
    as program has no selection screen.
    Waiting for quick response.
    Best Regards,
    Padhy
    Moderator message: basic, please search for available information/documentation.
    Edited by: Thomas Zloch on Feb 21, 2011 12:43 PM

    Hi,
    Go to transaction SE38 --> Execute --> Background.
    If your program contains selection screen, you have to pass your input values as variants.

  • I need to run the program in back ground and then update two fields

    hi gurus
    i need to run the program in back ground and then update two fields in the z table by mm02 transaction by using bapis , can any one give me the code for this.
    Message was edited by:
            Rocky

    hi
    good
    go through this link
    http://www.sapdb.org/7.4/htmhelp/34/ee7fba293911d3a97d00a0c9449261/content.htm
    thanks
    mrutyun^

  • Examining other running Java processes

    I've written a process which I want to keep running in the background. I'd like to write an application that I can run which will determine if my first process is already started, and if not to start it. I'd like to be able to use API methods to examine the state of my machine to determine what processes are available (similar to the way a debugger can find a list of running processes) rather than coordinating this through a file on disk. What classes should I examine to be able to do this?

    Look at the JMX classes; you can run JConsole to see that it finds running Java processes and lets you connect to them.

  • Can we run F.28 in back ground for all customers.

    Hi ,
    Can we run F.28 for all customers in Back ground.
    Thanks in advance.

    Yes
    you can schedule this in the background
    this will be like any other batch job you schedule
    you will have to give the customer range that you want to execute or upload a list of customers befo9re you click on execute in background
    hope this helps
    Thanks
    Prashant

  • Run time error in Back ground processing using LSMW

    Hi all,
        We are runnig LSMW to create Positions using tcode PP03. We are able to create positions in the foreground but we are getting error "RAISE_EXCEPTION" in the Backgrond for the same LSMW.
        Kindly suggest me suitable solution if any.
    Thanks in advance,
    Vasanth.

    Hi all,
    Thanks for your reply.
    I  got the solution. When a program is scheduled in background, if it is written in classes and ALV grid display is used, we get this error. I am able to schedule when I change the function module to LIST_DISPLAY.

  • Running java process in a while loop using Runtime.exec() hangs on solaris

    I'm writting a multithreaded application in which I'll be starting multiple instances of "AppStartThread" class (given below). If I start only one instance of "AppStartThread", it is working fine. But if I start more than one instance of "AppStartThread", one of the threads hangs after some time (occasionaly). But other threads are working fine.
    I have the following questions:
    1. Is there any problem with starting a Thread inside another thread?. Here I'm executing the process in a while loop.
    2. Other thing i noticed is the Thread is hanging after completing the process ("java ExecuteProcess"). But the P.waitFor() is not coming out.
    3. Is it bcoz of the same problem as given in Bug ID : 4098442 ?.
    4. Also java 1.2.2 documentation says:
    "Because some native platforms only provide limited buffer size for standard input and output streams, failure to promptly write the input stream or read the output stream of the subprocess may cause the subprocess to block, and even deadlock. "
    I'm running this on sun Solaris/java 1.2.2 standard edition. If any of you have experienced the same problem please help me out.
    Will the same problem can happen on java 1.2.2 enterprise edition.?
    class AppStartThread implements Runnable
    public void run()
    while(true)
    try
    Process P=Runtime.getRuntime().exec("java ExecuteProcess");
    P.waitFor();
    System.out.println("after executing application.");
    P.destroy();
    P = null;
    System.gc();
    catch(java.io.IOException io)
    System.out.println("Could not execute application - IOException " + io);
    catch(java.lang.InterruptedException ip)
    System.out.println("Could not execute application - InterruptedException" + ip);
    catch (Exception e)
    System.out.println("Could not execute application -" + e.getMessage());

    I'm writting a multithreaded application in which I'll
    be starting multiple instances of "AppStartThread"
    class (given below). If I start only one instance of
    "AppStartThread", it is working fine. But if I start
    more than one instance of "AppStartThread", one of the
    threads hangs after some time (occasionaly). But other
    threads are working fine.
    I have the following questions:
    1. Is there any problem with starting a Thread inside
    another thread?. Here I'm executing the process in a
    while loop.Of course this is OK, as your code is always being run by one thread or another. And no, it doesn't depend on which thread is starting threads.
    2. Other thing i noticed is the Thread is hanging
    after completing the process ("java ExecuteProcess").
    But the P.waitFor() is not coming out.This is a vital clue. Is the process started by the Runtime.exec() actually completing or does the ps command still show that it is running?
    3. Is it bcoz of the same problem as given in Bug ID :
    4098442 ?.
    4. Also java 1.2.2 documentation says:
    "Because some native platforms only provide limited
    ed buffer size for standard input and output streams,
    failure to promptly write the input stream or read the
    output stream of the subprocess may cause the
    subprocess to block, and even deadlock. "These two are really the same thing (4098442 is not really a bug due to the reasons explained in the doc). If the program that you are exec'ing produces very much output, it is possible that the buffers to stdout and stderr are filling preventing your program from continuing. On Windows platforms, this buffer size is quite small (hundreds of characters) while (if I recall) on Solaris it is somewhat larger. However, I have seent his behavior causing problem on Solaris 8 in my own systems.
    I once hit this problem when I was 'sure' that I was emitting no output due to an exception being thrown that I wasn't even aware of - the stack trace was more than enough to fill the output buffer and cause the deadlock.
    You have several options. One, you could replace the System.out and System.err with PrintStream's backed up by (ie. on top of) BufferedOutputStream's that have large buffers (multi-K) that in turn are backed up by the original out and err PrintStream's. You would use System.setErr() and System.setOut() very early (static initializer block) in the startup of your class. The problem is that you are still at the mercy of code that may call flush() on these streams. I suppose you could implement your own FilterOutputStream to eat any flush requests...
    Another solution if you just don't care about the output is to replace System.out and System.err with PrintStreams that write to /dev/nul. This is really easy and efficient.
    The other tried and true approach is to start two threads in the main process each time you start a process. These will simply consume anything that is emitted through the stdout and stderr pipes. These would die when the streams close (i.e. when the process exits). Not pretty, but it works. I'd be worried about the overhead of two additional threads per external process except that processes have such huge overhead (considering you are starting a JVM) that it just won't matter. And it's not like the CPU is going to get hit much.
    If you do this frequently in your program you might consider using a worker thread pool (see Doug Lea's Executor class) to avoid creating a lot of fairly short-lived threads. But this is probably over-optimizing.
    Chuck

  • How to run program without set back ground Job in production Server?

    Hi,
    I have developed 1smart forms which is takes so much time for execution and sometimes its time out.
    I have used BSEG, BKPF, BSET, KONV, VBRK, VBAP, LIPS, LIKP these tables in smartform.
    So give me proper solution for this issue?
    Thanks
    Yatin Mahetaliya.

    Hi,
    You could call from your program the function module called SXPG_COMMAND_EXECUTE where you will call a command already defined in SM59 transaction code. You will maybe control the return code with sy-subrc. Then it will possible for you to extract data...
    Don't forget that every time you call GUI_UPLOAD or any method or function from the frontend function group or ABAP object by classes like cl_gui_frontend_services, it will be impossible to run in background.
    Try it..
    pherasath

  • How to run a report in back ground

    how to run a report in background with out using job open, submit , close is there any other function module to run report in background.

    Hi,
               There are two ways for you to handle,
    one manually setting up the job through SM36 which is better and convinient,
    secondly through program using FM's JOB_OPEN, SUBMIT, JOB_CLOSE.
    Find below steps in doing both:
    Procedure 1:
    1. Goto Trans -> SM36
    2. Define a job with the program and variant if any
    3. Click on start condition in application tool bar
    4. In the pop-up window, click on Date/Time
    5. Below you can see a check box "Periodic Job"
    6. Next click on Period Values
    7. Select "Other Period"
    8. Now give '15' for Minutes
    9. Save the job
    Procedure 2 via Program:
    Below is a sample code for the same. Note the ZTEMP2 is the program i am scheduling with 15mins frequency.
    DATA: P_JOBCNT LIKE TBTCJOB-JOBCOUNT,
    L_RELEASE(1) TYPE c.
    CALL FUNCTION 'JOB_OPEN'
    EXPORTING
    JOBNAME = 'ZTEMP2'
    IMPORTING
    JOBCOUNT = P_JOBCNT
    EXCEPTIONS
    CANT_CREATE_JOB = 1
    INVALID_JOB_DATA = 2
    JOBNAME_MISSING = 3
    OTHERS = 4.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    SUBMIT ZTEMP2 VIA JOB 'ZTEMP2' NUMBER P_JOBCNT
    TO SAP-SPOOL WITHOUT SPOOL DYNPRO
    WITH DESTINATION = 'HPMISPRT'
    WITH IMMEDIATELY = SPACE
    WITH KEEP_IN_SPOOL = 'X' AND RETURN.
    CALL FUNCTION 'JOB_CLOSE'
    EXPORTING
    JOBCOUNT = P_JOBCNT
    JOBNAME = 'ZTEMP2'
    STRTIMMED = 'X'
    PRDMINS = 15
    IMPORTING
    JOB_WAS_RELEASED = L_RELEASE
    EXCEPTIONS
    CANT_START_IMMEDIATE = 1
    INVALID_STARTDATE = 2
    JOBNAME_MISSING = 3
    JOB_CLOSE_FAILED = 4
    JOB_NOSTEPS = 5
    JOB_NOTEX = 6
    LOCK_FAILED = 7
    INVALID_TARGET = 8
    OTHERS = 9.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Hope the above helps you.
    <b>Reward points</b>
    REGARDS

  • How to run transaction MM12 in back ground?

    Hi Masters ,
    Can you help me out of this? the senario is :
    If the validity stanrt date and end date of  a contract is in future date then do not update the material master with PDT value from the contract but call the transaction MM12 (schedule changing of material) in the background on saving the contract.
    The following values would be passed from contract to MM12 transaction:
    Material No (EKPO u2013 MATNR) to Material Number
    Validity Start (EKKO u2013 KDATB) to field Change scheduled for.
    Planned Delivery Time (EKPO u2013 PLIFZ) to Planned delivery time in MRP2 view.
    Plant (EKPO u2013 WERKS, if present) to Plant.
    Please any one help me of this....
    Regards
    Anshuman
    Edited by: Anshuman_Danda on Nov 7, 2011 9:55 AM
    Moderator message : Spec dumping is not allowed, search for available information.  Thread locked.
    Edited by: Vinod Kumar on Nov 7, 2011 4:59 PM

    Hi,
    Search for the corresponding BAPI and use it for ur requirement.
    Thanks & Regards,
    Kiran

  • Report Back ground processing, error

    Hi,
    I tried to run my program in back ground. It is showing the following error. I'm just Pressing F9 and scheduling the job immediately. When i go and see the "own jobs " in SM36, it shows the "job cancelled". When i see the job log, it shows "Control Framework: Fatal error - GUI cannot be reached" and "ABAP/4 processor: RAISE_EXCEPTION". When i debug the job using JDBG transaction it runs smoothly and generates spool.
    Can you provide some solutioons?

    HI,
    Is your report having some OOPS functionalities?
    Are you making use of any container or ALV GRID object.
    In that case it will not run in background and will give you this error.
    Search in SCN. This has been discussed a lto of times.
    There are several posts on how to avoid this.
    Regards,
    Ankur Parab

  • Running in back ground

    Hi Friends,
    Can we run any reoprt in back ground which has GUI_DOWNLOAD function in it?If not, what is the alternative?
    Thanks in Advance

    Jak,
    You can run a report in background because the file will be in presentation server, if you want to run gui_download
    in background, you can only extract the file using
    open data set FILE FILE NAME for output.
    Then you download it from your application server i.e AL11
    Regards,
    KrishnaKumar

  • Back ground Job Creation  and maintanance ?

    Gurus
    I have a report, which will take more than the normal 10 min time.
    ISo i have to run it in the back ground session.
    Please let me know how to create a back grund job and maintain and process it?
    Also please tell me the Tcodes associated with this process.
    Thanks a lot.. Points will be awarded....of course...
    Meenakshi.N

    On the report screen, press F9 (or program -> execute in background). Give the printer name and to send to spooler or print immediately option in the initial screen. Press OK.
    Then, give the start time (options will appear) and click on "Save" button.
    Now, to see the status of the job, go to SM37.and execute by your username. Here you can see the job status, spool etc.
    Let me know if you have any questions.

  • All Java Processes crash on RH Linux 7.3 / 6.3 without any comment

    We have the following Problem on two Machines. We installed j2sdk1.4.0 first, then jdk-1.3.1_04 (Because of other Problems with 1.4.0).
    Now all running java Processes crash after up to two hours without any comment, any error file. Looks like they were killed by the 'kill' Command. The running java Processes are different Programs, that do very different things.
    The OS on the two machines are RH Linux 7.3 and 6.3 - normal installation without any essential changes.
    I would be very happy, if someone have an idea, how to solve this Problem. If you need additional Information, ask for.
    Holger

    ... if someone have an idea, how to solve this Problem.Seems like I remember seeing a problem like that.
    It turned out that indeed it was the 'kill' command. Another process was running, looking for the app, and killing it when it found it.
    We spend quite a bit of time trying to figure out why our app was 'crashing' before deciding to look elsewhere (when we discovered the other process.)

  • Alv report in back ground

    Hi All,
    Can we run alv report in back ground,if yes how?
    Thanks&Regards.
    Srikanth.V

    hi Ramu,
    Run in Background but make sure it is alv list, not alv Grid FM. if you are uisng alv list not problem , but if you are using alv grid then you can code like this..
    if sy-batch = ' '.
    call 'REUSE_ALV_GRID_DISPLAY'.
    else.
    call 'REUSE_ALV_LIST_DISPLAY'.
    endif.
    if you are using OO alv then write this code..
    CALL METHOD cl_gui_alv_grid=>offline
                    RECEIVING e_offline = off.
        IF off IS INITIAL.
          CREATE OBJECT g_custom_container
                 EXPORTING container_name = g_container.
        ENDIF.

Maybe you are looking for

  • Safari 5.1 doesn't open PDFs in-line

    Hi. My Safari doesn't open PDF files in-line. It is just downloading them and after that opens them in Preview. No Adobe Reader has ever been installed. Need your help. Thanks

  • Script output getting suppressed when trying to send email

    Hi, I am having an existing report,part of code is given below. *data processing.....       itcpo-tdcovtitle =  z_text.                    itcpo-tdgetotf   = 'X'.                        call function 'OPEN_FORM'                         exporting     

  • MBP Update issue

    Recently tried installing linux on MBP wiped partitions and now software update wont install it hangs at configuring installation any ideas on a fix for this so I can get it to work ? Update was for 10.5.5 Cheers Craig

  • Set Character Width of Select List

    Hi All, I have a select list on my apex page. It is a dynamic select list generated from a sql query. Does anyone know how to set the max character length of the list item, as some of my entries are enourmous and the select list takes up the width of

  • Garageband crashing while exporting at the 3 hour mark.

    I am exporting a podcast that is a "best of" for our episode 150. It is three hours 20 minutes long. When I try to export the MP3 GB crashes righ after the three hour mark. Any ideas? Thanks!