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
RoyWinnie
Posts: 31
Registered: ‎05-09-2011
My Device: OS6
My Carrier: AT&T

Can not attache picture sometime into MMS on OS7.

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);
                }
            }
        }

Please use plain text.
Administrator
MSohm
Posts: 14,416
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Can not attach picture sometime into MMS on OS7.

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.

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.
Contributor
RoyWinnie
Posts: 31
Registered: ‎05-09-2011
My Device: OS6
My Carrier: AT&T

Re: Can not attach picture sometime into MMS on OS7.

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.

Please use plain text.
Contributor
RoyWinnie
Posts: 31
Registered: ‎05-09-2011
My Device: OS6
My Carrier: AT&T

Re: Can not attach picture sometime into MMS on OS7.

Hi MSohm, thanks for feedback. ::catvery-happy::

  1. It is not our 3rd party application access the images. It is our application initiate the message of BB. And the message accesses the images.
  2. And the images are not pre-installed in BB. The images are pictures taken by camera.

Sometimes it can not  attach picture when send mms.

Please use plain text.
Administrator
MSohm
Posts: 14,416
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Can not attach picture sometime into MMS on OS7.

Please verify the application's permission settings.  Where is the code being run from (an ApplicationMenuItem, background listener or from within your application)?

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.
Contributor
RoyWinnie
Posts: 31
Registered: ‎05-09-2011
My Device: OS6
My Carrier: AT&T

Re: Can not attach picture sometime into MMS on OS7.

hi MSohm, The code is run form ApplicationMenuItem.  Any comments?

Please use plain text.
Administrator
MSohm
Posts: 14,416
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Can not attach picture sometime into MMS on OS7.

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

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.