[armedbear-devel] loading from jar files

Alessio Stalla alessiostalla at gmail.com
Fri Jan 8 15:47:03 UTC 2010


On Fri, Jan 8, 2010 at 4:02 PM, Alan Ruttenberg
<alanruttenberg at gmail.com> wrote:
>>
>> What do those .abcl files contain? It seems to me that loading them
>> fails because they're always assumed to be zip files, while they can
>> also be plain text files (that's what happens at line 231 of
>> Load.java); however, this is (apparently) unrelated to whether they
>> are in a subdirectory or not, so I'm not sure we're observing the same
>> problem.
>>
>> Ale
>>
>
> Here's the test. Both files are the same .abcl, compiled from a one
> line lisp program. The only difference is that one is in a
> subdirectory.

Ok, thank you very much. I found the problem. Load.java passes an
incorrect entry name for entries in subdirectories: it keeps the full
path, instead of using just the file name. As soon as I get home I
will commit the fix.

The other problem I found still remains: when the .abcl is not a
packed fasl but a text file (it is so, for example, in abcl.jar
itself), we shouldn't die with a NPE, but rather load the file.

Bye,
Ale

> laptop:~/repos/lsw/trunk/patches % cat test.lisp
> (print 'hello-from-jar)
>
> (compile-file "~/lsw/patches/test.lisp")
> ; Compiling /Users/alanr/repos/lsw/trunk/patches/test.lisp ...
> ; (PRINT (QUOTE HELLO-FROM-JAR))
> ; Wrote /Users/alanr/lsw/patches/test.abcl (0.083 seconds)
> #P"/Users/alanr/repos/lsw/trunk/patches/test.abcl"
>
> laptop:~/repos/lsw/trunk/patches % mkdir sub
> laptop:~/repos/lsw/trunk/patches % cp test.abcl sub
> laptop:~/repos/lsw/trunk/patches % jar cf test9.jar test.abcl
> laptop:~/repos/lsw/trunk/patches % jar cf test10.jar sub/test.abcl
> laptop:~/repos/lsw/trunk/patches % jar tf test9.jar
> META-INF/
> META-INF/MANIFEST.MF
> test.abcl
> laptop:~/repos/lsw/trunk/patches % jar tf test10.jar
> META-INF/
> META-INF/MANIFEST.MF
> sub/test.abcl
>
> CL-USER(7): (load
> "jar:file:/Users/alanr/repos/lsw/trunk/patches/test9.jar!/test.abcl")
> ; Loading jar:file:/Users/alanr/repos/lsw/trunk/patches/test9.jar!/test.abcl ...
>
> HELLO-FROM-JAR
> ; Loaded jar:file:/Users/alanr/repos/lsw/trunk/patches/test9.jar!/test.abcl
> (0.0020 seconds)
> T
> CL-USER(8): (load
> "jar:file:/Users/alanr/repos/lsw/trunk/patches/test10.jar!/sub/test.abcl")
> java.lang.NullPointerException
>        at org.armedbear.lisp.Utilities.getZippedZipEntryAsByteArray(Utilities.java:153)
>        at org.armedbear.lisp.Utilities.getZippedZipEntryAsInputStream(Utilities.java:177)
>        at org.armedbear.lisp.Load.load(Load.java:231)
>        at org.armedbear.lisp.Load.load(Load.java:754)
>




More information about the armedbear-devel mailing list