Stack trace not leading to exceptions

Discussion in 'Java' started by Todd, Nov 4, 2008.

  1. Todd

    Todd Guest

    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
     
    Todd, Nov 4, 2008
    #1
    1. Advertising

  2. In article
    <>,
    Todd <> 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/api/javax/swing/package-summary.html#t
    hreading>

    [...]
    --
    John B. Matthews
    trashgod at gmail dot com
    http://home.roadrunner.com/~jbmatthews/
     
    John B. Matthews, Nov 4, 2008
    #2
    1. Advertising

  3. Todd

    Todd Guest

    On Nov 4, 2:36 pm, "John B. Matthews" <> wrote:
    > In article
    > <>,


    > 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
     
    Todd, Nov 4, 2008
    #3
  4. Todd

    Lew Guest

    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
     
    Lew, Nov 5, 2008
    #4
  5. Todd

    Todd Guest

    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.
     
    Todd, Nov 6, 2008
    #5
  6. Todd

    Lew Guest

    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
     
    Lew, Nov 7, 2008
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. kaeli

    Stack trace ALL exceptions?

    kaeli, Nov 3, 2004, in forum: Java
    Replies:
    6
    Views:
    3,837
    kaeli
    Nov 3, 2004
  2. TS
    Replies:
    4
    Views:
    956
  3. Replies:
    6
    Views:
    421
    red floyd
    Apr 12, 2006
  4. John Nagle
    Replies:
    4
    Views:
    604
    James Antill
    Aug 7, 2007
  5. Delaney, Timothy (Tim)
    Replies:
    0
    Views:
    572
    Delaney, Timothy (Tim)
    Aug 7, 2007
Loading...

Share This Page