ScriptException[dynamic scripting for [groovy] disabled] with Java API

I find the reason that it throws exception,when I press ^ to insert a space at begin of the script.disable_dynamic: false,it works rightly,I forget the rule,now it is ok!
thanks to colings86!