odd exception in JPython execution

Jason Crickmer jason at jedi.net
Thu Apr 13 15:51:32 EDT 2000


I am using JPython as an evalator for Java.  It works in some cases, and
not others.  But, the failures are consistent.  Basicly, given a
PythonInterpreter, I set several variables into it and then call eval()
(I have also tried exec(), but it has the same problems).

Here is an example of what happens:

  PythonInterpreter interp = new PythonInterpreter();

  ...

  interp.set("scale", "0.5");

  ...


  String result = interp.eval("scale").toString();


At this point, an exception in thrown:

Traceback (innermost last):
  (no code object) at line 0
java.lang.NoClassDefFoundError: org/python/core/PyFunctionTable
 at java.lang.ClassLoader.defineClass0(Native Method)
 at java.lang.ClassLoader.defineClass(ClassLoader.java:442)
 at java.lang.ClassLoader.defineClass(ClassLoader.java:392)
 at
org.python.core.BytecodeLoader.loadClassFromBytes(BytecodeLoader.java:76)

 at org.python.core.BytecodeLoader.loadBytes(BytecodeLoader.java:92)  at
org.python.core.BytecodeLoader.makeCode(BytecodeLoader.java:103)  at
org.python.core.Py.compile(Py.java:1341)  at
org.python.core.Py.compile(Py.java:1354)  at
org.python.core.__builtin__.compile(__builtin__.java:188)  at
org.python.core.Py.exec(Py.java:946)  at
org.python.util.PythonInterpreter.exec(PythonInterpreter.java:111)  at
com.hire.services.export.PythonEntityResolver.resolveEscriptEntity(PythonEnti
tyResolver.java:551)

 at
com.hire.services.export.PythonEntityResolver.resolveEntity(PythonEntityResol
ver.java:471)

 at
com.hire.er.EREntityResolver.resolveEntity(EREntityResolver.java:319)
 ...


I am using Sun's Java 1.2.2-RC2 JRE with native theads and no JIT on
Linux.  I am also using JPython 1.1.  Anyone have any ideas?

Thanks,
Jason


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list