Quantcast
Channel: WebSphere Blog by Steve Robinson » WebSphere Jython Examples
Viewing all articles
Browse latest Browse all 10

AttributeError: instance of ‘Class’ has no attribute ‘_ClassName__InstanceVariable’

$
0
0

When coding some jython I get 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
*** 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: e
xception from Jython:
Traceback (innermost last):
File "<string>", line 141, in ?
File "<string>", line 116, in modify
File "<string>", line 105, in getAttributes
AttributeError: instance of 'JVMModifier' has no attribute '_JVMModifier__eJFN'

Solution:

In this example, I had declared in my classes instance variable but it had a syntax error. AttributeError: instance of ‘JVMModifier’ has no attribute ‘_JVMModifier__eJFN’. What this means Is that the class called JVMModifier has an attribute or class instance variable that does not exist. So in this case __eJFN did not exist. This was because I had declared, self.eJFN  when self.__eJFN was being referred to in my code.


Viewing all articles
Browse latest Browse all 10

Trending Articles