Troubleshooting example
To find the condition that has thrown a NullPointerException, trace the code that leads up to this exception message by performing the following actions:
- Add a breakpoint in the method in which the exception occurs, before the exception.
- Set the iteration to some large number: in the Iteration field, type 999999999.
- To start debugging, press F5.
The execution does not stop at the breakpoint since the iteration count is set to a very large number; however, application execution stops when the application throws a NullPointerException.
- Drag the number appearing in the Hits field and drop it in the Iteration field.
The Iteration and Hits fields should contain the same value.
- To stop the execution press Shift+F5.
- To restart the execution, press F5.
The BlackBerry® IDE breaks at the start of the method in which the exception occurs. You can now trace the iteration that causes the exception.
Related topics