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 https://docs.oracle.com/javase/tutorial/security/tour2/step4.html.
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 "-Djava.security.policy=D:\MySecurity.policy"
Using "-Djava.security.manager" 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 java.io.FilePermission "D:/Program Files/Mendix/5.19.0/runtime/-", "read";
permission java.io.FilePermission "-", "read";
permission java.io.FilePermission "run/-", "write"; //felixcache
permission java.io.FilePermission "run/-", "delete"; //felixcache
permission java.util.PropertyPermission "*", "read,write";
permission java.lang.RuntimePermission "*";
permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
permission java.net.NetPermission "specifyStreamHandler";
permission org.osgi.framework.AdminPermission "*", "*";
// Additional permissions for MyProject
permission java.lang.RuntimePermission "preferences", "read";
permission java.util.PropertyPermission "com.sun.org.apache.xml.internal.dtm.DTMManager", "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(BundleContextImpl.java:458)
at org.apache.felix.main.AutoProcessor.processAutoDeploy(AutoProcessor.java:112)
at org.apache.felix.main.AutoProcessor.process(AutoProcessor.java:78)
at org.apache.felix.main.Main.main(Main.java:292)
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?