java.security.policy system property is ignored and the system always uses the gs.policy file which is inside BUILD/lib/platform/boot/gs-boot.jar/com/gigaspaces/start.
The documentation says that there is an option to use this system property in order to point to another policy file (http://docs.gigaspaces.com/xap97/java-security-policy-file.html) but it ignores it.
The problem is probably in com.gigaspaces.start.SystemBoot (Line 146 - ensureSecurityManager method) - always takes the file which is inside the jar.
When the hard coded policy file is removed from the build (gs.policy inside the boot.jar file) the –Djava.security.policy system property worked.
The gs.sh should set the system property (–Djava.security.policy) to the policy file (at least by default should be pointed to the BUILD/policy/policy.all file).
P.S when trying to execute loadGSCWithSystemProperty from SGTest it fails to get the system property and doesn't create a GSC while loadGSC does creates a GSC successfully.
Attached a correct policy file.
work around: remove policy file from installation(gs.policy inside the boot.jar ).