I find it difficult to work when jython works correctly when launched from the Eclipse plugin. I have a simple factory object that loads a python module corresponding to a Java interface. All this works great offline. However, when I package this as an eclipse plugin, I get another error based on several variables:
Given that my java package is com.foo.
1) If I run without changing any paths, I get: "There is no module named foo"
2) If I then add java jars to sys.path using:
PythonInterpreter interp = new PythonInterpreter(null, new PySystemState()); PySystemState sys = Py.getSystemState(); sys.path.append(new PyString("myjar..."));
I get:
a) My python module constructor is called (printout is output in constr)
b) I get PySingleton returned from a tojava call. The name field is Error.
3) At this point, I try to make the classpath exactly the same in Eclipse as standalone, so I add my jars to the classpath at runtime just before the python interpreter is called.
I get my favorite error message: SystemError: Automatic proxy initialization should only be performed on proxy classes
This one is driving me crazy. I was impressed with how quickly I got it offline. Should they be running under Eclipse? I believe that this should only be a matter of class, but so far this is not like this.
Adamc source share