get scripting engine by file extension
2007-07-30 21:30:05 GMT
I have an application where I use JSR-223 for evaluating the scripts, and I use file extension for identifying the scripting engine that is required to evaluate the script:
ScriptEngineManager scriptEngineManager = new ScriptEngineManager();
ScriptEngine engine = scriptEngineManager.getEngineByExtension("groovy");
With groovy-1.0 it works fine.
but with groovy-1.1-beta2 this code throws a following exception:
Exception in thread "main" java.lang.IncompatibleClassChangeError: Found interface groovy.lang.MetaClass, but class was expected
at com.sun.script.groovy.GroovyScriptEngineFactory.getScriptEngine (GroovyScriptEngineFactory.java:87)
at <user code stack trace follows>
And in the version 1.0 there really was "public abstract class MetaClass" which is now "public interface MetaClass extends MetaObjectProtocol"
So the question is: is the groovy API not following JSR or the JSR engine implementations is outdated ? :)
Can anyone suggest?