java - com.sun.jdi.InvocationException occurred invoking method - Stack Overflow
The root cause is that when debugging the java debug interface will call the toString() of your class to show the class information in the pop up box, so if the toString method is not defined correctly, this may happen.
Read full article from java - com.sun.jdi.InvocationException occurred invoking method - Stack Overflow
The root cause is that when debugging the java debug interface will call the toString() of your class to show the class information in the pop up box, so if the toString method is not defined correctly, this may happen.
I also had a similar exception when debugging in Eclipse. When I moused-over an object, the pop up box displayed an
com.sun.jdi.InvocationException
message. The root cause for me was not the toString()
method of my class, but rather the hashCode()
method. It was causing a NullPointerException
, which caused the com.sun.jdi.InvocationException
to appear during debugging. Once I took care of the null pointer, everything worked as expected.
No comments:
Post a Comment