When does JVM terminates?

Hello all,
Under Class File, (java.io.File), There is a method "void deleteOnExit()"
Which Requests that the file or directory denoted by given abstract pathname be deleted when the virtual machine terminates.
My question is:
When does virtual Machine terminates. ??
I know i am asking very basic and silly question, But, i am confused.
Can any one please explain me? or give me the link where i can get answer. ??
REgards,
Ashvini

The simple answer is: when the application the Virtual Machine is running is finished.
For a JSP server, that may be when the server shuts down. In other cases, certain web applications are run in their own JVM, so when that web application is turned off or restarted, then the JVM would end. But that, I guess, is server dependent (if available at all). In either case, barring a crash, it would mean when the administrator brings down the application or application server intentionally (like for routine maintenance).

Similar Messages

  • When does the JVM exit and deleteOnExit();?

    I developed a JSP that queries a database, displays the results in a browser, and writes the results to the server as a file. While the user is viewing the JSP, they can click on a download link to save the file that was written to the server. Everything works fine!
    I would like to delete the file that was written to the server (to save space), however, I can't delete the file until the user is finished viewing the JSP. I need some help concerning this method: java.io.File.deleteOnExit() the API states:
    "Requests that the file or directory denoted by this abstract pathname be deleted when the virtual machine terminates. Deletion will be attempted only for normal termination of the virtual machine, as defined by the Java Language Specification (12.9)."
    If I use this method, When does the JVM exit? I tested it in my home environment using Tomcat and the file was deleted when I stopped Tomcat. If I run this on a web server, does the JVM ever exit? If so when?
    Thanks
    --Scott

    The JVM stays active so long as the Java based webserver (or the servlet engine if your webserver is connected to one) is up. Only when you shutdown your server will the VM terminate. (Similar to what you observed with tomcat)

  • When does the JVM exit ?

    I am curious as to what could be the reasons when the JVM exits.Googling didn't give me much relevant links (my bad,may be !!).
    However the JLS states :
    A program terminates all its activity and exits when one of two things happens:
    1. All the threads that are not daemon threads terminate.
    2. Some thread invokes the exit method of class Runtime or class System and the exit operation is not forbidden by the security manager.
    Now,Are there any other reasons apart from the above that may result in a JVM to exit ? I would appreciate any pointers.
    Thank you for your consideration.
    Edited by: punter on Jan 4, 2010 4:14 AM

    Well, you already found the "normal" ways of exiting the JVM.
    punter wrote:
    Now,Are there any other reasons apart from the above that may result in a JVM to exit ? I would appreciate any pointers.It can also halt unexpectedly: crashing. By the very nature of crashes it's hard to define how exactly they happen. But they can happen.
    I assume that you could also call exit() (the C function) from native code, the JVM probably couldn't do much about that.

  • Eclipse hangs and the JVM terminates in a Swing app incorporating JavaFX

    Hi everyone,
    I have a situation that is driving me nuts. I am developing a Swing based application which is incorporating some JavaFX components,mainly the TableView and a few layouts. I have wrapped all the javafx components into a common control for use application wide. I am also using an Eclipse plugin (Window Builder Pro) to layout the swing stuff.
    Now, my issue is, when I preview the JFrames and other components making use of the said simple custom control referred above, it only allows me to preview the JFrame once, there after Eclipse hangs and the JVM terminates.
    After some research, the most likely cause of this is that the reference to jfxrt.jar i have referenced in the project is loading some native dlls which can/should only be loaded once in the lifetime of a JVM. It looks like for some reason, my app is trying to load the native libs after it has already loaded them initially.
    The Application needs to be developed in Eclipse so netbeans is not an option.
    Am just getting started with maven, i don't have the know to build a project of this complexity with maven.
    Has any one encountered this issue and how did they walk around it?
    Any assistance would be greatly appreciated.

    After further digging around, the actual exception that causes the jvm to terminate is java.lang.UnsatisfiedLinkError due to an attempt to reload \JavaFX_2.0_SDK\rt\bin\mat.dll, anyone knows how to overcome this ?

  • FF 6.0 does not terminates itself, "plugin-container.exe" keeps running which does not allow termination of process

    After up-graduation to FF 6.0, FF fails to terminate when closed via X button or through Exit options in Menu. It was found that ''plugin-container.exe'' does not terminate causing failure to terminate ''firefox.exe''. ''plugin-container.exe'' runs as a sub-process to ''firefox.exe''

    After up-graduation to FF 6.0, FF fails to terminate when closed via X button or through Exit options in Menu. It was found that ''plugin-container.exe'' does not terminate causing failure to terminate ''firefox.exe''. ''plugin-container.exe'' runs as a sub-process to ''firefox.exe''

  • Enqueue replication server does not terminate after failover

    Hi,
    We are trying to setup high availability of enqueue server where in we have running enqueue server on node-A and ERS on node-B all the time.
    Whenever enqueue is stopped on node-A, it automatically failovers on node-B but after replication of lock table, enqueue does not terminate the ERS running on node-B and as a result our enqueue and ERS both keeps running on the same host (Failover node-B) which should not be the case.
    We havenu2019t configured polling in that scenario SAP note-1018968 depicts the same however this is applicable only for version-640 and 700.
    Ideally when enqueue server switches to node-B, it should terminate the ERS on the same node after replication and then HA software would take care of its restart on node -A.
    We have ERS running of version 701; could anyone please let me know if the same behaviour is common for 701 version as well?
    Or there is any additional configuration to be done to make it working.
    Thanks in advance.
    Cheers !!!
    Ashish

    Hi Naveed,
    Stopping ERS is suppose to be taken care by SAP only and not the HA software.
    Once ERS stops on node -B there would be a fault reported and as a result HA software will restart the ERS on node A.
    Please refer to a section of SAP Note 1018968 - 'Enqueue replication server does not terminate after failover'
    "Therefore, the cluster software must only organise the restart of the replication server and does not need to do anything for the shutdown."
    Another blog about the same:
    http://www.symantec.com/connect/blogs/veritas-cluster-server-sap  
    - After the successful lock table takeover, the Enqueue Replication Server will fault on this node (initiated by SAP). Veritas Cluster Server recognizes this failure and initiates a failover to a remaining node to create SAP Enqueue redundancy again. The Enqueue Replication Server will receive the complete Enqueue table from the Enqueue Server (SCS) and later Enqueue lock updates in a synchronous fashion.
    So it is nothing about HA software, it is the SAP which should control ERS on node-B.
    Cheers !!!
    Ashish

  • Raise form trigger failure does not terminate processing

    There is a field in my form, on which there is a when-validate-item trigger, which cheks that the value in the field should be selected from list of values(LOV). If not done that way, error message is displayed.
    This works fine, when I enter a value myself and navigate to the next field, it throws an error. This is fine.
    But, problem occurs when I enter a value in the field and without navigating to the next field, I press Save(commit).
    When this is done - Key commit is invoked, which inturn invokes when-validate-item and erros is displayed. But when
    I press the Ok button, the error is displayed again and again. I have to close down the form to get out of it.
    In case of error, I have displayed the error and raised form_trigger_failure.
    I do not understand why form_trigger_failure terminates processing when I navigate to next field and does not terminate processing when I directly press Save(Commit)?
    Regards,
    Balaji

    find the code in When validate item trigger below. I don't much of code in key commit. It does not do anything with the field in question.
    DECLARE
    l_lov_indicator VARCHAR2(20);
    BEGIN
         IF :abc.code IS NOT NULL THEN
              -- If global is not initialized, that means that the value in
              -- code is not fetched from List Of Values and an error
              -- (FRM-40815) is raised. This error is handled in on-error
              -- trigger in Aon block.
              l_lov_indicator := :GLOBAL.lov_indicator;
              -- If global is initialized, the value in code
              -- is fetched from List Of Values and everything is ok.
              -- Otherwise, an error message is displayed.
              IF l_lov_indicator = 'TRUE' THEN
                   ERASE('GLOBAL.lov_indicator');
              ELSE
                   ERASE('GLOBAL.lov_indicator');
              raise form_trigger_failure;
              END IF;
         END IF;
    END;

  • When does the Java main(String args[]) method exit?

    Hi all,
    I and my colleagues want to know, when does the main() method exit?
    we wrote a small code as follows:
    import java.awt.*;
    public class Test {
    public static void main(String[] args) {
    Frame f = new Frame("hi");
    f.show();
    System.out.println("after show");
    and ran the program, in which case I could see the printed message "after show", but although there is no code after the System.out.println(), the Java virtual machine does not exit and waits for the Frame to close.
    My question is has the main method exited in this case? since it clearly shows that it does not have any more code to execute. Does java create the main method as a thread or as a process?
    regards,
    Harshad

    To make your application terminate you need to add code to cause the AWT thread to handle the termination. In your code, before f.show(), try:
    f.addWindowListener(new WindowAdapter() {
      public void windowClosing(WindowEvent e) {
        dispose();
      public void windowClosed(WindowEvent e) {
        System.exit(0);
    });Now, at least you can click on the little "X" on the upper right-hand corner of the Frame (at least in Win95/98/NT) environments) to cause your application to receive a window closing event. It is also possible to add a menu with an option to exit; in that case I'd use an EventQueue to cause a window closing event to be sent.

  • Problems when doing heap dumps

    Hirt,
    Thanks for your help. With the changes you suggested it is now working with jmx authentication as well.
    However i had another question. I can not make JFlow work. I did install the plugin and everytime i right click on my remote JVM tab and click on Heap Dump, it does open system popup for me to select where to save the dump. But as soon as i select and click OK, it throws this error
    Problems when doing Heap Dump for JOverflow analysis
    Problems when doing Heap Dump for JOverflow analysis

    Hi there!
    There can be multiple different reasons for this that I can think of, incorrect permissions granted to the user, the effective user of the Java process running Mission Control not having write permissions in the folder you are trying to save to etc.
    What does it say if you run with the debug flags?
    http://hirt.se/blog/?p=281
    Kind regards,
    Marcus

  • My iphone 5 keeps crashing all the time and has a delay of about 3 seconds when doing anything on it i did a factory restore on it but it didnt fix the problem

    my iphone 5 keeps crashing all the time and has a delay of about 3 seconds when doing anything on it i did a factory restore on it but it didnt fix the problem i went to optus to see if they could help me as my phone is through them but they knew nothing i need help please my phone is only 8 months old

    Plug the device into a wall outlet and leave it for about 20 minutes. If it has not powered on at that point try a reset by pressing and holding the home and power buttons for about 15 seconds until the white Apple logo appears.

  • I am currently using Lightroom 5.6 and operating on a Mac with OSX Ver 10.9.5. I am receiving an error problem when doing the following -  I am exporting selected photos from a particular Catalogue saved on Drive 1 to a folder created on another Drive whe

    Hi, I am having a little trouble with exporting images to another drive and Catalogue and need some help if anyone can give me some advice
    I am currently using Lightroom 5.6 and operating on a Mac with OSX Ver 10.9.5.
    I am receiving an error problem when doing the following -
    I am exporting selected photos from a particular Catalogue saved on Drive 1 to a folder created on another Drive where a Lightroom Catalogue has been created. In this Catalogue I have arranged for the images once exported to be moved to a different folder - I used the Auto Import process under the File dialogue box.
    When processing the Export I receive an error message for each of the images being exported indicating the following -
    Heading Import Results
    Some import operations were not performed
    Could not move a file to requested location. (1)
    then a description of the image with file name
    Box Save As                                  Box  OK
    If I click the OK button to each image I can then go to the other Catalogue and all images are then transferred to the file as required.
    To click the OK button each time is time consuming, possibly I have missed an action or maybe you can advise an alternative method to save the time in actioning this process.
    Thanks if you can can help out.

    Thank You, but this is a gong show. Why is something that is so important to us all so very, very difficult to do?

  • Error in pricing when doing sourcing in EBP 4.0

    Hello,
    We're experiencing random errors when doing sourcing in EBP 4.0. The shopping carts don't seem to have any similarities that could launch the error. There has been few cases when the same error has occured when user is creating a shopping cart.
    The problem occures when doing sourcing and the shopping cart is either being held or a PO is created. The error creates dump in ST22, "UNCAUGHT_EXCEPTION". This is somehow related to pricing and we have checked note 673372 and ran report BBP_CND_CUSTOMIZING_CHECK, all OK. IPC is running the same SP level as SRM, SP level 10.
    We have already created an OSS about this, but as this is completely random we haven't been able to reproduce the error and no solution has been found.
    Here's some data from ST22:
    Transaction......... "BBPSOCO01 "             
    Program............. "SAPLBBP_PDH"            
    Screen.............. "SAPLBBP_SOCO_UI_ITS 2000"
    The termination occurred in the ABAP program "SAPLBBP_PDH" in "BBP_PD_ABORT"
    The main program was "SAPLBBP_SOCO_UI_ITS ".                                                                               
    The termination occurred in line 69 of the source code of the (Include)   
    program "LBBP_PDHU08"                                                    
    of the source code of program "LBBP_PDHU08" (when calling the editor 690).
    000600   * get the messages from the application log    
    000610     TRY.                                         
    000620         CALL FUNCTION 'BBP_PD_LOG_GET_MESSAGES'  
    000630           TABLES                                 
    000640             E_MESSAGES = LT_MESSAGES.            
    000650       CATCH CX_BBP_PD_ABORT.                     
    000660         REFRESH LT_MESSAGES.                     
    000670     ENDTRY.                                      
    000680                                                  
    >     RAISE EXCEPTION TYPE CX_BBP_PD_ABORT EXPORTING
    Thanks already in advance!
    -Jussi

    Hi
    Please refer to following SAP Notes:
    Note 860935 - pricing customizing exits are missing
    Note 673372 - Short dumps UNCAUGHT_EXCEPTION in SRM 3.0, 4.0, and 5.0
    Also try to implement the latest IPC patches following the instructions from note 880749, then restart the VMC. It worked for us, after trying many things with no luck.
    Alternatively, try this as well. There must be some problem with VMC. Most probably java connection problem. Please execute program RSVMCRT_HEALTH_CHECK in SE38 transaction. You should see green for all 4 messages in the result. Please contact your basis consultant and refer notes 854170 (and 844817)
    <u>Other related OSS notes.</u>
    Note 1024374 - Unexpected pricing error for pricing irrelevant item
    Note 992259 - NullPointerException in Command GetFilteredCsticsAndValues
    Note 860935 - pricing customizing exits are missing
    Note 673372 - Short dumps UNCAUGHT_EXCEPTION in SRM 3.0, 4.0, and 5.0
    Note 854170 - Activating the component "VM Container"
    Note 593109 - Short dumps UNCAUGHT_EXCEPTION in SRM 2.0 (EBP 3.5)
    Note 880749 - Patching of VMC based AP 7.00 engines
    Note 854170 - Activating the component "VM Container"
    Note 844816 - Information for Upgrade from IPC 4.0 to SAP AP 7.00
    Hope this will help.
    Please award points if helpful.
    Regards,
    -Atul

  • No Data when doing multiple selection of sub-brand in the cube

    Hey everyone.
    I am having a very strange situation.
    No Data when doing multiple selection cube.
    The thing is that the situation is created only in the transition between the servers, who have a different Build but both of them are SQL 2008R2 servers.
    The Build of one of them is 10.50.2789.0 and the other one is 10.50.4000.0 (SP2).
    The other properties of the cube are the same, it's Not possible to retrieve data from the cube on the server with the "SP2 when we  the slicing is at the level of sub-brand and removed even one item  mean we passed a multiple selection ,
    This is possible only if we connect the cube as Admin .
    While the server with the older "Build" the problem to perform the above operation when connected as a user not exist.
    What can cause this problem,and how can we fix it?
    thank's a lot.

    Hi Doron2Bull,
    According to your description, there are two servers in your scenario, and you cannot retrieve data from one of the cube, right? Are there any differences between the two cubes on different? You can import the database on the server into BIDS and explore
    Data on the fact table on the Data Source View to check if there are any data. If we can see the data when we do Explore Data on the fact table on the Data Source View (DSV), but when we browse the cube here is no data. Then there are many possibilities for
    this issue.
    On the cube's Dimension Usage, the relationship between this measure group and the dimension is not correctly defined.
    On the relational database, the dimensional key column on the fact table does not correspond to the key column on dimension table.
    There is a Default Member on another dimension, and there is no fact table row that satisfy this condition.
    If I have anything misunderstood, please point it out.
    Regards,
    Charlie Liao
    TechNet Community Support

  • Firefox 5 apparrently changed a Windows setting, now I have artifacts remaining on top of my desktop when doing things like selecting a file and doing an open with selection.

    Ever since I my system updated to Firefox 5 I now have issues such as:
    Want to open a file such as a doc in Wordpad instead of Word (for speed and simplicity), I right click on the file and select open with Wordpad...the Wordpad and it's icon now stay on the desktop, on top of anything else. This happens when doing any open as selections. This did not happen before Firefox 5......there must be an overriding code confliction. Am using XP Home Premium.

    Hi Steve1904,
    So you have use the backup and Restore to restore your files from Windows XP to Windows 7 directly?
    This should be considered not work.
    If you would like to transfer files between Windows XP and Windows 7, you need another tool called Windows Easy Transfer.
    See the article below if you would like to upgrade from Windows XP to Windows 7:
    Upgrading from Windows XP to Windows 7
    If possible, follow the steps there, then things should be OK.
    Best regards
    Michael Shao
    TechNet Community Support

  • ITunes crashes when doing a power search. I get a Microsoft Visual C   Runtime Library Error message: Program C:\Program Files (x86)\iTunes\iTunes.exe R6025.  Pure virtual functional call.  If I select ok, Windows 7 pops up with iTunes has stopped working

    iTunes crashes when doing a power search. I get a Microsoft Visual C   Runtime Library Error message: Program C:\Program Files (x86)\iTunes\iTunes.exe R6025.  Pure virtual functional call.  If I select ok, Windows 7 pops up with iTunes has stopped working and then it shuts iTunes down.  Anyone else every have this issue.  Any ideas on a fix?
    Thanks,

    For general advice see Troubleshooting issues with iTunes for Windows updates.
    The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down page in case one of them applies.
    Your library should be unaffected by these steps but there is backup and recovery advice elsewhere in the user tip.
    tt2

Maybe you are looking for