Adding local exceptions on Cloud Security Emulation

Hi, is there a way to set security permission specifically for a single Mendix project? So that I can develop and test locally with cloud security emulation and extra permissions.  Situation is that we're struggling to get some Java library calls working in the cloud node due to security restrictions there. Though I have found out that I can change the general template that specifies the cloud security emulation policy for all my local Mendix projects this is not a desirable situation (the templace policy file can be found in the folder where Mendix is installed, e.g. C:\Program Files\Mendix\5.19.0\modeler\runtemplates\deployment\data, file is 'security.policy'. ).  This works but then it changes the security settings for all Mendix (v5.19.0) projects that I currently run. After upgrade of our current project to a more recent version this changes will impact other projects.  Generally turning of the Cloud Security Emulation in the project is also not an option, that is only a temporary workaround. Hope anyone has any suggestions for us?
2 answers

Hi David, you can enable a security policy manually by including it in your project and referring to it in the Extra JVM parameters - you can read about it at

Please keep in mind that the Java security policy can change from time to time at Mendix.



Hi Nick,

thanks for the suggestion, however I tried that and I can't get it to work. The modeler gives an exception at startup and won't run.
I'm using the option to add security rules to the existing model by setting the additional JVM parameters to "\MySecurity.policy" 
Using "" gives an error that the Security manager is already installed.

I gradually had to add more and more permissions to MySecurity.policy as Mendix requires loads of additional properties to be added that were not needed earlier. I have added whatever is reqeusted and end up with this policy:

grant { 
    //general Mendix requirements, to be refined with specifics
    permission "D:/Program Files/Mendix/5.19.0/runtime/-", "read";
    permission "-", "read";
    permission "run/-", "write"; //felixcache
    permission "run/-", "delete"; //felixcache
    permission java.util.PropertyPermission "*", "read,write";
    permission java.lang.RuntimePermission "*";
    permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
    permission "specifyStreamHandler";
    permission org.osgi.framework.AdminPermission "*", "*";    
    // Additional permissions for MyProject
    permission java.lang.RuntimePermission    "preferences", "read";
    permission java.util.PropertyPermission "", "read";
    permission java.util.PropertyPermission "com.ctc.wstx.returnNullForDefaultNamespace", "read";

However, when running the model there is an exception I can't solve:

Could not create framework: java.lang.NullPointerException: Specified service reference cannot be null.
java.lang.NullPointerException: Specified service reference cannot be null.
    at org.apache.felix.framework.BundleContextImpl.getService(
    at org.apache.felix.main.AutoProcessor.processAutoDeploy(
    at org.apache.felix.main.AutoProcessor.process(
    at org.apache.felix.main.Main.main(

This is were I got stuck. This is quite a general exception and doesn't give me a clue on what permissions could be missing. Any idea how to continue from here?