From: <bc...@wo...> - 2001-08-24 19:58:29
|
[Brian Zhou] >Hi all, > >About two months ago I experimented with jython on WinCE/iPaq and had some >success, now VAME (IBM visual age micro edition) has released 1.4 (== 1.3.0 >jvm), so I tried the new version. > >Good news is I don't have to copy Sun's rt.jar, and pystone shows an >improvement from 48 to 52. But adding \vame1.4\lib\jclMax\classes.zip to the >classpath option does not work, I have to work around by using a 9M >extracted .class tree. > >Here's the updated instruction: >... Sounds like a good candidate for a faq entry: 2.7 How do I install jython on my iPAQ > >Here's the part I hope someone can give me some insight, I want to know why >classes.zip cannot be in classpath: > >1. If I leave the classpath as "-cp:\jython-2.1a1\jython.jar", I can launch >jython fine, do all the python stuff, while "import java" shows "no module >named java" >2. If I use "-cp:\vame1.4\lib\jclMax\classes.zip;\jython-2.1a1\jython.jar", >I got error message: >*sys-package-mgr*: processing new jar, '\vame1.4\lib\jclMax\classes.zip' >java.lang.IndexOutOfBoundsException > >Stack trace: > java/lang/Throwable.<init>()V > java/lang/Throwable.<init>(Ljava/lang/String;)V > java/lang/IndexOutOfBoundsException.<init>(Ljava/lang/String;)V > java/util/zip/ZipInputStream.read([BII)I > java/util/zip/ZipInputStream.skip(J)J > java/io/DataInputStream.skipBytes(I)I > org/python/core/PackageManager.checkAccess(Ljava/io/InputStream;)I > ... I find the stacktrace curious. Totally unrelated to the problem you are having, but when a skip() call can cause a IOOB (perhaps because a over/underflow of the temporary buffer allocated by skip) then ZipInputStream are having serious internal problems. Perhaps OTI can be convinced to take a closer look at the IOOB exception. >3. As mentioned, extract classes.zip to directory and add directory to -cp >works fine. >4. I also tried to jar classes/ directory into a classes.jar but that caused >jython to complain "skip bad jar" > >Anyone has any idea the cause, or what to do further? As the OTI guy said, putting classes.zip on -cp isn't the solution (even if it didn't throw a IOOB). I have made a very experimental feature that allow a tool (running under java2 on windows or unix) to pre-index a zip/jar file. The pre-index is then stored inside the zip file. If you want to try it out (and I really think you should because it fixes the problems you are having with this) you will have to apply a patch to SysPackageManager.java and install a new source file in org/python/util/jythonjar.java. > http://sourceforge.net/tracker/index.php?func=detail&aid=454329&group_id=12867&atid=312867 When you have compiled the changes to jython, you run the indexer tool like this: java org.python.util.jythonjar -usecp -cp classes.zip jython.jar After this the jython.jar file is updated with a lot of entries called META-INF/JYTHON-PACKAGES-java META-INF/JYTHON-PACKAGES-java.lang ... These entries will be used when the cache dir doesn't contain entries for the packages. As a result classes.zip doesn't need to be on the -cp. regards, finn |