Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > java.lang.IllegalStateException: Deadlock risk: AWT tree lock acquired on a showing component..

Reply
Thread Tools

java.lang.IllegalStateException: Deadlock risk: AWT tree lock acquired on a showing component..

 
 
Cherukan
Guest
Posts: n/a
 
      05-24-2007
Hi

I get this error when trying to popup a Swing dialog from a long-
running background thread.

java.lang.IllegalStateException: Deadlock risk: AWT tree lock acquired
on a
showing component when not on the event dispatch thread. (NOTE: do
*not* use
invokeAndWait to fix this assertion failure; that will increase the
chance of
actual deadlock.)
Thread name: task1-1438375310
at
java.awt.Component.assertThreadPolicyCompliance(Co mponent.java:8566)
at java.awt.Component.getTreeLock(Component.java:871)
at java.awt.Component.getLocationOnScreen(Component.j ava:1651)

I realize this is happening because the current thread is not the
event thread.

But the background thread must get this input from the user to
proceed. Also the input
depends on the processing the thread has done upto this point, so it
cannot be
obtained before the thread has started. After the swing dialog has
closed, the thread
needs to resume its processing picking up where it left off.

As the message says, I cant use invokeAndWait.

Whats the 'safe' approach in such a case?

Thanks for your answers.

Cherukan

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
java.lang.IllegalStateException: Deadlock risk: AWT tree lock acquired on a showing component.. Cherukan Java 8 05-25-2007 07:12 PM
java.awt.robot Computer Lock out Msj121 Java 0 09-22-2006 06:14 PM
JMF install on Linux: Cannot load AWT toolkit: gnu.java.awt.peer.gtk. Robert Mark Bram Java 2 12-11-2003 06:57 AM
B tree, B+ tree and B* tree Stub C Programming 3 11-12-2003 01:51 PM
awt file tree view memememe Java 0 07-05-2003 09:19 PM



Advertisments