* Exception when trying to eval a Scheme form through javax.script API
@ 2014-05-21 21:29 Weiqi Gao
2014-05-21 21:56 ` Per Bothner
0 siblings, 1 reply; 3+ messages in thread
From: Weiqi Gao @ 2014-05-21 21:29 UTC (permalink / raw)
To: kawa
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Exception when trying to eval a Scheme form through javax.script API
2014-05-21 21:29 Exception when trying to eval a Scheme form through javax.script API Weiqi Gao
@ 2014-05-21 21:56 ` Per Bothner
2014-05-21 23:27 ` Weiqi Gao
0 siblings, 1 reply; 3+ messages in thread
From: Per Bothner @ 2014-05-21 21:56 UTC (permalink / raw)
To: kawa
On 05/21/2014 02:29 PM, Weiqi Gao wrote:
> 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.
> ...
> 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)
Oops. Should be fixed now.
--
--Per Bothner
per@bothner.com http://per.bothner.com/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Exception when trying to eval a Scheme form through javax.script API
2014-05-21 21:56 ` Per Bothner
@ 2014-05-21 23:27 ` Weiqi Gao
0 siblings, 0 replies; 3+ messages in thread
From: Weiqi Gao @ 2014-05-21 23:27 UTC (permalink / raw)
To: kawa
Thank you. That's fast turn around.
--
Weiqi
Sent from my iPhone
> On May 21, 2014, at 4:56 PM, Per Bothner <per@bothner.com> wrote:
>
>> On 05/21/2014 02:29 PM, Weiqi Gao wrote:
>> 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.
>> ...
>> 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)
>
> Oops. Should be fixed now.
> --
> --Per Bothner
> per@bothner.com http://per.bothner.com/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-05-21 23:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-21 21:29 Exception when trying to eval a Scheme form through javax.script API Weiqi Gao
2014-05-21 21:56 ` Per Bothner
2014-05-21 23:27 ` Weiqi Gao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).