Results 1 to 3 of 3
  1. #1
    Raspberries is offline Member
    Join Date
    Dec 2011
    Posts
    2
    Rep Power
    0

    Default simple Swing application prevents logoff/restart

    This simple Swing application does not exit when the users logs out or shuts down Windows. The user is presented with the standard windows dialog indicating that a process is not responding and the user is prompted to "End Now?". The Java process never exits, and the user must press either "End now" or "Cancel" buttons to continue the logout or shutdown process.

    This problem occurs if the Swing application is started using "javaw.exe". If the application is started with "java.exe" then it exits normally.

    It fails on Windows XP. I don't know how it behaves on other variants of Windows, or on other OSs.

    This may be an example of bug 6660258 (Bug ID: 6660258 Java application stops Windows logout/shutdown (regression in 1.5.0_14)) in the Oracle bug data base, although that bug is marked as fixed in 5.0u23(b01) and 7(b84).

    I would appreciate any thoughts or insights.

    Java Code:
    import javax.swing.JFrame;
    import javax.swing.SwingUtilities;
    
    public class ExitBug{
        public static void main(String... args) throws Exception {
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    JFrame frame = new JFrame("title");
                    /*
                     * The frame's defaultCloseOperation appears to have no bearing
                     * on the problem.  (It fails for all settings.)
                     */
                    frame.setVisible(true);
                }
            });
        }
    }

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,453
    Rep Power
    20

    Default Re: simple Swing application prevents logoff/restart

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    Raspberries is offline Member
    Join Date
    Dec 2011
    Posts
    2
    Rep Power
    0

    Default Re: simple Swing application prevents logoff/restart

    Sorry, db. As I just posted on Code Ranch, I didn't think of this as a cross post. On Code Ranch I replied to an existing thread asking if the OP had solved the problem. I only created a new thread here. Sorry if I misunderstood the conventions.

Similar Threads

  1. Replies: 3
    Last Post: 04-28-2011, 10:43 PM
  2. How to logoff siteminder
    By Parthibakumari in forum Web Frameworks
    Replies: 3
    Last Post: 02-22-2010, 07:41 AM
  3. Catch 22: Ant prevents CVS commit
    By Cold-Gin in forum Eclipse
    Replies: 1
    Last Post: 04-09-2009, 11:49 PM
  4. Make application restart itself
    By Singing Boyo in forum New To Java
    Replies: 1
    Last Post: 03-22-2009, 03:49 AM
  5. Application restart in tomcat.....
    By jithan in forum New To Java
    Replies: 1
    Last Post: 09-10-2008, 04:31 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •