You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With ScriptTemplateView as well as StandardScriptFactory / StandardScriptEvaluator, it's common for the specified engine name to be unresolvable. Let's introspect the available engine factories and list all available script engines in our exception message. Also, let's make sure to consistently reuse ScriptEngineManager set up for our specific ClassLoader.
It turns out that ScriptEngineManager.getEngineByName returning null can mean either "no such engine known" or "engine failed to initialize", since it swallows all exceptions...
As a consequence, I've introduced a StandardScriptUtils.retrieveEngineByName helper which performs the lookup, manually checks for whether we're dealing with an initialization failure, and lists all available engine names in the exception message if actually not found.
Given this opportunity, I've also revised StandardScriptFactory for finer-grained template methods, added further configuration variants to StandardScriptEvaluator, and dealt with #18065's identification of thread-local ScriptEngine instances in ScriptTemplateView.
Juergen Hoeller opened SPR-13491 and commented
With
ScriptTemplateView
as well asStandardScriptFactory
/StandardScriptEvaluator
, it's common for the specified engine name to be unresolvable. Let's introspect the available engine factories and list all available script engines in our exception message. Also, let's make sure to consistently reuseScriptEngineManager
set up for our specificClassLoader
.Affects: 4.2 GA
Issue Links:
Referenced from: commits c7fd4cc
The text was updated successfully, but these errors were encountered: