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

Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.

Posts: 140
Registered: ‎02-08-2010
My Device: Torch 9800, Storm 9530, Curve 8330
My Carrier: AT&T, Verizon
Accepted Solution

addMenuItem( ApplicationMenuItem ) throws java.lang.Error

[ Edited ]


ApplicationMenuItemRepository.getInstance().addMenuItem(ApplicationMenuItemRepository.MENUITEM_SYSTEM, applicationmenuitem)


This pops up an error:  "Uncaught exception: Java.lang.Error"


The exception cannot be caught, and does not appear in the debugger, only on the phone.  It occurs after addMenuItem calls toString in the ApplicationMenuItem, but the string is fine -- a literal.


Call stack is several levels deep into unknown methods.



Works fine in simulators and on the Storm, but not on an 8330 running 4.5 .


Posts: 140
Registered: ‎02-08-2010
My Device: Torch 9800, Storm 9530, Curve 8330
My Carrier: AT&T, Verizon

Re: addMenuItem( ApplicationMenuItem ) throws java.lang.Error

Solved.  For some reason you need PIM / Organizer permission to add system-wide menu items.  I had the module set with this permission, but the CodeModuleGroup didn't have it.


They sure made it hard to debug this one -- it didn't throw a ControlledAccessException as it was supposed to.  Instead, it threw something that can't even be caught, which means that if the users don't have the permissions set right, the app bombs with an error that could be anything.


Am checking for permissions in advance and prompting if necessary, but in the past have still had permissions-related support requests despite that, so it doesn't always work.