0

am currently using the Eclipse Blackberry plug in for my development, and I have already gotten my code Signing keys from RIM, and can debug on the device successfully.

Where I run into problems is generating a SQLite database on the device (with no SD card). I get a ControlledAccessException thrown every time I try to use the line if(DatabaseFactory.exists(dbURI)).

I have used the file signing tool provided by RIM to create my own .KEY file. I have set the .KEY file to be used as default for both public and non-public classes, as well as the other packages that are in my app. The security settings on my phone (Torch 9810) have given the app allowed status for everything under Application permissions. I have also tried resigning the application to no avail.

I know that my application is picking up the .KEY file because key = CodeSigningKey.get(moduleHandle,"Key_Name"); returns a value. So does anybody have any idea what's going on?

UPDATE: So my signing tool is telling me that the key I generated is "Not Registered" under status, and under Details: "Please contact the signer and register with the Signing Authority." But since I am the signer, what do I do?

  • Sometimes if you are running on simulator you will get this type of exception; so whenever you get this type of exception(in simulator) then simply close the simulator and open it again; – alishaik786 Apr 16 '12 at 15:09
  • The program works fine on the simulator, the problem only occurs when I deploy to the device – user486713 Apr 16 '12 at 16:09

1 Answers1

0

The docs for ControlledAccessException say:

This exception is thrown when a thread attempts to access a ControlledAccess object without the appropriate permission.

You need to check whether the user has granted the appropriate permissions to access the filesystem in order to use the Database api. ApplicationPermissions.PERMISSION_FILE_API is the likely one needed, but there may be more.

Michael Donohue
  • 11,776
  • 5
  • 31
  • 44