It looks like it is not caused by the policy file but by the felix security
manager. It looks like you unpacked the framework JAR? That might be the
problem. (No codesource)

(other possibilities might be a different file path normalisation. Did you
try the same setup with a regular SE?)

Bernd
Am 21.01.2015 09:29 schrieb "Jerry Wang" <[email protected]>:

> Hi all,
>     I'm a newcomer in felix and java. The recent work is to make osgi work
> in embedded system.
>     But when setting security mode, I meet problem.
>     I use the command "jamvm -Dorg.osgi.framework.security=osgi
> -Djava.security.policy=all.policy -jar bin/felix.jar:/usr/local/
> classpath/lib/classpath:/usr/local/classpath/share/classpath:/lib -Xms4M
> -Xmx10M -Xss256K org.apache.felix.main.Main &", the error log appears.
>
> "Unable to list saved bundles. (java.lang.SecurityException: 
> java.security.AccessControlException:
> permission (java.io.FilePermission ./felix-cache read) not granted: no
> protection domains)
> java.lang.SecurityException: java.security.AccessControlException:
> permission (java.io.FilePermission ./felix-cache read) not granted: no
> protection domains
>    at org.apache.felix.framework.Felix$1.checkPermission(Felix.java:572)
>    at java.lang.SecurityManager.checkRead(SecurityManager.java:569)
>    at java.io.File.checkRead(File.java:1554)
>    at java.io.File.exists(File.java:270)
>    at org.apache.felix.framework.util.SecureAction$Actions.run(
> SecureAction.java:1206)
>    at java.security.AccessController.doPrivileged(
> AccessController.java:195)
>    at org.apache.felix.framework.util.SecureAction.fileExists(
> SecureAction.java:292)
>    at org.apache.felix.framework.cache.BundleCache.getArchives(
> BundleCache.java:117)
>    at org.apache.felix.framework.Felix.init(Felix.java:667)
>    at org.apache.felix.main.Main.main(Main.java:288)
> "
> The content in the policy file  is "grant { permission
> java.security.AllPermission; };";
>
> And I also option "-Dpolicy.provider=gnu.java.security.PolicyFile" in
> command, the problem still appeares.
>
> I think maybe it can not find the policy file,so use the absolute path
> "-Djava.security.policy=file:///data/osgi/all.policy",but it is useless.
>
> Now I can do nothing. Pls give me some advice to make policy file work.
>
> --
>
> Thanks & Best Regards
> Jerry Wang
> ************************************
> Shanghai DareGlobal Technologies Co.,Ltd.
> Add:2F Block B,Info Tech Building, No.1555,Kongjiang Road,Shanghai,PRC
> P.C:200092
> Tel:86-21-6563 5566 Ext:8603
> Fax:86-21-6501 5599
> E-mail:[email protected]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to