Welcome to the Official BlackBerry® Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Trusted Contributor
WorkHorse
Posts: 100
Registered: 01-13-2012
My Carrier: Simulator

Debugging Errors

I have been given a project left off by another programmer to complete. However, upon opening the code and loading it on the simulator it produces a Null Exception Error 104. There is about 2000 lines of code and I don't know where to being debugging, or rather how to debug in this case. Is there a method in the eclipse plug in that would show me exactly where the error is coming from, or which line of code so that I may go from there? At this point I'm completely shooting in the dark. Again, thanks for any assistance. 

Please use plain text.
Developer
simon_hain
Posts: 10,780
Registered: 07-29-2008
My Carrier: O2 Germany

Re: Debugging Errors

if it is a null pointer exception you can use "run, add exception breakpoint" to set a breakpoint on nullpointer exceptions.
do this only after the simulator started though, as the startup has its fair share of (controlled) nullpointers.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.

peter_strange wrote:
"This process should happen traumatically for you in both JDE and Eclipse."
Please use plain text.
Trusted Contributor
WorkHorse
Posts: 100
Registered: 01-13-2012
My Carrier: Simulator

Re: Debugging Errors

Following your advice, I'm doing 

 

1.) right click on project  -> Run As -> Blackberry Simulator

     (simulator starts up, begins to load)

 

2.) I click on eclipse toolbar Run -> Add Java Exception Breakpoint

 

3.) Scroll through available options, add NullPointer Exception for 6.0.0, both checkboxes are checked which state "suspend on caught exceptions" and "suspend on uncaught exceptions"

 

The simulator loads up finally and I still get the error without knowing where in the code the error is supposedly coming from. Am I doing this correctly?

Please use plain text.
Developer
simon_hain
Posts: 10,780
Registered: 07-29-2008
My Carrier: O2 Germany

Re: Debugging Errors

use "debug as", not "run as"
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.

peter_strange wrote:
"This process should happen traumatically for you in both JDE and Eclipse."
Please use plain text.
Trusted Contributor
WorkHorse
Posts: 100
Registered: 01-13-2012
My Carrier: Simulator

Re: Debugging Errors

A few things pop up, firstly a window stating The "net_rim_bis_client__ru.debug" file is missing. Please choose the missing file. At this point I don't click anything.

 

After a while a dialog box pops up 'Launching PROJECTNAME' has encountered a problem. Failed to connect to remote VM. Connection timed out. 

 

I click details and  it states: 

 

Failed to connect to remote VM. Connection timed out.
org.eclipse.jdi.TimeoutException

 

The simulator load bar is stuck at this point.

Please use plain text.
Developer
simon_hain
Posts: 10,780
Registered: 07-29-2008
My Carrier: O2 Germany

Re: Debugging Errors

you can safely ignore the first message (press cancel or continue or whatever). if you don't the debugger cannot attach, thus resulting in the timeout message you get.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.

peter_strange wrote:
"This process should happen traumatically for you in both JDE and Eclipse."
Please use plain text.
Trusted Contributor
WorkHorse
Posts: 100
Registered: 01-13-2012
My Carrier: Simulator

Re: Debugging Errors

But when I press cancel, just another missing debug file dialog box comes up. The name of the .debug that is missing is changed but there are a whole bunch of windows after I close the first one.

Please use plain text.
Developer
simon_hain
Posts: 10,780
Registered: 07-29-2008
My Carrier: O2 Germany

Re: Debugging Errors

don't you have a "don't show this message again" option? i do.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.

peter_strange wrote:
"This process should happen traumatically for you in both JDE and Eclipse."
Please use plain text.
Trusted Contributor
WorkHorse
Posts: 100
Registered: 01-13-2012
My Carrier: Simulator

Re: Debugging Errors

oh I do, I was wondering if the missing file dialogs generated would cause a problem, and if I select "don't show this again" if I needed the file name again I wouldn't know where to find it. If I try cancelling all the missing file dialogs rapidly (takes less than 10 seconds) at the end I get the following error:

 

debug_error.png

 

The JRE thats listed in the program is 6.0.0 and I have these simulators:

debug_error2.png

Please use plain text.
Developer
simon_hain
Posts: 10,780
Registered: 07-29-2008
My Carrier: O2 Germany

Re: Debugging Errors

click "don't ask me again" on all of them and continue...
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.

peter_strange wrote:
"This process should happen traumatically for you in both JDE and Eclipse."
Please use plain text.