If you are using Internet Explorer, please remove blackberry.com from your compatibility view settings.

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
Developer
rcmaniac25
Posts: 1,804
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.2174, Z10 (STL100-3)-10.3.0.700 Dev OS, Z30 (STA100-5)-10.3.0.700 Dev OS, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon
Accepted Solution

App Exits Unexpectedly

[ Edited ]

I am currently working on a large library. I made a test app to test all the functions in it. It worked just fine for a while but now that I have completed the current test it randomly exits before it finishes. I thought initially that it was calling the assert function I built in (causes the app to exit) but after removing the exit call and testing again it still exits.

 

The only sign of it exiting (besides the app actually no longer running) is the debug messages:

[0.0] FocusHistory: Focus gained; App lcms2_test; Component littlecms.internal.TestApp$135
[0.0] Exit lcms2_test(182)
[0.0] Detected background switch for lcms2_test(182) who has NO tunnels open - defocus NOT called [0.0] Foreground net_rim_bb_ribbon_app(85)
[0.0] Detected foreground switch for net_rim_bb_ribbon_app(85) who has NO tunnels open - focus NOT called
[0.0] TID:unable to execute in the app littlecms.internal.TestApp@d1c79ac7|java.lang.Object@35be5dfa|-1

 [For those wondering this is my LCMS library I'm testing]

 

  1. I click the run button.
  2. The app exits before the test is done.
  3. Normal BB functions
  4. Normal BB functions
  5. Normal BB functions
  6. The test is actually run on a separate thread so I assume this is the Thread trying to call the (no missing) functions.

I'm running Eclipse 3.6.1, Eclipse Plugin 1.3.0, Library and App compiled for 4.5.0, testing on Storm 9550 simulator running 5.0.

 

Any ideas on where this might be coming from?

---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.
Please use plain text.
Developer
rcmaniac25
Posts: 1,804
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.2174, Z10 (STL100-3)-10.3.0.700 Dev OS, Z30 (STA100-5)-10.3.0.700 Dev OS, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: App Exits Unexpectedly

Has anyone had something like this happen before?

---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.
Please use plain text.
Administrator
MSohm
Posts: 14,362
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: App Exits Unexpectedly

The debug output makes it look like the app just went into the background.  Try holding down the BlackBerry key to bring up the task switcher.  Are you able to switch back into your app?

 

Is any exception thrown?

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Developer
rcmaniac25
Posts: 1,804
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.2174, Z10 (STL100-3)-10.3.0.700 Dev OS, Z30 (STA100-5)-10.3.0.700 Dev OS, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: App Exits Unexpectedly

I actually meant to close this. I didn't find a solution but it seemed to have fixed itself.

 

The app didn't go to background, it closed completely (though when I reopen it I got the messaged that the app was in "saved state", whatever that means. The app would go to evaluate a line of code like "i++" and it would just shut off; no warning, exception, error, crash, etc. It just shut off.

 

Then randomly one day (after adding more code to another part of the program that I know isn't called by the part that kept crashing) I was able to actaully debug through the entire piece of code and found where it was exiting, an exception handler function I had coded. The thing is I thought that was where it was exiting but the breakpoint was never getting hit. The app would just close as previously mentioned.

 

I can no longer reproduce it (again it never touches the code I changed) but it's otherwise been resolved.

---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.
Please use plain text.
Developer
spring_suvarna
Posts: 330
Registered: ‎02-25-2009
My Device: Not Specified

Re: App Exits Unexpectedly

Hello,

 

I am facing the same problem with my application. When i run it on simulator it works fine but on device it just never starts. When i click on app, device ui hangs for 3 -5 seconds (user not able to click anywhere) and then after some time output window shows same error with my applications name. I an using database, recordStore in my app.

 

Any probable reason for this ?

 

Thanks

Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: App Exits Unexpectedly

Doesn't sound like the same problem to me.

 

Check the Event Log on the device and look at the messages that come out after you click your icon.  Alternatively debug on device.  One of these will probably tell you where the problem is.

 

If not, since this is not the same problem, I suggest you start a new Thread. 

Please use plain text.
Developer
rcmaniac25
Posts: 1,804
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.2174, Z10 (STL100-3)-10.3.0.700 Dev OS, Z30 (STA100-5)-10.3.0.700 Dev OS, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: App Exits Unexpectedly

I have to agree with peter.

 

My problem wasn't that the app never started (which sounds like an error occurred somewhere on startup and the app shuts itself down), it's that in the middle of a normal execution, it shut down.

 

I haven't updated this thread, but I have come to believe that the problem has to do with a couple lines of "safety" code that were called that I didn't think were getting called. Those lines happened to call System.exit. I changed the lines to "properly" close the application and shutdown the app's GUI. When I did this I was notified in a much more "graceful" manor.

 

Through various tracing I noticed that when an error occurred, I would get a very quick notification before System.exit was called. I was not expecting it to get called so I placed some breakpoints in and started the app again (without restarting the simulator). At that time, it had conflicting elements in memory (used RuntimeStore heavily, so even if the app closes, the elements are still in memory) and still-open FileConnections. At a seemingly random moment one of those components would trigger some of the "safety" code and the app would shut down "randomly". Once I changed it to shutdown properly, the app would remove the references from the RuntimeStore and close the FileConnections and when I would try to reproduce the issue, it would not reoccur. Thus my issue was "fixed".

 

The error "unable to execute in the app {full app namespace}" is obvious because of the line a couple lines above the error "Exit {app name}". So I would check to make sure that you start a fresh start if the app with breakpoints at all points where the application can exit. If any of those get hit while debugging on the simulator or device and you didn't expect it, then you have your issue. Otherwise I would create a new thread where you can provide more information.

 

Unrelated: Did anyone notice the change of "Kudo" to "Like" within the past couple minutes?

---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.
Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: App Exits Unexpectedly

 Did anyone notice the change of "Kudo" to "Like"

 

Yep, I think I prefer kudos to like, but I think the function is the same so not bothered. 

Please use plain text.
Developer
rcmaniac25
Posts: 1,804
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.2174, Z10 (STL100-3)-10.3.0.700 Dev OS, Z30 (STA100-5)-10.3.0.700 Dev OS, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: App Exits Unexpectedly

Same, perfer Kudo.
---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.
Please use plain text.