I am executing from my java application the following code using elasticsearch java api 5.6.10, I am execute an update using and use the groovy script inline
bulkRequest.add(
transportClient
.prepareUpdate(indexName, ResultType.RESULT.toString(), (String) obj.get("id"))
.setScript(new Script(ScriptType.INLINE,"groovy",script,params))
.setScriptedUpsert(true)
.setRetryOnConflict(configuration.db().saveMaxRetry())
.setUpsert(obj));
}
BulkResponse response = bulkRequest.execute().actionGet();
I am receiving the following error in elasticsearch cluster log:
Caused by: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessDeclaredMembers")
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472) ~[?:1.8.0_171]
at java.security.AccessController.checkPermission(AccessController.java:884) ~[?:1.8.0_171]
at java.lang.SecurityManager.checkPermission(SecurityManager.java:549) ~[?:1.8.0_171]
at java.lang.Class.checkMemberAccess(Class.java:2348) ~[?:1.8.0_171]
at java.lang.Class.getDeclaredFields(Class.java:1915) ~[?:1.8.0_171]
at org.codehaus.groovy.vmplugin.v5.Java5.configureClassNode(Java5.java:356) ~[?:?]
at org.codehaus.groovy.ast.ClassNode.lazyClassInit(ClassNode.java:265) ~[?:?]
at org.codehaus.groovy.ast.ClassNode.getUnresolvedSuperClass(ClassNode.java:1004) ~[?:?]
at org.codehaus.groovy.ast.ClassNode.getUnresolvedSuperClass(ClassNode.java:999) ~[?:?]
at org.codehaus.groovy.control.ResolveVisitor.checkCyclicInheritence(ResolveVisitor.java:1284) ~[?:?]
at org.codehaus.groovy.control.ResolveVisitor.checkCyclicInheritence(ResolveVisitor.java:1284) ~[?:?]
at org.codehaus.groovy.control.ResolveVisitor.checkCyclicInheritence(ResolveVisitor.java:1284) ~[?:?]
at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1261) ~[?:?]
at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:178) ~[?:?]
at org.codehaus.groovy.control.CompilationUnit$11.call(CompilationUnit.java:651) ~[?:?]
at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:931) ~[?:?]
... 38 more