我有一个单元测试,它使用Elasticsearch的集成测试框架。使用Elasticsearch 2.0.0-2.1.2执行它时工作正常,但是当我在IntelliJ中运行最新的Elasticsearch 2.2.0时,我得到以下内容,知道需要调整哪些不使用IntelliJ中的安全管理器吗? / p>
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$2.run(Threads.java:127)
at com.carrotsearch.randomizedtesting.Threads$2.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.access$200(RandomizedRunner.java:140)
at com.carrotsearch.randomizedtesting.RandomizedRunner$2.run(RandomizedRunner.java:591)
答案 0 :(得分:6)
至少在intellij VM选项或命令行中本地设置-Deststs.security.manager = false会禁用安全管理器。
这听起来像个错误。
在ES github上发布了一个问题:https://github.com/elastic/elasticsearch/issues/16459