I build a plugin of my own and the plugin layout is below:
${plugin_root}/dict(this is a folder)
${plugin_root}/plugin-descriptor.properties
${plugin_root}/plugin-security.policy
${plugin_root}/a.jar
${plugin_root}/b.jar
and this plugin needs to read/write folder ${plugin_root}/dict. so the content of plugin-security.policy is below:
grant {
permission java.io.FilePermission "-", "read";
permission java.io.FilePermission "-", "write";
};
but when running the plugin, it throw exception below:
java.security.AccessControlException: access denied ("java.io.FilePermission" "${es-root}/plugins/token-lucene/dict" "write")
can anybody help to modified the policy file to pass this security check?
Why are you trying to write something from your plugin per node? Should this instead be stored in the cluster state? Otherwise losing a node, you might lose what was written locally, or have discrepancies between nodes.
help guys:
this time I try to create class dynamic in plugin and it throws exception below:
Caused by: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "getClassLoader")
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472) ~[?:1.8.0_111]
at java.security.AccessController.checkPermission(AccessController.java:884) ~[?:1.8.0_111]
at java.lang.SecurityManager.checkPermission(SecurityManager.java:549) ~[?:1.8.0_111]
at java.lang.ClassLoader.checkClassLoaderPermission(ClassLoader.java:1528) ~[?:1.8.0_111]
at java.lang.Thread.getContextClassLoader(Thread.java:1440) ~[?:1.8.0_111]
at com.jd.jsf.gd.util.ClassLoaderUtils.getCurrentClassLoader(ClassLoaderUtils.java:43) ~[?:?]
at com.jd.jsf.gd.util.ClassLoaderUtils.forName(ClassLoaderUtils.java:97) ~[?:?]
at com.jd.jsf.gd.util.ClassLoaderUtils.forName(ClassLoaderUtils.java:81) ~[?:?]
at com.jd.jsf.gd.config.AbstractConsumerConfig.getProxyClass(AbstractConsumerConfig.java:215) ~[?:?]
at com.jd.jsf.gd.config.ConsumerConfig.refer(Consu
merConfig.java:91) ~[?:?]
my policy file is below:
grant {
permission java.lang.RuntimePermission "", "";
};
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.