This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
RE: Problem with load when upgrading from 1.9.90 to 1.11
- From: Franck Krogh Mortensen <Franck dot Krogh dot Mortensen at Systematic dot com>
- To: Per Bothner <per at bothner dot com>
- Cc: "kawa at sourceware dot org" <kawa at sourceware dot org>
- Date: Mon, 23 Jan 2012 11:39:54 +0000
- Subject: RE: Problem with load when upgrading from 1.9.90 to 1.11
- References: <58CF107C278B3642A3B8684531A9FEB81E1AE0@exmbx01aar> <4F1454CD.1070808@bothner.com>
Hi,
Somehow we still cannot get version 1.11 to work.
We build compile our scheme.scm with the following command in our Ant script:
<java classname="kawa.repl" fork="yes" failonerror="yes">
<arg value="-d"/>
<arg value="${build.classes}/a/b"/>
<arg value="-P"/>
<arg value="dk.systematic."/>
<arg value="-T"/>
<arg value="scheme"/>
<arg value="--module-static"/>
<arg value="-C"/>
<arg value="${src.main.scheme}/scheme.scm"/>
<classpath refid="compile-classpath"/>
</java>
Kawa makes the scheme.class and it's inner classes in the right directory and we makes a jar-file with our application and the scheme class files.
When we call scm.eval("(load \"a.b.scheme\")") in our class which also resides in the jar-file, we gets the following Exception:
Caused by: java.lang.RuntimeException: cannot load a.b.scheme (The system cannot find the file specified)
at kawa.standard.load.apply2(load.java:47)
at kawa.standard.load.apply1(load.java:26)
at gnu.mapping.Procedure.apply(Procedure.java:130)
at gnu.mapping.Procedure.apply(Procedure.java:113)
at gnu.mapping.CallContext.runUntilDone(CallContext.java:234)
at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:348)
at gnu.expr.ModuleExp.evalModule(ModuleExp.java:185)
at gnu.expr.Language.eval(Language.java:943)
at gnu.expr.Language.eval(Language.java:883)
at gnu.expr.Language.eval(Language.java:865)
at a.b.LoadImpl.loadScheme(LoadImpl.java:43)
I've tried to decompile the generated Scheme.class file and it does not seem to have a package definition like package a.b;
Kind regards
Franck Krogh Mortensen
-----Original Message-----
From: Per Bothner [mailto:per@bothner.com]
Sent: Monday, January 16, 2012 5:48 PM
To: Franck Krogh Mortensen
Cc: kawa@sourceware.org
Subject: Re: Problem with load when upgrading from 1.9.90 to 1.11
On 01/16/2012 12:59 AM, Franck Krogh Mortensen wrote:
> Hi,
>
> We are trying to upgrade Kawa from version 1.9.90 to the current 1.11.
>
> Our problem is that load does not seem to work properly when loading a pre-complied scheme class. It is working fine with version 1.9.90.
>
> The scenario:
> We use Kawa to compile a scm file, as we do not want to compile at the startup of our application. The class files are put in a jar file.
> When we start the application the following code is called:
>
> Scheme.registerEnvironment();
> Scheme scm = new Scheme();
> scm.eval("(load \"scheme.class\")");
Instead of:
(load "a/b/c.class")
do:
(load "a.b.c")
assuming the class is in the path of the context class loader path.
(Loading a class file *not* in the classpath never worked anyway ...)
Though it's not documented, instead of eval+load you could consider doing kawa.Shell.runFileOrClass("a.b.c", false, 0)
or: kawa.Shell.runClass(clas, env)
> BTW: can the documentation for 1.9.90 be found somewhere?
If you have makeinfo installed, you can make it yourself:
cd doc; make html
It won't be as pretty as the website, but it's the same basic content.
I am actively working on updating the documentation: as soon as I've documented new features, I'll make a preview available.
--
--Per Bothner
per@bothner.com http://per.bothner.com/