运行 Elasticsearch 2.2.0 的单元测试因 AccessControlException 失败:访问被拒绝
Running unit tests for Elasticsearch 2.2.0 fails with AccessControlException: access denied
我有一个使用 Elasticsearch 集成测试框架的单元测试。当使用 Elasticsearch 2.0.0-2.1.2 执行时它工作正常,但是当我 运行 IntelliJ 中的最新 Elasticsearch 2.2.0 时,我得到以下信息,知道需要调整什么以不使用安全管理器在 IntelliJ 中?
java.security.AccessControlException: access denied ("org.elasticsearch.ThreadPermission" "modifyArbitraryThreadGroup")
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
at java.security.AccessController.checkPermission(AccessController.java:884)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
at org.elasticsearch.SecureSM.checkThreadGroupAccess(SecureSM.java:166)
at org.elasticsearch.SecureSM.checkAccess(SecureSM.java:113)
at java.lang.ThreadGroup.checkAccess(ThreadGroup.java:315)
at java.lang.ThreadGroup.getParent(ThreadGroup.java:167)
at com.carrotsearch.randomizedtesting.Threads.run(Threads.java:127)
at com.carrotsearch.randomizedtesting.Threads.run(Threads.java:123)
at java.security.AccessController.doPrivileged(Native Method)
at com.carrotsearch.randomizedtesting.Threads.getTopThreadGroup(Threads.java:123)
at com.carrotsearch.randomizedtesting.Threads.getAllThreads(Threads.java:99)
at com.carrotsearch.randomizedtesting.ThreadLeakControl.<init>(ThreadLeakControl.java:348)
at com.carrotsearch.randomizedtesting.RandomizedRunner.runSuite(RandomizedRunner.java:673)
at com.carrotsearch.randomizedtesting.RandomizedRunner.access0(RandomizedRunner.java:140)
at com.carrotsearch.randomizedtesting.RandomizedRunner.run(RandomizedRunner.java:591)
至少在 intellij VM 选项或命令行中本地设置 -Dtests.security.manager=false 会禁用安全管理器。
这听起来像是一个错误。
在 ES github 上发布了一个问题:https://github.com/elastic/elasticsearch/issues/16459
我有一个使用 Elasticsearch 集成测试框架的单元测试。当使用 Elasticsearch 2.0.0-2.1.2 执行时它工作正常,但是当我 运行 IntelliJ 中的最新 Elasticsearch 2.2.0 时,我得到以下信息,知道需要调整什么以不使用安全管理器在 IntelliJ 中?
java.security.AccessControlException: access denied ("org.elasticsearch.ThreadPermission" "modifyArbitraryThreadGroup")
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
at java.security.AccessController.checkPermission(AccessController.java:884)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
at org.elasticsearch.SecureSM.checkThreadGroupAccess(SecureSM.java:166)
at org.elasticsearch.SecureSM.checkAccess(SecureSM.java:113)
at java.lang.ThreadGroup.checkAccess(ThreadGroup.java:315)
at java.lang.ThreadGroup.getParent(ThreadGroup.java:167)
at com.carrotsearch.randomizedtesting.Threads.run(Threads.java:127)
at com.carrotsearch.randomizedtesting.Threads.run(Threads.java:123)
at java.security.AccessController.doPrivileged(Native Method)
at com.carrotsearch.randomizedtesting.Threads.getTopThreadGroup(Threads.java:123)
at com.carrotsearch.randomizedtesting.Threads.getAllThreads(Threads.java:99)
at com.carrotsearch.randomizedtesting.ThreadLeakControl.<init>(ThreadLeakControl.java:348)
at com.carrotsearch.randomizedtesting.RandomizedRunner.runSuite(RandomizedRunner.java:673)
at com.carrotsearch.randomizedtesting.RandomizedRunner.access0(RandomizedRunner.java:140)
at com.carrotsearch.randomizedtesting.RandomizedRunner.run(RandomizedRunner.java:591)
至少在 intellij VM 选项或命令行中本地设置 -Dtests.security.manager=false 会禁用安全管理器。
这听起来像是一个错误。
在 ES github 上发布了一个问题:https://github.com/elastic/elasticsearch/issues/16459