Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Groovy script throws java.lang.NoClassDefFoundError: groovy/lang/Reference #16657

Closed
masaruh opened this issue Feb 14, 2016 · 1 comment
Closed

Groovy script throws java.lang.NoClassDefFoundError: groovy/lang/Reference #16657

masaruh opened this issue Feb 14, 2016 · 1 comment

Comments

@masaruh
Copy link
Contributor

@masaruh masaruh commented Feb 14, 2016

Elasticsearch 2.2.0.

Combination of def keyword and closure gives the exception.

This gives java.lang.NoClassDefFoundError: groovy/lang/Reference:

GET index/_search
{
  "script_fields": {
    "test_script": {
      "script": {
        "inline": "def val = \"\"; p.each{ val += it }; val",
        "params": {
          "p":["aaa", "bbb", "ccc"]
        }
      }
    }
  }
}

This is fine:

GET index/_search
{
  "script_fields": {
    "test_script": {
      "script": {
        "inline": "val = \"\"; p.each{ val += it }; val",
        "params": {
          "p":["aaa", "bbb", "ccc"]
        }
      }
    }
  }
}

Adding permission org.elasticsearch.script.ClassPermission "groovy.lang.Reference" in modules/lang-groovy/plugin-security.policy seems to fix the issue.

@jasontedor

This comment has been minimized.

Copy link
Member

@jasontedor jasontedor commented Feb 14, 2016

Closed by #16660

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.