Elasticsearch6.3.2 编译失败,createClassLoader 无权限

作者 whirly | 发布于2018年08月21日 | 阅读数:202

编译Elasticsearch6.3.2 一直失败,日志如下,应该需要在哪里加一个 policy 打开权限,求大佬帮忙,怎么处理?


系统:win7 Java版本:10.0.2 IDE:IDEA2018.2.1

[2018-08-21T11:23:24,529][INFO ][o.e.n.Node ] [] initializing ...
[2018-08-21T11:23:24,634][INFO ][o.e.e.NodeEnvironment ] [EFQliuV] using [1] data paths, mounts [[(D:)]], net usable_space [140.2gb], net total_space [300.9gb], types [NTFS]
[2018-08-21T11:23:24,634][INFO ][o.e.e.NodeEnvironment ] [EFQliuV] heap size [3.9gb], compressed ordinary object pointers [true]
[2018-08-21T11:23:24,639][INFO ][o.e.n.Node ] [EFQliuV] node name derived from node ID [EFQliuV0S0SPFfubcnsYQg]; set [node.name] to override
[2018-08-21T11:23:24,639][INFO ][o.e.n.Node ] [EFQliuV] version[6.3.2-SNAPSHOT], pid[54420], build[unknown/unknown/Unknown/Unknown], OS[Windows 7/6.1/amd64], JVM["Oracle Corporation"/Java HotSpot(TM) 64-Bit Server VM/10.0.2/10.0.2+13]
[2018-08-21T11:23:24,639][INFO ][o.e.n.Node ] [EFQliuV] JVM arguments [-Des.path.home=D:\Test-workstation\elasticsearch\home, -Des.path.conf=D:\Test-workstation\elasticsearch\home\config, -Dlog4j2.disable.jmx=true, -javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2018.2.1\lib\idea_rt.jar=11721:C:\Program Files\JetBrains\IntelliJ IDEA 2018.2.1\bin, -Dfile.encoding=UTF-8]
[2018-08-21T11:23:24,639][WARN ][o.e.n.Node ] [EFQliuV] version [6.3.2-SNAPSHOT] is a pre-release version of Elasticsearch and is not suitable for production
[2018-08-21T11:23:25,105][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "createClassLoader")
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:140) ~[main/:?]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:127) ~[main/:?]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[main/:?]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[main/:?]
at org.elasticsearch.cli.Command.main(Command.java:90) ~[main/:?]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93) ~[main/:?]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:86) ~[main/:?]
Caused by: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "createClassLoader")
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472) ~[?:?]
at java.security.AccessController.checkPermission(AccessController.java:895) ~[?:?]
at java.lang.SecurityManager.checkPermission(SecurityManager.java:335) ~[?:?]
at java.lang.SecurityManager.checkCreateClassLoader(SecurityManager.java:397) ~[?:?]
at java.lang.ClassLoader.checkCreateClassLoader(ClassLoader.java:365) ~[?:?]
at java.lang.ClassLoader.checkCreateClassLoader(ClassLoader.java:355) ~[?:?]
at java.lang.ClassLoader.<init>(ClassLoader.java:434) ~[?:?]
at org.elasticsearch.plugins.ExtendedPluginsClassLoader.<init>(ExtendedPluginsClassLoader.java:36) ~[main/:?]
at org.elasticsearch.plugins.ExtendedPluginsClassLoader.lambda$create$0(ExtendedPluginsClassLoader.java:57) ~[main/:?]
at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
at org.elasticsearch.plugins.ExtendedPluginsClassLoader.create(ExtendedPluginsClassLoader.java:56) ~[main/:?]
at org.elasticsearch.plugins.PluginLoaderIndirection.createLoader(PluginLoaderIndirection.java:31) ~[main/:?]
at org.elasticsearch.plugins.PluginsService.loadBundle(PluginsService.java:632) ~[main/:?]
at org.elasticsearch.plugins.PluginsService.loadBundles(PluginsService.java:557) ~[main/:?]
at org.elasticsearch.plugins.PluginsService.<init>(PluginsService.java:162) ~[main/:?]
at org.elasticsearch.node.Node.<init>(Node.java:311) ~[main/:?]
at org.elasticsearch.node.Node.<init>(Node.java:252) ~[main/:?]
at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:213) ~[main/:?]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:213) ~[main/:?]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:326) ~[main/:?]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:136) ~[main/:?]
... 6 more
Exception: java.security.AccessControlException thrown from the UncaughtExceptionHandler in thread "Thread-2"
Process finished with exit code 1

已邀请:

rochy - rochy_he@jointsky

赞同来自: whirly

这个需要修改 JAVA_HOME/jre/lib/security/java.policy
 
具体操作可参考:
https://www.cnblogs.com/sharpest/p/7748350.html

要回复问题请先登录注册