Dump a jvm configuration using jython
server = AdminConfig.getid(‘/Server:yourServerName/’)
jvm = AdminConfig.list(‘JavaVirtualMachine’,server)
print AdminConfig.show(jvm)
or
print AdminConfig.showall(jvm)
or
print AdminConfig.showAttribute(jvm,’systemProperties’)
WASX7015E: Exception running command: “os.remove(“E:\san\EARDeploymentProject\AppName.txt”)”; exception information:
com.ibm.bsf.BSFException: exception from Jython: Traceback (innermost last):
File “<input>”, line 1, in ?
ImportError: no module named javaos
or errors like
ImportError: no module named fnmatch
————————————-
Solution:
1. WebSphere v6.1 execution and debugging
Because WebSphere v6.1 now includes the complete Jython Lib within <WASROOT>\optionalLibraries\jython, the converted wsadmin Jython scripts have full access to all the Jython library functions. And, because the debugging module pdb.py is in that Lib, the v6.1 Application Server Toolkit (AST) Jython Debugger can debug wsadmin Jython programs using a local WebSphere v6.1 installation, and this is fully supported.
2. WebSphere v5.1 or v6.0 execution
Older WebSphere v5.1 and v6.0 only included the core jython.jar and did not reship the Jython library Lib directory. If your Jacl2Jython converted wsadmin Jython program makes use of any of the above runtime library functions, and if you attempt to run that Jython script on an older WebSphere v5.1 or v6.0 installation, then you will need to manually add a Jython Lib directory to the same location as the WebSphere jython.jar (typically <WASROOT>\lib for version 5.1, <WASROOT>\optionalLibraries for v6.0.0.0, <WASROOT>\optionalLibraries\jython for v6.0.0.2 or later. For maximum compatibility the Jython Lib directory should be copied from a WebSphere v6.1 (which uses the same Jython v2.1.3 distribution). However, since this is not the way the older WebSphere product was shipped, such a change is officially unsupported.
Found this solution on http://fixunix.com/websphere/365859-websphere-wsadmin-scripting-import-os-module-error-versionbelow-6-1-a.html
Print