0

I have two Java programs (client and server) which worked perfect for years until I upgraded to java 1.7.

Now I have the following killer problem with SwingWorker: the done() function is called very late (30-90 seconds) after returning from doInBackground(). I put a println just before the return from doInBackground() and it is shown all the time. The println at the beginning of done() is called very late.

This never happens if I run the programs from Netbeans IDE, only when I run them from command line or by clicking the .jar file (I'm in Windows XP - but happens on other OS's too). Also, never happens with Java 1.6 or earlier.

I am using SwingWorker.jar version 1.2.

Duncan Jones
  • 67,400
  • 29
  • 193
  • 254
  • 5
    I'm confused. You say "*SwingWorker.jar version 1.2*". Are you not using the SwingWorker implementation that comes with the standard libs? – Duncan Jones Oct 25 '12 at 14:26
  • 4
    If you can somehow isolate the problem in a small program, you and we will have a much better chance of solving it. – Hovercraft Full Of Eels Oct 25 '12 at 14:26
  • Could be thread synchronization problem? Can you post some codes? – icza Oct 25 '12 at 14:49
  • Have you checked the firewall settings? For reference, here's an [example](http://stackoverflow.com/a/3245805/230513) that works on Windows 7. – trashgod Oct 25 '12 at 15:54
  • @Duncan: The project is pretty old and at that time SwingWorker wasn't part of standard libs. – Adrian Bica Oct 25 '12 at 18:11
  • Have you tried using the version in the standard libs to see if it exhibits the same problems? – Duncan Jones Oct 25 '12 at 18:13
  • @icza: there is no concurrency involved at that moment (just a dialog window and grabbing some data to fill in in the background). The *doInBackground* ends fine, just the *done()* is called late. It maybe something to do with my computer being very busy, because I rebooted and didn't notice it again – Adrian Bica Oct 25 '12 at 18:16
  • @Duncan: Yes, I tried the version in standard libs with same results. It seems that when I reboot my computer it works better, but after a while it starts doing again. – Adrian Bica Oct 26 '12 at 15:18

0 Answers0