Results 1 to 4 of 4
  1. #1
    anoorally is offline Member
    Join Date
    Jan 2012
    Posts
    28
    Rep Power
    0

    Default Null error Thread

    Hi, I have this thread code which was running fine a few hours ago but now it gives an error "null" as description. I didn't change any codes relating to threads:

    Java Code:
        public class constantReading implements Runnable {
            
            public void run() {
                try {
                    //System.out.println("reading thread started");
                    
                    while (true) {
                        Object obj = Objectin.readObject();
                        filterData(obj);
                    }
                } catch (Exception e) {
                    print("Error in reading thread: " + e.getMessage());
                }
            }
        }

    And this is the output:
    Error in reading thread: null

    Any idea whats wrong?

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,585
    Rep Power
    12

    Default Re: Null error Thread

    A full stack trace will let you track down the code that is throwing the cryptic exception.

    Java Code:
    } catch(Exception e) {
        e.printStackTrace();
        print("Error in reading thread: " + e.getMessage());
    }

  3. #3
    anoorally is offline Member
    Join Date
    Jan 2012
    Posts
    28
    Rep Power
    0

    Default Re: Null error Thread

    Thank you for your quick reply :) I got the error source.

  4. #4
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,585
    Rep Power
    12

Similar Threads

  1. quick help, if(n == null) error?
    By JayP in forum New To Java
    Replies: 3
    Last Post: 06-10-2011, 10:14 PM
  2. thread ref assigned to null
    By rajinder5 in forum Threads and Synchronization
    Replies: 2
    Last Post: 12-22-2010, 08:47 PM
  3. help with with my null error
    By zhangster in forum New To Java
    Replies: 3
    Last Post: 03-20-2010, 01:32 AM
  4. Replies: 1
    Last Post: 12-05-2009, 08:28 AM
  5. Null Error
    By scoleman123 in forum New To Java
    Replies: 2
    Last Post: 09-19-2008, 05:04 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •