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

Class loader issue with Groovy Module #19670

Closed
nknize opened this issue Jul 28, 2016 · 1 comment
Closed

Class loader issue with Groovy Module #19670

nknize opened this issue Jul 28, 2016 · 1 comment
Labels
:Core/Infra/Scripting Scripting abstractions, Painless, and Mustache >non-issue

Comments

@nknize
Copy link
Contributor

nknize commented Jul 28, 2016

Uncovered this issue on master while investigating #17506

It appears the Groovy module may be using a different class loader which is causing class resolution errors during script compilation.

Reproduction:

Try the following in a script_field:

"script": "import org.elasticsearch.common.Strings; org.elasticsearch.common.Strings.hasLength(\"foo\")"

Error:

{
  "type": "script_exception",
  "reason": "Error compiling script d8fc6d7a038969a64764034a31e17fd0f336e955",
  "script_stack": [
    "d8fc6d7a038969a64764034a31e17fd0f336e955: 1: unable to resolve class org.elasticsearch.common.Strings\n @ line 1, column 1.\n   import org.elasticsearch.common.Strings; org.elasticsearch.common.Strings.hasLength(\"foo\")\n   ^\n"
  ],
  "script": "import org.elasticsearch.common.Strings; org.elasticsearch.common.Strings.hasLength(\"foo\")",
  "lang": "groovy"
}

This looks highly problematic. Upgrading from 2.x to 5.x will potentially break existing groovy scripts?

@nknize nknize added >bug discuss :Core/Infra/Scripting Scripting abstractions, Painless, and Mustache v5.0.0-alpha5 >non-issue and removed >bug discuss labels Jul 28, 2016
@nknize
Copy link
Contributor Author

nknize commented Jul 28, 2016

@rjernst pointed me to the ClassPermission policy lock down in 2.2 so I'm closing this as a non-issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Scripting Scripting abstractions, Painless, and Mustache >non-issue
Projects
None yet
Development

No branches or pull requests

2 participants