Hi all,
I'm a newcomer in java. The recent work is to make osgi work in embedded system. But when setting security mode, I meet a problem. I use the command "jamvm -Dorg.osgi.framework.security=osgi -Djava.security.policy=all.policy -cp 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.
And, I copy the felix jar in ubuntu, run it with the same command line. it is OK.
I think the felix is ok. And now I don't know how to debug the classpath.
Pls give me some advice to make policy file work.
Thanks & Best Regards Jerry Wang
--