When trying to import a Jython class into another module, I get the following error:

C:\scripts>"C:/Program Files/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/wsadmin.bat" -lang jython -f "C:/scripts/class_test.py"
WASX7209I: Connected to process "server1" on node myNode01 using SOAP connector;  The type of process is: UnManagedProcess
WASX7017E: Exception received while running file "C:/scripts/class_test.py"; exception information: com.ibm.bsf.BSFException: exception from Jython:
Traceback (innermost last):
  File "<string>", line 1, in ?
ImportError: no module named classJVMProperties

The reason I get ImportError: no module named classJVMProperties is that I has a jython failed called “classJVMProperties” it is missing the “.py” extension. To import a jython module we must refer to it by the file name without the “.py” but the file must exist in the class path with the “.py” extension.


Leave a Reply