From: <bc...@wo...> - 2001-12-18 13:32:38
|
[Andrew Kuchling] >I'm trying to build an applet with Jython 2.0 (it worked fine with >1.0something), and am getting a mysterious error from the resulting >JAR file. > >Java Traceback: > at org.python.core.Py.JavaError(Py.java:238) > at org.python.core.Py.findClassEx(Py.java:620) > ... > at java.lang.Thread.run(Thread.java:484) >Traceback (innermost last): > File "/home/akuchlin/src/mems/proto3/instrument/client/awt/MicroscopeApplet.py", line 0, in main > File "/home/akuchlin/src/mems/proto3/instrument/client/awt/PyClient.py", line 0, in main > File "/usr/local/jython-2.0/Lib/string.py", line 0, in main >java.lang.ClassFormatError: strop (Bad magic number) > >(Full traceback below, in case that information is useful.) >Inspecting the JAR file finds that strop.class isn't in it, Are you completely sure. If I create a file called "strop.class" in my cwd, I get the very same error: [d:\]\jython\jython-2.0-jdk14\jython.bat -S Jython 2.0 on java1.4.0-beta3 (JIT: null) >>> import string >>> ^Z [d:\]\jython\jython-2.0-jdk14\jython.bat -S Jython 2.0 on java1.4.0-beta3 (JIT: null) >>> f = open("strop.class", "w") >>> f.write("foobar") >>> f.close() >>> import string Traceback (innermost last): File "<console>", line 1, in ? File "d:\jython\jython-2.0-jdk14\Lib\string.py", line 418, in ? java.lang.ClassFormatError: strop (Bad magic number) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:512) at java.lang.ClassLoader.defineClass(ClassLoader.java:441) >but string.py should surely get an ImportError and continue running. Well yeah, but we have had huge problems in previous situation when we did catch java exceptions during import and tried to turn it into a python exception. And this is after all a java error, and as Javasoft say: """An Error is a subclass of Throwable that indicates serious problems that a reasonable application should not try to catch. Most such errors are abnormal conditions.""" >The >same error occurs with both the Sun and IBM JVMs. Has anyone seen this >before? Anyone got a clue about its cause? Only that some old broken strop.class file is laying around somewhere on your CLASSPATH. Maybe it is in org/python/modules where the original strop.java was. regards, finn |