thread hangs in windows XP with JRE 1.5

My java application hangs in a windows xp machine with jre 1.5. But it works fine in windows 2000 and in some other windows xp machine.

Here is the thread dump :

Full thread dump Java HotSpot(TM) Client VM (1.5.0-b64 mixed mode, sharing):

"Image Animator 3" daemon prio=4 tid=0x038bab90 nid=0x9cc waiting on condition [

0x0378f000..0x0378fbe8]

at java.lang.Thread.sleep(Native Method)

at sun.awt.image.GifFrame.dispose(Unknown Source)

at sun.awt.image.GifImageDecoder.readImage(Unknown Source)

at sun.awt.image.GifImageDecoder.produceImage(Unknown Source)

at sun.awt.image.InputStreamImageSource.doFetch(Unknown Source)

at sun.awt.image.ImageFetcher.fetchloop(Unknown Source)

at sun.awt.image.ImageFetcher.run(Unknown Source)

"Thread-17" prio=7 tid=0x038baa10 nid=0x9a4 waiting for monitor entry [0x0311f00

0..0x0311fc68]

at java.awt.Component.setFont(Unknown Source)

- waiting to lock <0x17e98810> (a java.awt.Component$AWTTreeLock)

at java.awt.Container.setFont(Unknown Source)

at javax.swing.JComponent.setFont(Unknown Source)

at javax.swing.plaf.basic.BasicComboBoxRenderer.getListCellRendererCompo

nent(Unknown Source)

at javax.swing.plaf.basic.BasicListUI.updateLayoutState(Unknown Source)

at javax.swing.plaf.basic.BasicListUI.maybeUpdateLayoutState(Unknown Sou

rce)

[1418 byte] By [samisonlinea] at [2007-10-3 2:59:12]
# 1
switch to Open Solaris and Linux OSdump Microsoft OSs which are unstable and virus prone
PMJaina at 2007-7-14 20:48:46 > top of Java-index,Java Essentials,Java Programming...
# 2
I am doing UI updates(like custom listmodels) inside the user spawn thread. I read from forums that we need to use SwingUtilities.invokeLater() in such cases. But how it then works in some windows xp machines and windows 2000 ? Am I missing anything.
samisonlinea at 2007-7-14 20:48:46 > top of Java-index,Java Essentials,Java Programming...
# 3
> switch to Open Solaris and Linux OS> dump Microsoft OSs which are unstable and virus proneThanks for the qualified comment.
CeciNEstPasUnProgrammeura at 2007-7-14 20:48:46 > top of Java-index,Java Essentials,Java Programming...
# 4

> I am doing UI updates(like custom listmodels) inside

> the user spawn thread. I read from forums that we

> need to use SwingUtilities.invokeLater() in such

> cases. But how it then works in some windows xp

> machines and windows 2000 ? Am I missing anything.

Timing maybe. In other words: coincidence.

All I can see is that you have a deadlock. One thread does nothing, while the other waits for a lock to be released. You seem to be loading an image there, how do you do that? Image-loading can be an asynchronous or synchronous process, depending on how it's done. I assome you do it asynchronously, and the loading thread decided to wait for something else to happen, while locking the displaying component.

Just guessing here, though. There's a Swing forum...

CeciNEstPasUnProgrammeura at 2007-7-14 20:48:46 > top of Java-index,Java Essentials,Java Programming...
# 5
I am using new ImageIcon (getClass().getResource(...)) and setting in a JLabel using setIcon()
samisonlinea at 2007-7-14 20:48:46 > top of Java-index,Java Essentials,Java Programming...
# 6
> I am using new ImageIcon> (getClass().getResource(...)) and setting in a JLabel> using setIcon()Hm. Not what I expected.
CeciNEstPasUnProgrammeura at 2007-7-14 20:48:46 > top of Java-index,Java Essentials,Java Programming...
# 7
What you expected.
samisonlinea at 2007-7-14 20:48:46 > top of Java-index,Java Essentials,Java Programming...
# 8

> What you expected.

Using Toolkit or something. I know it takes its sweet time to actually prepare the image, and that might somehow block other resources. I didn't expect ImageIcon to do it. Sorry, personally, I'm stumped.

Go ask at the Swing forum, and make sure you link both threads.

CeciNEstPasUnProgrammeura at 2007-7-14 20:48:46 > top of Java-index,Java Essentials,Java Programming...