07-05-2012 10:02 PM
Can anyone tell me why BB throws below exception? when our app invoke MMS to send MMS. But it can not attache picture sometime. and we found following exception at log.
ControlledAccessException
No detail message
net_rim_os-3(4ED97D16)
PosixFileConnection
init
0x840F
net_rim_os-3(4ED97D16)
Protocol
openPrim
0xAB58
net_rim_cldc-27(4ED9789B)
RIMConnector
open
0x95B9
net_rim_cldc-27(4ED9789B)
RIMConnector
open
0x910C
net_rim_cldc-3(4ED9789B)
Connector
open
0x21EF
net_rim_os-3(4ED97D16)
FileSystemEncryption
openKeyFile
0x2DBD
net_rim_os-3(4ED97D16)
FileSystemEncryption
getMasterKeyInternal
0x2BAB
net_rim_os-3(4ED97D16)
FileSystemEncryption
getMasterKeyForRead
0x2EF4
net_rim_os-3(4ED97D16)
FileSystemEncryption
getKey
0x2EC9
net_rim_bb_fileindexservice-1(4ED97E22)
DataFile
getEncryptionKey
0x1A6B
net_rim_bb_fileindexservice-1(4ED97E22)
DataFile
fetchThumbImageInternal
0xF7E
net_rim_bb_fileindexservice-1(4ED97E22)
DataFile
fetch
0x12E5
net_rim_bb_fileindexservice-1(4ED97E22)
ThumbnailDatabase
fetchThumbs
0x34CA
net_rim_bb_fileindexservice(4ED97E22)
FileIndexServiceImpl
fetchThumbsForRoot
0x1DDB
net_rim_bb_fileindexservice(4ED97E22)
FileIndexServiceImpl
fetchThumbs
0x1167
net_rim_bb_file_explorer_library-9(4ED97E34)
LoadThumbsEvent
processEvent
0x3326
net_rim_bb_file_explorer_library-6(4ED97E34)
CacheEvent
process
0xEE2
net_rim_bb_file_explorer_library-9(4ED97E34)
CacheEventQueue
postEvent
0xFFC
net_rim_cldc-22(4ED9789B)
SingleThreadEventQueue
dispatchRun
0x7DD9
net_rim_cldc-22(4ED9789B)
SingleThreadEventQueue$1
run
0x7E72
Java Code.
MessageConnection conn = null;
try {
conn = (MessageConnection) Connector.open("sms://");
TextMessage m = (TextMessage) conn.newMessage(
MessageConnection.TEXT_MESSAGE, number);
Invoke.invokeApplication(Invoke.APP_TYPE_MESSAGES
new MessageArguments(m));
} catch (Exception e) {
Logger.e(TAG, "startSMS--Error", e);
} finally {
if(conn != null) {
try {
conn.close();
} catch (Exception e) {
e.printStackTrace();
Logger.e(TAG, "startSMS error", e);
}
}
}
07-09-2012 05:58 PM
Does it happen all the time on some devices but not others or part of the time on any device? If it happens all the time on some devices check the application permissions by going to Options -> Application Management, select your application and choose Edit Permissions from the menu. If a required permission has been denied a ControlledAccessException is thrown.
It if happens occasionally on some devices verify the picture you are trying to send. Third party applications are not able to access the images that come pre-installed on the device (backgrounds, etc...). If you attempt to access them a ControlledAccessException is thrown.
07-09-2012 10:17 PM
hi thanks for feedback.
It happens occasionally. but the picture is not pre-installed on the device. is it a platfrom issue?
Could you please give some comments on how to invoke the BB messageconnection.
07-10-2012 08:27 AM
Sometimes it can not attach picture when send mms.
07-10-2012 03:45 PM
Please verify the application's permission settings. Where is the code being run from (an ApplicationMenuItem, background listener or from within your application)?
07-12-2012 12:39 AM
hi MSohm, The code is run form ApplicationMenuItem. Any comments?
07-12-2012 01:41 PM
The ApplicationMenuItem run method is executed in the process of the application that contains the menu. If you run from the Messages application, it runs in the Messages process, etc. This also means that the run method is subject to the application permissions of the application that displays the ApplicationMenuItem.
You can use the technique used in this example to ensure that you code runs within your own application's process instead.
Allow a background listener to detect and update a GUI application