Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Why can't get the PermissionAdmin service?
Why can't get the PermissionAdmin service? [message #72835] Fri, 01 September 2006 09:33 Go to next message
yangxiaofei is currently offline yangxiaofeiFriend
Messages: 4
Registered: July 2009
Junior Member
hi,
I write a Bundle to test the PermissionAdmin service,found I can't get
the service. Where did I need to notice when I run this? Is the code wrong?

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
public void start(BundleContext context) throws Exception {
ServiceReference[] refs = context.getServiceReferences(
PermissionAdmin.class.getName(), null);

if (refs != null) {
PermissionAdmin permissionAdmin = (PermissionAdmin) context
.getService(refs[0]);
PermissionInfo[] permssions = permissionAdmin
.getDefaultPermissions();

for (int i = 0; i < permssions.length; i++) {

System.out.println("Default Permission:"
+ permssions[i].toString());
}

} else {
System.out.println("example bundle location is :"
+ context.getBundle().getLocation());
System.out.println("Cann't get the PermissionAdmin service");
}

.................

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

When run this, I get the result like below:

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
osgi> example bundle location is :initial@reference:file:C:/Documents and
Settings/Administrator/workspace/example/
Cann't get the PermissionAdmin service
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Could you give me some help?

Thanks!
Re: Why can't get the PermissionAdmin service? [message #72894 is a reply to message #72835] Mon, 04 September 2006 22:11 Go to previous message
Eclipse UserFriend
Originally posted by: olivier.XXXXgenericXXX-XXXconcept.com

Hi Yang,

Equinox needs a SecurityManager to be abble to provide
ConditionnalPermissionAdmin and PermissionAdmin. Try to put
-Declipse.security=org.eclipse.osgi.framework.internal.core. FrameworkSecurityManager
in your launcher.

Regards

Olivier Moises
Previous Topic:security policy for equinox framework
Next Topic:Help to understand the servlet bridge
Goto Forum:
  


Current Time: Thu Apr 25 07:40:58 GMT 2024

Powered by FUDForum. Page generated in 0.03235 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top