Results 1 to 4 of 4

Thread: Freeze issue

  1. #1
    TomatoTom is offline Member
    Join Date
    May 2011
    Posts
    2
    Rep Power
    0

    Default Freeze issue

    Hi everybody,

    first of all: apologies for my bad english.

    I have a very weird freezing issue in a Java application. I'm not a 100% sure if this belongs into the Threads and Synchronization forum because it could also be an AWT problem but this somehow fits better.

    The problem: Multi-threaded AWT/Swing application. The app freezes "randomly", i.e. I have not found any pattern yet. But when it freezes it is always the same. AWT-EventQueue is requesting the focus, AWT-Windows and one or more AppThreads are waiting to lock the gui and one AppThread has a lock on the Gui and is running in the native method WFramePeer.getState forever. I know that it is not right to modify the GUI from the AppThreads but this does not explain this behaviour.

    Has anyone an idea?
    Thank you very much.
    Tom


    Stacktraces (I've replaced the memory addresses so that it is easier to read)

    Java Code:
    "AWT-EventQueue-0"
    java.lang.Thread.State: RUNNABLE
    at sun.awt.windows.WComponentPeer._requestFocus(Native Method)
    at sun.awt.windows.WComponentPeer.requestFocus(WComponentPeer.java:617)
    at java.awt.Component.requestFocusHelper(Component.java:7416)
    at java.awt.Component.requestFocusInWindow(Component.java:7307)
    at ava.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:355)
    [.....]
    Java Code:
    "AWT-Windows" waiting for monitor entry [ ADDR:A ]
    java.lang.Thread.State: BLOCKED (on object monitor)
    at java.awt.Frame.getExtendedState(Frame.java:743)
    - waiting to lock <ADDR:B> ( MyGUIClass )
    at java.awt.Frame.paramString(Frame.java:915)
    at javax.swing.JFrame.paramString(JFrame.java:839)
    at java.awt.Component.toString(Component.java:7849)
    at java.lang.String.valueOf(String.java:2826)
    at java.awt.KeyboardFocusManager.shouldNativelyFocusHeavyweight(KeyboardFocusManager.java:2306)
    at sun.awt.windows.WToolkit.eventLoop(Native Method)
    at sun.awt.windows.WToolkit.run(WToolkit.java:293)
    at java.lang.Thread.run(Thread.java:662)
    Java Code:
    "AppThread-0" waiting for monitor entry [ ADDR:C ]
    java.lang.Thread.State: BLOCKED (on object monitor)
    at java.awt.Frame.getExtendedState(Frame.java:743)
    - waiting to lock <ADDR:B> ( MyGUIClass )
    at javax.swing.RepaintManager.addDirtyRegion0(RepaintManager.java:418)
    at javax.swing.RepaintManager.addDirtyRegion(RepaintManager.java:464)
    at javax.swing.JComponent.repaint(JComponent.java:4734)
    at java.awt.Component.repaint(Component.java:3081)
    at javax.swing.JLabel.setText(JLabel.java:326)
    Java Code:
    "AppThread-4" prio=6
    java.lang.Thread.State: RUNNABLE
    at sun.awt.windows.WFramePeer.getState(Native Method)
    at java.awt.Frame.getExtendedState(Frame.java:745)
    - locked <ADDR:B> ( MyGUIClass )
    at javax.swing.RepaintManager.addDirtyRegion0(RepaintManager.java:418)
    at javax.swing.RepaintManager.addDirtyRegion(RepaintManager.java:464)
    at javax.swing.JComponent.repaint(JComponent.java:4734)
    at java.awt.Component.repaint(Component.java:3081)
    at javax.swing.JTabbedPane.setTitleAt(JTabbedPane.java:1311)

  2. #2
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    I don't know what your code looks like, perhaps these links will be helpful to you

    javax.swing (Java Platform SE 6) -- The bottom talks about threading policies of swing.

    Threading in Swing

  3. #3
    TomatoTom is offline Member
    Join Date
    May 2011
    Posts
    2
    Rep Power
    0

    Default

    Thank you. But I think I know how Threading in Swing is working. The problem is that I just don't understand that particular problem. Why is the application not continuing, ie. why is the thread running in a native method forever?

    I don't know what your code looks like, perhaps these links will be helpful to you

    javax.swing (Java Platform SE 6) -- The bottom talks about threading policies of swing.

    Threading in Swing

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,202
    Rep Power
    19

Similar Threads

  1. Freeze cursor
    By Gog in forum New To Java
    Replies: 7
    Last Post: 01-14-2011, 10:29 PM
  2. Serial Comm freeze
    By java_dude in forum Networking
    Replies: 3
    Last Post: 01-13-2011, 10:09 PM
  3. intermittent freeze in JavaWebstart Swing App
    By ambs in forum AWT / Swing
    Replies: 0
    Last Post: 07-27-2010, 04:39 PM
  4. [SOLVED] How To Freeze Tab/s from JTabbedPane
    By javanewbie in forum New To Java
    Replies: 2
    Last Post: 06-10-2009, 09:42 AM
  5. freeze radioButton without disable them
    By itaipee in forum AWT / Swing
    Replies: 5
    Last Post: 05-25-2009, 09:29 AM

Posting Permissions

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