橡皮、老虎皮、狮子皮哪一个最不好?

es windows服务启动时的权限问题

Elasticsearch | 作者 kepmoving | 发布于2017年10月09日 | 阅读数:5199

windows服务启动时一直报这个错误
java.lang.ExceptionInInitializerError: null
    at org.elasticsearch.plugin.analysis.hanlp.AnalysisHanlpPlugin$$Lambda$439/71148574.get(Unknown Source) ~[?:?]
    at org.elasticsearch.index.analysis.AnalysisRegistry.buildMapping(AnalysisRegistry.java:310) ~[elasticsearch-5.1.1.jar:5.1.1]
    at org.elasticsearch.index.analysis.AnalysisRegistry.buildTokenizerFactories(AnalysisRegistry.java:171) ~[elasticsearch-5.1.1.jar:5.1.1]
    at org.elasticsearch.index.analysis.AnalysisRegistry.build(AnalysisRegistry.java:151) ~[elasticsearch-5.1.1.jar:5.1.1]
    at org.elasticsearch.index.IndexService.<init>(IndexService.java:145) ~[elasticsearch-5.1.1.jar:5.1.1]
    at org.elasticsearch.index.IndexModule.newIndexService(IndexModule.java:363) ~[elasticsearch-5.1.1.jar:5.1.1]
    at org.elasticsearch.indices.IndicesService.createIndexService(IndicesService.java:429) ~[elasticsearch-5.1.1.jar:5.1.1]
    at org.elasticsearch.indices.IndicesService.verifyIndexMetadata(IndicesService.java:462) ~[elasticsearch-5.1.1.jar:5.1.1]
    at org.elasticsearch.gateway.Gateway.performStateRecovery(Gateway.java:135) ~[elasticsearch-5.1.1.jar:5.1.1]
    at org.elasticsearch.gateway.GatewayService$1.doRun(GatewayService.java:229) ~[elasticsearch-5.1.1.jar:5.1.1]
    at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:527) ~[elasticsearch-5.1.1.jar:5.1.1]
    at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) ~[elasticsearch-5.1.1.jar:5.1.1]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[?:1.8.0_31]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[?:1.8.0_31]
    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_31]
Caused by: java.security.AccessControlException: access denied ("java.util.PropertyPermission" "*" "read,write")
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:457) ~[?:1.8.0_31]
    at java.security.AccessController.checkPermission(AccessController.java:884) ~[?:1.8.0_31]
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:549) ~[?:1.8.0_31]
    at java.lang.SecurityManager.checkPropertiesAccess(SecurityManager.java:1262) ~[?:1.8.0_31]
    at java.lang.System.getProperties(System.java:627) ~[?:1.8.0_31]
    at org.elasticsearch.index.analysis.HanLPTokenizerFactory.<clinit>(HanLPTokenizerFactory.java:20) ~[?:?]
    ... 15 more
分词器用的是自己实现的一套,直接bin里面双击打开的话,没有报错,
plugin-security.policy文件里面也已经加了以下内容
permission java.security.AllPermission;
    permission java.util.PropertyPermission "*","read,write";
    permission java.lang.RuntimePermission "accessClassInPackage.sun.jdbc.odbc"; 
    permission java.util.PropertyPermission "file.encoding", "read"; 
    permission   java.util.PropertyPermission   "user.dir ",   "read "; 
    permission   java.util.PropertyPermission   "user.home ",   "read "; 
    permission   java.util.PropertyPermission   "java.home ",   "read "; 
    permission   java.util.PropertyPermission   "java.class.path ",   "read "; 
    permission   java.util.PropertyPermission   "user.name ",   "read "; 
    permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
    permission java.lang.RuntimePermission "getClassLoader";
    permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
    permission java.lang.RuntimePermission "getClassLoader";
    permission org.elasticsearch.script.ClassPermission "com.hankcs.*";
    permission org.elasticsearch.script.ClassPermission "org.elasticsearch.*";
已邀请:

medcl - 今晚打老虎。

赞同来自:

plugin-security.policy 文件是不是有问题?上面贴的是完整内容么?

要回复问题请先登录注册