While testing a jython script on WebSphere Application Server for Windows I got the following error:
C:\scripts>"C:/Program Files/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/wsadmin.bat" -lang jython -f "C:/scripts/jvm. py" "c:/scripts/jvm.props" WASX7209I: Connected to process "server1" on node LW621LX6026649Node01 using SOAP connector; The type of process is: Un ManagedProcess WASX7303I: The following options are passed to the scripting environment and are available as arguments that are stored in the argv variable: "[c:/scripts/jvm.props]" *** Loading Class JVMModifier... *** Completed Loading Class JVMModifier METHOD: verboseModeClass WASX7017E: Exception received while running file "C:/scripts/jvm.py"; exception information: com.ibm.bsf.BSFException: exception from Jython: Traceback (innermost last): File "<string>", line 115, in ? NameError: myVM
When looking at the code, I was able to see that I had a call to an object’s method. My Jython had an error where the jython class method I was using was miss-spelt.
Error:
myJVM =JVMModifier(“LW621LX6026649Node01″,”server1″)
myJVM.verboseModeClass(“false”)
myJVM.verboseModeGarbageCollection(“false”)
myJVM.verboseModeJNI(“false”)
myJVM.initialHeapSize(“512″)
myJVM.maximumHeapSize(“1024″)
myJVM.modfy()
Solution:
myJVM =JVMModifier(“LW621LX6026649Node01″,”server1″)
myJVM.verboseModeClass(“false”)
myJVM.verboseModeGarbageCollection(“false”)
myJVM.verboseModeJNI(“false”)
myJVM.initialHeapSize(“512″)
myJVM.maximumHeapSize(“1024″)
myJVM.modify()