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 Developer
petritis
Posts: 14
Registered: ‎07-16-2008
My Device: Not Specified
Accepted Solution

Trying to display a map but Eclipse Invoke Access Restriction

I am trying to show a map.

For a simple test I added this line of code:

 

Invoke.invokeApplication(Invoke.APP_TYPE_MAPS, new MapsArguments());


But Eclipse won't let me compile it.

The import I am using is:

 

import net.rim.blackberry.api.invoke.Invoke;

 

Eclipse marks it as an error and says:

 

Access restriction: The type Invoke is not accessible due to restriction on required library C:
 \Program Files\EclipseBlackBerry\plugins
 \net.rim.eide.componentpack4.3.0_4.3.0.8\components\lib\net_rim_api.jar

 

I have signing keys and have signed the programs .cod file successfully in Eclipse.

 

Any hints on how to make it work? 

 

Please use plain text.
New Developer
petritis
Posts: 14
Registered: ‎07-16-2008
My Device: Not Specified

Re: Trying to display a map but Eclipse Invoke Access Restriction

It may have been working without seeming like it was.

Here is some info:

 

1) Make sure to have your signing keys in the Eclipse plugin dir with the codesigning jar.  For me this is:

 

C:\Program Files\EclipseBlackBerry\plugins\net.rim.eide.componentpack4.3.0_4.3.0.8\components\bin

 

2) Make sure Eclipse is exitted.

3) Start Eclipse and open a workspace with a Blackberry project that needs signing.

4) Do "Project -> Clean" making "Start a build immediately" be unchecked.

5) Do "Project -> Build All"

6) Do "Project -> Build Active Blackberry Configuration" (this seems to already have occured by step 5, but just to make my steps repeatable I am list it here)

7) Do "Blackberry -> Request Signatures..." and a signature dialog box will pop up, if you didn't exit eclipse as I said in step 2, you may instead get some file open dialog for a .cod file, to match my instructions go back to step 2 and exit Eclipse and continue with all the steps until you get back to here.

8) Request signatures (it will do so for 3 of the 6 items listed).

9) You are ready to debug, so run your project in the debugger and it should work (I have password locking set, so when I start debugging, Eclipse pops up a dialog where I have to put in my BB password, and if I get it wrong or dismiss the dialog, then I am hosed and I have to exit eclipse and start over, and then when the BB simulator starts I have to enter the password again).

10) after you debug, if you do NOT exit Eclipse, you can change the code and then do steps 5, 6, and then 9 to debug (you don't need to get the signing done again - but if you try to sign again it will give you a dialog asking for a .cod file which you don't need to do, so don't do it.  One more thing, on successive debugs I only need to give the password to the BB, I don't get a dialog from Eclipse asking for it).

 11) If you ever do exit eclipse, I think you have to go back to the steps after #2 (you may be able to skip the signing again, but I haven't tried it yet - I don't want to mess up something that is working good enough at the moment).

 

Good Luck! 

Please use plain text.
New Developer
petritis
Posts: 14
Registered: ‎07-16-2008
My Device: Not Specified

Re: Trying to display a map but Eclipse Invoke Access Restriction

More to be aware of:

 

1) Eclipse will put a squiggley red underline and mark as errors all of the imports and usages of code that needs signing, but it will work anyway.

2) There is documentation in a few places that says you can turn off the error markers by going to

"Window -> Preferences... -> BlackBerry JDE -> Code Signing"

and then checking all the options there, but for me Eclipse shows no options there.  I even reinstalled Eclipse in a clean virtual machine and still no options there.  If you really want to get rid of the error markers there is a .class file you can edit to do so, but I don't think we are supposed to mess with that file so I have left it alone (other than I messed with it to to work out my steps), but it is left in its original form now.

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

Re: Trying to display a map but Eclipse Invoke Access Restriction

For the record, here is a link to our developer knowledge base article on this issue.

 

How To - Turn off access restriction warnings in the BlackBerry JDE Plug-in for Eclipse
Article Number: DB-00658

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/1407892/How_To_-_Disa...

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.
New Developer
petritis
Posts: 14
Registered: ‎07-16-2008
My Device: Not Specified

Re: Trying to display a map but Eclipse Invoke Access Restriction

That doesn't work.

I have tried it on 2 seperate installs.

That panel is blank an has no checkboxes.

On the top it says:  "Allow access to APIs which require the following keys:"

Then it is blank, and on the bottom there are the buttons that are part of the preferences dialog (they are "OK" and "Cancel")

 

Perhaps the keys have to be installed a certain way for them to show up on that panel.

Perhaps I have to use a certain JDE that is not the one that is part of the Eclipse plugin.

 

But for whatever reason there are not checkboxes there. 

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

Re: Trying to display a map but Eclipse Invoke Access Restriction

Are you able to sign an application from Eclipse?  This will show whether or not the signature keys are installed/configured for using within Eclipse.

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.
New Developer
petritis
Posts: 14
Registered: ‎07-16-2008
My Device: Not Specified

Re: Trying to display a map but Eclipse Invoke Access Restriction

Yes I can sign in Eclipse.

 

I do it via "BlackBerry -> Request Signatures..." which if it is the first time I do that after starting Eclipse just brings me to the screen that shows the 6 licensable things.  After the first time, it instead asks me to choose a .cod file, and then after I do brings up the screeen that shows the 6 licensable things.

 

The signing then works fine, the code runs and I get 3 emails saying which 3 keys were used. 

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

Re: Trying to display a map but Eclipse Invoke Access Restriction

Please do the following:

 

1.  Open Eclipse' preferences and go to the the "Allow access to APIs which require the following keys" screen.

2.  Observer that no checkboxes are shown.

3.  Exit preferences.

4.  Send the .log and .log-eide log files from the .metadata directory of your work space to BetaDevSupport@rim.com (please reference this post in your email).

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.