[ZODB-Dev] Zeo: connection problem
Richard Jennings
richard.jennings at cryptoflow.com
Wed Jun 7 05:53:04 EDT 2006
Hi,
I have a Zope2.7.2/Zeo2.2.2 instance running, using the standard zope.conf &
zeo.conf settings (exception: port=8081) and it works fine. I want read-only
access to the instance zodb to read site object properties. In a test
script, I have used the apparently classic pattern, shown below:
addr = ('localhost', 8081)
storage = ClientStorage.ClientStorage(addr)
db = DB(storage)
conn = db.open()
root = conn.root()
app = root['Application']
This results in the exception shown below.
The pattern is so basic and simple, it seems difficult to make a mistake, but
I am! Can someone tell me what?
Thanks,
Richard Jennings
___________________________________________
Traceback (most recent call last):
File "./ZeoTest.py", line 162, in ?
response = request.submit()
File "./ZeoTest.py", line 112, in submit
app = root['Application']
File "/usr/lib/python2.3/UserDict.py", line 19, in __getitem__
def __getitem__(self, key): return self.data[key]
File "/opt/zope/lib/python/ZODB/Connection.py", line 562, in setstate
self._set_ghost_state(obj, p)
File "/opt/zope/lib/python/ZODB/Connection.py", line 601, in
_set_ghost_state
state = unpickler.load()
File "/opt/zope/lib/python/ZODB/Connection.py", line 198, in
_persistent_load
return self[oid]
File "/opt/zope/lib/python/ZODB/Connection.py", line 160, in __getitem__
klass=self._db._classFactory(self, module, name)
File "/opt/zope/lib/python/ZODB/DB.py", line 128, in _classFactory
name)
AttributeError: 'module' object has no attribute 'Application'
zope.conf (extract):
#<zodb_db main>
# # Main FileStorage database
# <filestorage>
# path $INSTANCE/var/Data.fs
# </filestorage>
# mount-point /
#</zodb_db>
<zodb_db temporary>
# Temporary storage database (for sessions)
<temporarystorage>
name temporary storage for sessioning
</temporarystorage>
mount-point /temp_folder
container-class Products.TemporaryFolder.TemporaryContainer
</zodb_db>
# Other storage examples
#
# ZEO client storage:
#
<zodb_db main>
mount-point /
<zeoclient>
server localhost:8081
storage 1
name zeostorage
var $INSTANCE/var
</zeoclient>
</zodb_db>
zeo.conf (extract):
%define INSTANCE /var/opt/zope/default
<zeo>
address 8081
read-only false
invalidation-queue-size 100
# monitor-address PORT
# transaction-timeout SECONDS
</zeo>
<filestorage 1>
path $INSTANCE/var/Data.fs
</filestorage>
More information about the ZODB-Dev
mailing list