You are missing Zope init/configuration (which initialize all Zope Products and 
python paths to them).

I use this minimal script:

import sys
import Zope2

The zcmd.conf file is a copy of my zope.conf where I remove all the zservers 
and also, as you are using zeo, you need to use a different client name in the 
<zeo> section to make sure the cache file is different.

This is just for some basic testing, as you will need to kill the script to 
terminate the python interpreter (CTRL-D won't make it) because of some Zope 
backgroup threads.


-----Message d'origine-----
De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Richard Jennings
Envoyé : mercredi 7 juin 2006 11:53
À :
Objet : [ZODB-Dev] Zeo: connection problem

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 =
        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?

Richard Jennings

Traceback (most recent call last):
  File "./", line 162, in ?
    response = request.submit()
  File "./", line 112, in submit
    app = root['Application']
  File "/usr/lib/python2.3/", line 19, in __getitem__
    def __getitem__(self, key): return[key]
  File "/opt/zope/lib/python/ZODB/", line 562, in setstate
    self._set_ghost_state(obj, p)
  File "/opt/zope/lib/python/ZODB/", line 601, in
    state = unpickler.load()
  File "/opt/zope/lib/python/ZODB/", line 198, in
    return self[oid]
  File "/opt/zope/lib/python/ZODB/", line 160, in __getitem__
    klass=self._db._classFactory(self, module, name)
  File "/opt/zope/lib/python/ZODB/", line 128, in _classFactory
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 temporary>
    # Temporary storage database (for sessions)
      name temporary storage for sessioning
    mount-point /temp_folder
    container-class Products.TemporaryFolder.TemporaryContainer

# Other storage examples
# ZEO client storage:
<zodb_db main>
  mount-point /
    server localhost:8081
    storage 1
    name zeostorage
    var $INSTANCE/var

zeo.conf (extract):

%define INSTANCE /var/opt/zope/default

  address 8081
  read-only false
  invalidation-queue-size 100
  # monitor-address PORT
  # transaction-timeout SECONDS

<filestorage 1>
  path $INSTANCE/var/Data.fs
For more information about ZODB, see the ZODB Wiki:

ZODB-Dev mailing list  -

This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.
For more information about ZODB, see the ZODB Wiki:

ZODB-Dev mailing list  -

Reply via email to