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
New Contributor
Paul_Kaplan
Posts: 5
Registered: ‎03-17-2010
My Device: Bold 9700

Problems reinstalling app via OTA

We’re having issues with reinstalling our app via OTA on a 9700 running 5.0.0.330.  We do not have the same issues with any other devices.  We also do not have any issues if the app has been deleted and the device has been rebooted.

The app consists of a main app and a background app.  Generally this has been working well for us, through several revs and lots of testing.
We recently made some changes to the code to use BIS whenever it's available (yes we're now Alliance Partners) to connect the app to our servers via HTTP.  This was done because we had all kinds of connectivity issues before.  With lots of testing, we now believe our connectivity issues are history.
Sometimes the app fails to reinstall via OTA.  It appears that the background app is still running, so the OTA downloader refuses to reinstall the background app, and only installs the foreground app.   The two symptoms are that the foreground app cannot access the runtime store (using the well-known algorithms to manage a background app), and the background app is already running (may be the background app from the previous install).
More detail:  as part of the connectivity upgrades, we recently added a hook to CoverageInfo.addListener, based on some sample code we got from RIM.  There is one instance of this in the foreground app, and one in the background app. One theory is that because the listener is registered with the OS, the OS refuses to unload it.  Again we can only reproduce this on the 9700 running running 5.0.0.330.  There may be other reasons; that is only a theory.
Any comments on the above?
Also, is there any reason to use the coverage status listener (which was shown in RIM sample code for managing connnections), or can we postpone checking for the best available transport until the last possible moment when we try to connect?

 

Developer
Posts: 1,474
Registered: ‎04-14-2009
My Device: Not Specified

Re: Problems reinstalling app via OTA

[ Edited ]

1. What exactly do you mean when you say "fails to reinstall OTA"? What are the error messages and/or stack traces?

 

2. Do you mean BlackBerry Browser OTA (point the BlackBerry Browser to a .jad file) or some proprietary OTA download + CodeModuleManager or BES OTA Push?

 

3. Does you application consists of multiple modules (excluding sibling modules)? If it does, are you upgrading them all in one go?

New Contributor
Paul_Kaplan
Posts: 5
Registered: ‎03-17-2010
My Device: Bold 9700

Re: Problems reinstalling app via OTA

1) The foreground app throws an exception making a call to RuntimeStore.getRuntimeStore().There is nothing in exception.getMessage();  I added some instrumentation code which showed that the background app was still running, and we do not see anything in the log from the background app starting up, so I assume it's from the previous installation of the app.


2) Yes, it was Blackberry OTA with a .jad file.  This mechanism has generally worked well forus, with this one (seemingly random and occasional) exception.


3) When we distribute via OTA, the application is 7 .cod files and a .jad file.  Otherwise it'd distributedas a single .cod (about 380 kb) and an .alx file.  There is a CLDC application and an Alternate Entry Point. 

Developer
Posts: 1,474
Registered: ‎04-14-2009
My Device: Not Specified

Re: Problems reinstalling app via OTA

What's the type and the stack trace of the exception?

New Contributor
Paul_Kaplan
Posts: 5
Registered: ‎03-17-2010
My Device: Bold 9700

Re: Problems reinstalling app via OTA

Accessing the runtimestore:

 

guid:0xC1A90F9B4F904C57 time: Fri Mar 12 11:21:54 2010 severity:5 type:2 app:App Perms data:d MyCompany:2
guid:0x9C3CD62E3320B498 time: Fri Mar 12 11:21:54 2010 severity:1 type:3 app:Java Exception data:
ControlledAccessException
No detail message
net_rim_cldc-19(4ADFCA2B)
ApplicationControlImpl
assertIPCAllowed
0x119C
net_rim_cldc-18(4ADFCA2B)
ApplicationControl
assertIPCAllowed
0x2E1
net_rim_cldc-9(4ADFCA2B)
RuntimeStore

0xBB86
net_rim_cldc-9(4ADFCA2B)
RuntimeStore
getRuntimeStore
0xBB9A
MyCompany(39485766)
MyApplication

0x1F84
MyCompany(39485766)
MyApplication

0x20F0
MyCompany(39485766)
MyApplication
main
0x223E

Developer
RexDoug
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Problems reinstalling app via OTA

You have a ControlledAccessException - which means that the application permissions are restricting your access.

 

 

 

New Contributor
Paul_Kaplan
Posts: 5
Registered: ‎03-17-2010
My Device: Bold 9700

Re: Problems reinstalling app via OTA

This only happens occasionally, and only on the 9700.  Also, a reboot (i.e. battery pull) will make it go away.

Developer
Posts: 1,474
Registered: ‎04-14-2009
My Device: Not Specified

Re: Problems reinstalling app via OTA

Is the handheld rebooted at the end of the upgrade? If not, try to cold-reboot and see if the error persists. If it goes away, then it's probably due to the classic issue where application permissions don't properly apply after an upgrade in certain cases. In this case, you can experiment with programmatically checking, just before accessing RuntimeStore, whether you have the Inter Process Communication (Cross Application Communication in newer OSes) permission or not.

New Contributor
Paul_Kaplan
Posts: 5
Registered: ‎03-17-2010
My Device: Bold 9700

Re: Problems reinstalling app via OTA

Thanks.  That sounds like the problem.

 

A cold reboot always fixes it.

 

Is there anything that can be done from within the app to change the permissions if we're  in that state?  At one point, I had tried a loop to catch the exception from getting the runtimestore, wait one second, and try again.  Even ten tries was not enough.

 

For now, what we're doing is detecting the condition, and prompting the user with a dialog box: do they want to reboot?  If yes, we reboot, if no, we exit the app.  This is not ideal but at least it's not totally embarrassing.

 

Oh yes, forcing a reboot, that was another adventure in Blackberry development...