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.
Affects: 4.2 GA
#18065 Consider Nashorn ScriptEngine instance scope in ScriptTemplateView
#18133 Improve error reporting in StandardScriptEvaluator
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.