From: Will Dinyes <white.roses@gm...> - 2005-07-22 14:57:51
I'm just getting started with jython, and have hit a snag which I have
been unable to find a satisfactory fix for thus far.
I'm trying to load some jar files from within my jython script, and
then import a specific class and run it. Since the jar files will
likely change rapidly (it's for testing a new product), I'd really
like to keep this loading functionality. Below is my code snippet,
and then the output. As you can see, the import statement is failing.
Anyway, I'll let the code and output speak for itself:
from my.package import MyClass
mc =3D MyClass()
And the output (edited for content):
*sys-package-mgr*: processing modified jar, 'C:\path\to\lib\myPackageJar.ja=
Traceback (innermost last):
File "myTest.py", line 14, in ?
ImportError: cannot import name MyClass
It's clearly finding the jar and processing it, and yet it can't import fro=
If I change the import to "from my.package import *", I get a
NullPointerException when trying to instantiate MyClass.
Any ideas? Where am I going wrong here? There are a number of
support classes (JUnit and Log4J in particular) that are referenced by
MyClass, but I've included those jars in the same directory as above,
and get the same processing message for them.
"Strange women lying in ponds=20
distributing swords is no basis=20
for a system of government!"
- Michael Palin