This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Exception when trying to eval a Scheme form through javax.script API


Hi,

While trying to use Kawa as the ScriptEngine in a Java application that supports "any JSR-223" language, I encountered the following issue. The following program, which is essentially what the Java application does, throws the ScriptException listed after the program. I have kawa-1.14.1.jar built from the HEAD of the svn repo on the classpath.

--
Weiqi Gao

========== 8< ========== 8< ========== 8< ==========
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;

public class Foo {
    public static void main(String[] args) {
        ScriptEngineManager manager = new ScriptEngineManager();
        final ScriptEngine engine = manager.getEngineByName("kawa");
        engine.eval("(display 10)");
    }
}
========== 8< ========== 8< ========== 8< ==========

Exception in thread "main" javax.script.ScriptException: java.lang.IllegalArgumentException: Illegal character in path at index 0: <string>
	at gnu.expr.KawaScriptEngine.compile(KawaScriptEngine.java:92)
	at gnu.expr.KawaScriptEngine.eval(KawaScriptEngine.java:54)
	at gnu.expr.KawaScriptEngine.eval(KawaScriptEngine.java:48)
	at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:264)
	at Foo.main(Foo.java:14)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
Caused by: java.lang.IllegalArgumentException: Illegal character in path at index 0: <string>
	at java.net.URI.create(URI.java:852)
	at java.net.URI.resolve(URI.java:1036)
	at gnu.kawa.io.FilePath.resolve(FilePath.java:270)
	at gnu.kawa.io.Path.resolve(Path.java:308)
	at gnu.kawa.io.Path.getAbsolute(Path.java:428)
	at gnu.kawa.io.FilePath.toURL(FilePath.java:220)
	at gnu.expr.KawaScriptEngine.compile(KawaScriptEngine.java:117)
	at gnu.expr.KawaScriptEngine.compile(KawaScriptEngine.java:76)
	... 9 more
Caused by: java.net.URISyntaxException: Illegal character in path at index 0: <string>
	at java.net.URI$Parser.fail(URI.java:2848)
	at java.net.URI$Parser.checkChars(URI.java:3021)
	at java.net.URI$Parser.parseHierarchical(URI.java:3105)
	at java.net.URI$Parser.parse(URI.java:3063)
	at java.net.URI.<init>(URI.java:588)
	at java.net.URI.create(URI.java:850)
	... 16 more


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]