Hi,

I am integrating z3c.formjs to a new site. After installing z3c.formjs I
can no longer login. If I remove it, I can login again.

It causes a problem with the SessionCredentials mechanism that I am using.
The SessionCredentials annotations now contains event handlers of type
z3c.formjs.jsclientevent.caughtEvents. These cannot be pickled.

I tried both the PersisentSessionDataContainer and the RamSessionData
Container.

Does anyone have suggestions on how I might proceed with this?

Thanks,

Kevin


This is the tail of the exception

2008-07-15T15:31:38 ERROR SiteError     rm.commit(self)
------
2008-07-15T15:31:38 ERROR SiteError   File
"/opt/zope3-eggs/ZODB3-3.9.0_dev_r77011-py2.4-linux-i686.egg/ZODB/Connection.py",
line 541, in commit
------
2008-07-15T15:31:38 ERROR SiteError     self._commit(transaction)
------
2008-07-15T15:31:38 ERROR SiteError   File
"/opt/zope3-eggs/ZODB3-3.9.0_dev_r77011-py2.4-linux-i686.egg/ZODB/Connection.py",
line 586, in _commit
------
2008-07-15T15:31:38 ERROR SiteError    
self._store_objects(ObjectWriter(obj), transaction)
------
2008-07-15T15:31:38 ERROR SiteError   File
"/opt/zope3-eggs/ZODB3-3.9.0_dev_r77011-py2.4-linux-i686.egg/ZODB/Connection.py",
line 613, in _store_objects
------
2008-07-15T15:31:38 ERROR SiteError     p = writer.serialize(obj)  # This
calls __getstate__ of obj
------
2008-07-15T15:31:38 ERROR SiteError   File
"/opt/zope3-eggs/ZODB3-3.9.0_dev_r77011-py2.4-linux-i686.egg/ZODB/serialize.py",
line 408, in serialize
------
2008-07-15T15:31:38 ERROR SiteError     return self._dump(meta,
obj.__getstate__())
------
2008-07-15T15:31:38 ERROR SiteError   File
"/opt/zope3-eggs/ZODB3-3.9.0_dev_r77011-py2.4-linux-i686.egg/ZODB/serialize.py",
line 420, in _dump
------
2008-07-15T15:31:38 ERROR SiteError     self._p.dump(state)



I investigated the offending object, and it is the SessionCredentials.
After adding the ajax handlers, the SessionCredentials object is no longer
pickleable.

(pdb) state=obj.__getstate__()
(Pdb) cPickle.dumps(state)
*** UnpickleableError: Cannot pickle <type 'zope.security._proxy._Proxy'>
objects
(Pdb) state
(((('credentials', <zope.app.authentication.session.SessionCredentials
object at 0xafea8fcc>),),),)
(Pdb) credentials=state[0][0][0][1]
(Pdb) credentials.request_annotations
{'zope.app.publisher.browser.IUserPreferredLanguages': {'cached':
['en-gb', 'en']}, 'z3c.formjs.jsclientevent.caughtEvents':
[<zope.app.publication.interfaces.BeforeTraverseEvent object at
0xafea8e4c>, <zope.app.publication.interfaces.BeforeTraverseEvent object
at 0xafea8dac>, <zope.app.publication.interfaces.BeforeTraverseEvent
object at 0xafea8dcc>, <zope.contentprovider.interfaces.BeforeUpdateEvent
object at 0xafeb1b4c>, <zope.contentprovider.interfaces.BeforeUpdateEvent
object at 0xafeb1dac>, <zope.contentprovider.interfaces.BeforeUpdateEvent
object at 0xafeb1d2c>, <zope.contentprovider.interfaces.BeforeUpdateEvent
object at 0xafeb1c6c>, <zope.contentprovider.interfaces.BeforeUpdateEvent
object at 0xafeb1ccc>, <zope.contentprovider.interfaces.BeforeUpdateEvent
object at 0xafeb1c8c>, <zope.contentprovider.interfaces.BeforeUpdateEvent
object at 0xafeb1bcc>, <zope.contentprovider.interfaces.BeforeUpdateEvent
object at 0xafeb322c>, <zope.contentprovider.interfaces.BeforeUpdateEvent
object at 0xafeb344c>, <zope.contentprovider.interfaces.BeforeUpdateEvent
object at 0xafeb33cc>, <zope.contentprovider.interfaces.BeforeUpdateEvent
object at 0xafeb348c>, <zope.contentprovider.interfaces.BeforeUpdateEvent
object at 0xafeb354c>, <zope.contentprovider.interfaces.BeforeUpdateEvent
object at 0xafeb35ec>, <zope.contentprovider.interfaces.BeforeUpdateEvent
object at 0xafeb318c>, <zope.contentprovider.interfaces.BeforeUpdateEvent
object at 0xafeb362c>, <zope.contentprovider.interfaces.BeforeUpdateEvent
object at 0xafeb1a4c>, <zope.contentprovider.interfaces.BeforeUpdateEvent
object at 0xafeb1b6c>, <zope.contentprovider.interfaces.BeforeUpdateEvent
object at 0xafeb1f8c>, <zope.contentprovider.interfaces.BeforeUpdateEvent
object at 0xafeb190c>, <zope.contentprovider.interfaces.BeforeUpdateEvent
object at 0xafeb16ac>, <zope.contentprovider.interfaces.BeforeUpdateEvent
object at 0xafeb18cc>, <zope.contentprovider.interfaces.BeforeUpdateEvent
object at 0xafeb172c>, <zope.contentprovider.interfaces.BeforeUpdateEvent
object at 0xafeb18ac>]}
(Pdb)
credentials.request_annotations['z3c.formjs.jsclientevent.caughtEvents'][0]
<zope.app.publication.interfaces.BeforeTraverseEvent object at 0xafea8e4c>
(Pdb)
cPickle.dumps(credentials.request_annotations['z3c.formjs.jsclientevent.caughtEvents'][0])
*** UnpickleableError: Cannot pickle <type 'zope.security._proxy._Proxy'>
objects

(Pdb) ev =
credentials.request_annotations['z3c.formjs.jsclientevent.caughtEvents'][0]
(Pdb) ev.object
<zope.app.folder.folder.Folder object at 0xb6034b6c>
(Pdb) cPickle.dumps(ev.object)
*** UnpickleableError: Cannot pickle <type 'zope.security._proxy._Proxy'>
objects
(Pdb) cPickle.dumps(ev.request)
*** TypeError: a class that defines __slots__ without defining
__getstate__ cannot be pickled




_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users

Reply via email to