Skip to content

Commit

Permalink
use the plugin classloader for loading scripting engin
Browse files Browse the repository at this point in the history
Fixed a bug that caused the transform to fail in java 11 execution
environments like Dataproc 2.1.
  • Loading branch information
albertshau committed Aug 14, 2023
1 parent 92e9cbe commit 6d2fd3d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ private Object decodeUnion(Object object, List<Schema> schemas) {
}

private void init(@Nullable TransformContext context, FailureCollector collector) {
ScriptEngineManager manager = new ScriptEngineManager();
ScriptEngineManager manager = new ScriptEngineManager(getClass().getClassLoader());
engine = manager.getEngineByName("JavaScript");
try {
engine.eval(ScriptConstants.HELPER_DEFINITION);
Expand Down

0 comments on commit 6d2fd3d

Please sign in to comment.