[Zope] - BoboPOS problems
Pavlos Christoforou
Pavlos Christoforou <pavlos@gaaros.msrc.sunysb.edu>
Tue, 15 Dec 1998 22:35:14 -0500 (EST)
Hello Zopistas
I created an extension (a hit counter) that includes the class
definition in the same source file as the method. After a couple of days
ZopeHTTPServer crashed without any apparent reason. On restarting I got
the following errors in the server.log file:
Traceback (innermost last):
File "serve.py", line 99, in ?
ZopeHTTPServer.main(args)
File "/home/pavlos/Zope-1.9.0b2-src/ZopeHTTPServer/ZopeHTTPServer.py", line 456, in main
start(module_file,host,port,threading,env)
File "/home/pavlos/Zope-1.9.0b2-src/ZopeHTTPServer/ZopeHTTPServer.py", line 405, in start
set_published_module(module_file,BoboRequestHandler,env)
File "/home/pavlos/Zope-1.9.0b2-src/ZopeHTTPServer/ZopeHTTPServer.py", line 401, in set_published_module
__import__(name) # to catch problem modules right away
File "/home/pavlos/Zope-1.9.0b2-src/lib/python/Main.py", line 103, in ?
Bobobase=OFS.Application.open_bobobase()
File "/home/pavlos/Zope-1.9.0b2-src/lib/python/OFS/Application.py", line 319, in open_bobobase
app._setObject('Control_Panel', cpl)
File "/home/pavlos/Zope-1.9.0b2-src/lib/python/BoboPOS/PickleJar.py", line 261, in setstate
state = unpickler.load()
SystemError: Failed to import class Counter from module __main__
As I understand the problem has to do with pickle not finding the class
definition. I assume that the External methods object uses exec to load
and store only the function definition into Zope/BoboPOS and not any other
code that finds in the source file.
I hacked Main.py and included a
from Counter import Counter
but it did not work. So now I am stuck without Zope :-(
Also the change was made 2 days ago and all objects from there on include
refrences to the counter object.
Am I missing something simple or have I messed things up badly?
Pavlos