PreviousNext

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:

    1. Add a breakpoint in the method in which the exception occurs, before the exception.
    2. Set the iteration to some large number: in the Iteration field, type 999999999.
    3. 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.

    4. 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.

    5. To stop the execution press Shift+F5.
    6. 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


   BlackBerry