Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Contributor
Posts: 17
Registered: ‎01-13-2011
My Device: Blackberry 9900
My Carrier: KPN

Device reboots on "debug on device"

Hi,

 

I'm having a problem debugging my program on a device through the "debug on a device" option in eclipse (curve 8520). Sometimes when I run the program and then exit it and try to reload a new build, the device reboots. This is very annoying as it takes a while to boot up. Before this only happened when the program thread was still running, but now it seems to be all the time.

 

I have been using MIDP RecordStores but deleted them all in the program and then removed all references to that code or any other code that I added when the reboots started to happen. Yet the reboots still happen (on rare occasions they don't but I havent been able to reproduce when that exactly is the case).

 

I found this document http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800620/What_Is...

which gives some ideas on what could cause it, but none of them seem to be relevant to my program.

 

Can someone give me any idea what could be causing this?

 

Thanks,

Jonathan

 

 

Developer
Posts: 1,806
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.3253, Z10 (STL100-3)-10.3.1.2576, Z30 (STA100-5)-10.3.1.2582, Passport (SQW100-1)-10.3.1.2576, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: Device reboots on "debug on device"

It's exactly what you found. You install a new version of your app on the device and it requires a reboot. The debugger forces the device to reboot.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Contributor
Posts: 17
Registered: ‎01-13-2011
My Device: Blackberry 9900
My Carrier: KPN

Re: Device reboots on "debug on device"

Thank you for your reply.

The problem is, this doesn't happen all the time. Sometimes I can replace the app without rebooting while it's still there.

 

I think the problem is with something that keeps running or keeps the app locked. When I try to remove it, my bb will say "the app is in use, do you want to reboot to remove it?".

 

I don't see any threads in the debugger though, and the debug output says the app has exited, so I can't figure out what the problem is exactly.

I don't want my app to keep running something while it's supposed to shut down.

 

Jonathan

Contributor
Posts: 17
Registered: ‎01-13-2011
My Device: Blackberry 9900
My Carrier: KPN

Re: Device reboots on "debug on device"

Ok, I seem to have traced it to the difference between using the escape key to exit the app and using Menu -> close.

I intercept the escape key and do a System.exit(0); but somehow this doesn't close it completely. The menu -> close works fine.

 

Does someone have an idea what could be wrong? 

 

Thanks,

Jonathan

Developer
Posts: 1,806
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.3253, Z10 (STL100-3)-10.3.1.2576, Z30 (STA100-5)-10.3.1.2582, Passport (SQW100-1)-10.3.1.2576, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: Device reboots on "debug on device"

Don't take my word for it but I think that System.exit closes only the main thread, any other threads will still be running. If you use Menu->close then it closes the other threads and then the main thread.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Developer
Posts: 604
Registered: ‎12-27-2010
My Device: Not Specified

Re: Device reboots on "debug on device"

[ Edited ]

It does it the same way the simulator requires a restart when it complains about class size changing.

Highlighted
Developer
Posts: 1,806
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.3253, Z10 (STL100-3)-10.3.1.2576, Z30 (STA100-5)-10.3.1.2582, Passport (SQW100-1)-10.3.1.2576, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: Device reboots on "debug on device"

This is the second thing today that's stumped me.

 

What changes do you make? Simply adding more code? Do you have a record/persistent/runtime store? System listeners?

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Contributor
Posts: 17
Registered: ‎01-13-2011
My Device: Blackberry 9900
My Carrier: KPN

Re: Device reboots on "debug on device"

Can't figure it out, sometimes it happens, sometimes it doesn't.

I disabled pretty much everything, it's just a Screen push now.

 

I think i'll just disable the escape button for now and force myself to close it with the menu. Thanks for your help so far.

Developer
Posts: 1,806
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.3253, Z10 (STL100-3)-10.3.1.2576, Z30 (STA100-5)-10.3.1.2582, Passport (SQW100-1)-10.3.1.2576, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: Device reboots on "debug on device"

No problem, maybe someone else here will be able to help you.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.