Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Stack trace not leading to exceptions

Reply
Thread Tools

Stack trace not leading to exceptions

 
 
Todd
Guest
Posts: n/a
 
      11-04-2008
Hello,

As before, the direct output of my program is on a system from which I
can not access the internet, nor can the data be easily transferred.
With that limitation, I am still hopeful that someone may have an idea
as to how I can track down the root of the exceptions that I get.

My program throws both NullPointerException and ClassCastExecption
from thread "AWT-EventQueue-0" showing trace for methods from
javax.swing, java.util and java.awt, but not to any of my methods.

Is there a way to determine where the exception is originating in my
code?

The program is generating and disposing of many progress bars as it
analyzes the problem it is working upon, while maintaining three other
JFrame's, when these exceptions occur. The program does not stop and
the exceptions are thrown repeatedly.

Any help is appreciated,
Todd
 
Reply With Quote
 
 
 
 
John B. Matthews
Guest
Posts: n/a
 
      11-04-2008
In article
<(E-Mail Removed)>,
Todd <(E-Mail Removed)> wrote:

> My program throws both NullPointerException and ClassCastExecption
> from thread "AWT-EventQueue-0" showing trace for methods from
> javax.swing, java.util and java.awt, but not to any of my methods.


Are you updating your GUI from a thread other than AWT-EventQueue-0? In
general, Swing is not thread safe:

<http://java.sun.com/javase/6/docs/api/javax/swing/JProgressBar.html>
<http://java.sun.com/javase/6/docs/ap...summary.html#t
hreading>

[...]
--
John B. Matthews
trashgod at gmail dot com
http://home.roadrunner.com/~jbmatthews/
 
Reply With Quote
 
 
 
 
Todd
Guest
Posts: n/a
 
      11-04-2008
On Nov 4, 2:36 pm, "John B. Matthews" <(E-Mail Removed)> wrote:
> In article
> <(E-Mail Removed)>,


> Are you updating your GUI from a thread other than AWT-EventQueue-0? In
> general, Swing is not thread safe:


Each progress bar is in it's own thread, otherwise I never saw any
progress. I will read the information in the links you provided
before I make more comments.

Thanks
 
Reply With Quote
 
Lew
Guest
Posts: n/a
 
      11-05-2008
Todd wrote:
> Each progress bar is in it's [sic] own thread, otherwise I never saw any
> progress.


That is wrong. GUI updates *must* happen on the EDT.

java.awt.EventQueue.invokeLater()
javax.swing.SwingWorker

--
Lew
 
Reply With Quote
 
Todd
Guest
Posts: n/a
 
      11-06-2008
Thanks John and Lew. I made an attempt to use the SwingWorker, but
must have used it incorrectly as I am still experiencing exceptions.

From the statement:

> GUI updates *must* happen on the EDT.


I believe that I must have to refactor my analysis class to not call
any progress bars, but I don't know how to do so with multi-embedded
loops, each with analysis sections and each with progress bars. Any
ideas?

p.s. I apologize again for not having code available and very much
appreciate your efforts considering the lack.
 
Reply With Quote
 
Lew
Guest
Posts: n/a
 
      11-07-2008
Todd wrote:
> Thanks John and Lew. I made an attempt to use the SwingWorker, but
> must have used it incorrectly as I am still experiencing exceptions.
>
> From the statement:
>
>> GUI updates *must* happen on the EDT.

>
> I believe that I must have to refactor my analysis class to not call
> any progress bars, but I don't know how to do so with multi-embedded
> loops, each with analysis sections and each with progress bars. Any
> ideas?


I repeat:
> java.awt.EventQueue.invokeLater()


--
Lew
 
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
C/C++ compilers have one stack for local variables and return addresses and then another stack for array allocations on the stack. Casey Hawthorne C Programming 3 11-01-2009 08:23 PM
All leading tabs or all leading spaces - why isn't that enforced? John Nagle Python 4 08-07-2007 04:05 PM
RE: All leading tabs or all leading spaces - why isn't that enforced? Delaney, Timothy (Tim) Python 0 08-07-2007 03:50 AM
Exception stack trace sometimes not showing line numbers TS ASP .Net 4 09-18-2006 02:21 PM
Stack trace ALL exceptions? kaeli Java 6 11-03-2004 07:48 PM



Advertisments