29

I am facing a problem while debugging in Eclipse 3.4.2. I keep getting pop-up Exception processing async thread queue java.lang.NullPointerException

Does anyone know what the exact problem is?

Thanks

Noah
  • 15,080
  • 13
  • 104
  • 148
yogsma
  • 10,142
  • 31
  • 97
  • 154
  • What version of Eclipse are you using? What are you debugging, a simple Java SE application? – Tamas Mezei Nov 11 '09 at 16:22
  • I am using Eclipse 3.4.2 , well it's not a simple, but a complex Java SE application. – yogsma Nov 11 '09 at 17:07
  • You might try updating, sometimes Eclipse has rough points, this clearly seems to be an internal Eclipe problem. There was a similar bug in 2005, the debugger failed to compile some debug expressions. You might want to change them or select other debugging options. Any more details you can share? – Tamas Mezei Nov 11 '09 at 17:49
  • Thanks Tamas, I have automatic updates for eclipse, so it was not issue with that at least. – yogsma Nov 11 '09 at 19:12
  • Well, it sounds like the problem is either from trying to dereference a null pointer, or there's a timing problem related to use of multiple threads. Can you provide any more information beyond the error window text? – Matt Ball Nov 11 '09 at 16:25
  • Matt I am pasting the information which I see in details of that window "Exception processing async thread queue Exception processing async thread queue java.lang.NullPointerException Exception processing async thread queue java.lang.NullPointerException Exception processing async thread queue java.lang.NullPointerException" – yogsma Nov 11 '09 at 17:08
  • Okay, that's not really what I was asking about. It would be much easier to diagnose the problem with, for example, the conditions that cause the problem, or the code that causes the problem, or at least some basic information about /what/ you're debugging (as Tamas asked). – Matt Ball Nov 11 '09 at 17:47
  • Also, can you run the same code (not debugging) successfully, or does it throw a NullPointerException as well? – Matt Ball Nov 11 '09 at 17:48
  • Matt Thanks, I solved the problem. It was issue with the expressions I was evaluating all the time. I was not removing old expressions which I was watching earlier. I removed all expressions and it worked fine. – yogsma Nov 11 '09 at 19:09

5 Answers5

47

The problem was with the expressions watching while debugging. If those old expressions are not removed, it just keeps evaluating them and since they don't exist for current program, they keep throwing null pointer exception.

yogsma
  • 10,142
  • 31
  • 97
  • 154
  • 3
    -1 incorrect answer: watching old expressions gives "test" , not the async thread queue java.lang.NullPointerException; The bug is related to evaluating string arrays such as private String[] whereargsEN; – Noah Jan 28 '11 at 13:44
  • Removing old expressions fixed the problem for me. – BlueSilver Jul 11 '11 at 14:16
  • I was having this problem too. After reading this thread I just removed all the expressions from my list and voila it's working. – Dave Sep 06 '11 at 02:55
  • 1
    @anyone What does this mean "Removing old expressions" ? – Ahmad Shahwaiz Jan 17 '13 at 07:39
  • @Ahmad He talks about old Watched Expressions, e.g. you enter aBean.getData() and the IDE evaluates that expression at each step when debugging. – hellodanylo May 20 '13 at 08:45
8

This is a known bug that the eclipse group is actively working on correcting. It is related to evaluating static variables in the debugger. Often show up when watching String[] variables. Prior comments about removing watched variables are partially correct, but only if they are static

Keep watching the eclipse release notes for a bug fix

Noah
  • 15,080
  • 13
  • 104
  • 148
3

I have the same problem, I found the relevant bug report: https://bugs.eclipse.org/bugs/show_bug.cgi?id=277574

I am using Eclipse 3.6.1, and the bug report says it is fixed in 3.6.1, however I still see it when I put a breakpoint in a Handler()

Exception processing async thread queue Exception processing async thread queue java.lang.UnsupportedOperationException

EDIT: I am able to see the value stored in the array of strings by adding the expression to the expression list. I only get the Eclipse exception when I put my mouse pointer over the array to inspect it. So I can debug, but I just have to remember to clear the expression list when I am done with it.

Someone Somewhere
  • 23,475
  • 11
  • 118
  • 166
1

Eclipse Standard/SDK

Version: Kepler Service Release 1 Build id: 20130919-0819

I have a similar problem ... in the absence of a fix, I found a temporary workaround.

// This will cause the error as decribed in my code ...

public static void main(String[] args) 
{
    public static HashMap<String, String> students = new HashMap<String, String>();

    ...
}

if I sperate the declaration and initialisation ... I can get the debugger to behave as expected. Dont know why this works ... but appears to work for me ... Hope this helps someone.

public static HashMap<String, String> students ;

public static void main(String[] args)
{
    students = new HashMap<String, String>();

    ...
}
0

I had the similar issue with processing async thread in debugging mode but with com.sun.jdi.ObjectCollectedException

    Exception processing async thread queue 
    com.sun.jdi.ObjectCollectedException

no cleaning expression list, or anything else helps. But i noticed that my phone is working under ART runtime environment and when am I switched back to Dalvik async thread error is dissapeared.

validcat
  • 6,158
  • 2
  • 29
  • 38