ObjectWeb Consortium
Search ObjectWeb Mail Archive: 

Advanced Search - Powered by Google


Mail Archive Home | oscar List | December 2005 Index

<--  Date Index  --> <--  Thread Index    

Problems about security manager in "Permission Admin Service"


Dear Sir/Madam:

         I have met a question when adding security control in Permission Admin Service.  My environment is Eclipse+JDK 1.50.  and other elements are listed as follows:

         (1) The run configuration:  “java ?Djava.security.manager ?Djava.security.policy=default.policy org.ungoverned.oscar.Main”

         (2) the content of the security policy file “default.policy”:

grant codeBase "file:bundle/shellgui.jar" {

         permission org.osgi.framework.ServicePermission "org.ungoverned.osgi.bundle.shellgui.Plugin", "get";

};

 

grant codeBase "file:bundle/shelltui.jar" {

         permission org.osgi.framework.ServicePermission "org.ungoverned.osgi.service.shell.ShellService", "get";

};

 

grant codeBase "file:bundle/shellplugin.jar" {

         permission java.security.AllPermission;

};

 

grant codeBase "file:bundle/bundlerepository.jar" {

         permission java.security.AllPermission;

};

 

grant codeBase "file:bundle/permissionmanager.jar" {

         permission java.security.AllPermission;

};

 

grant codeBase "file:bundle/shell.jar" {

         permission java.security.AllPermission;

};

 

grant codeBase "file:D:/Workspace/Argumentation/lib/oscar.jar" {

         permission java.security.AllPermission;

};

 

grant codeBase "file:D:/Workspace/Argumentation/lib/osgi.jar" {

         permission java.security.AllPermission;

};

 

grant codeBase "file:D:/Workspace/Argumentation/lib/moduleloader.jar" {

         permission java.security.AllPermission;

};

 

grant codeBase "http://oscar-osgi.sf.net/repo/permissionadmin/PermissionAdmin.jar" {

         permission java.security.AllPermission;

         permission org.osgi.framework.AdminPermission;

  permission org.osgi.framework.ServicePermission "org.osgi.service.permissionadmin.PermissionAdmin", "register";

  permission java.security.SecurityPermission "setPolicy";

};

 

grant codeBase "http://oscar-osgi.sf.net/repo/permissionmanager/permissionmanager.jar" {

         permission java.security.AllPermission;

};

 

grant codeBase "http://oscar-osgi.sf.net/repo/permissionadmincommands/PermissionAdminCommands.jar" {

         permission java.security.AllPermission;

};

 

grant {

  permission java.io.FilePermission "${user.home}${file.separator}.oscar${file.separator}-", "read, write, delete";

         permission org.osgi.framework.PackagePermission "*", "EXPORT";

};

 

grant {

  permission java.net.SocketPermission "*", "resolve";

  permission java.io.FilePermission "${user.home}\\.oscar\\-", "read, write, delete";

  permission org.osgi.framework.PackagePermission "*", "EXPORT";

};

 

         (3) the errors after running the Oscar:

Welcome to Oscar.

=================

 

Enter profile name: actuator

 

java.security.AccessControlException: access denied (java.security.SecurityPermission setPolicy)

    at java.security.AccessControlContext.checkPermission(Unknown Source)

    at java.security.AccessController.checkPermission(Unknown Source)

    at java.lang.SecurityManager.checkPermission(Unknown Source)

    at java.security.Policy.setPolicy(Unknown Source)

    at com.trialog.OSGi.permissionAdmin.PermissionAdminImpl.<init>(PermissionAdminImpl.java:83)

    at com.trialog.OSGi.permissionAdmin.PermissionAdminActivator.start(PermissionAdminActivator.java:49)

    at org.ungoverned.oscar.Oscar$StartStopPrivileged.run(Oscar.java:4332)

    at java.security.AccessController.doPrivileged(Native Method)

    at org.ungoverned.oscar.Oscar.startBundleWithStartLevel(Oscar.java:1827)

    at org.ungoverned.oscar.Oscar.setStartLevelInternal(Oscar.java:829)

    at org.ungoverned.oscar.Oscar.initialize(Oscar.java:628)

    at org.ungoverned.oscar.Oscar.<init>(Oscar.java:365)

    at org.ungoverned.oscar.Oscar.<init>(Oscar.java:162)

    at org.ungoverned.oscar.Main.main(Main.java:95)

Oscar: Error starting http://oscar-osgi.sf.net/repo/permissionadmin/PermissionAdmin.jar

java.lang.NullPointerException: Specified service reference cannot be null.

    at org.ungoverned.oscar.BundleContextImpl.getService(BundleContextImpl.java:253)

    at com.trialog.OSGi.paCmd.Activator.start(Activator.java:87)

    at org.ungoverned.oscar.Oscar$StartStopPrivileged.run(Oscar.java:4332)

    at java.security.AccessController.doPrivileged(Native Method)

    at org.ungoverned.oscar.Oscar.startBundleWithStartLevel(Oscar.java:1827)

    at org.ungoverned.oscar.Oscar.setStartLevelInternal(Oscar.java:829)

    at org.ungoverned.oscar.Oscar.initialize(Oscar.java:628)

    at org.ungoverned.oscar.Oscar.<init>(Oscar.java:365)

    at org.ungoverned.oscar.Oscar.<init>(Oscar.java:162)

    at org.ungoverned.oscar.Main.main(Main.java:95)

Oscar: Error starting http://oscar-osgi.sf.net/repo/permissionadmincommands/PermissionAdminCommands.jar

        

         (4)  my “permissions.xml” is empty.  The file is needed by “Permission Admin Service”

         My problem is why this happens.  Is there some settlement?

 

Best Regards

Yang

       



<--  Date Index  --> <--  Thread Index    

Reply via email to:

Powered by MHonArc.

Copyright © 1999-2005, ObjectWeb Consortium | contact | webmaster.